Skip to content

# Unit related JSON files

- Units.json
- UnitPromotions.json
- UnitTypes.json

## Units.json

Link to original

This file should contain a list of all the units, both military and civilian, that you want to use in your mod.

Each unit can have the following attributes: | attribute | Type | optional or not | notes | | --------- | ---- | -------- | ----- | | name | String | required | The name of the units (required) | | unitType | String | required | The type of the unit. Must be in UnitTypes.json | | cost | Integer (≥0) | defaults to 0 | The amount of production required to build this unit | | movement | Integer (≥0) | defaults to 0 | The amount of movement points the unit has by default | | strength | Integer (≥0) | defaults to 0 | The melee attack and defensive strength of the unit. If this and rangedStrength are ommited or 0, the unit will be a civilian | | rangedStrength | Integer (≥0) | defaults to 0 | The ranged attack strength of the unit. If omitted, the unit cannot ranged attack | | range | Integer (≥0) | defaults to 2 | The default range from which ranged attacks can be preformed | | interceptRange | Integer (≥0) | defaults to 0 | Air units attacking within in this range will be intercepted | | requiredTech | String | defaults to none | The tech required to build this unit. Must be in Techs.json | | obsoleteTech | String | defaults to none | After researching this tech, the unit can no longer be build. Must be in Techs.json | | requiredResource | String | defaults to none | Resource that is consumed by building this unit. Must be in TileResources.json | | upgradesTo | String | defaults to none | Unit that this unit can upgrade to when it is available. Must be in Units.json | | replaces | String | defaults to none | If this unit is unique to a nation, this is the unit it replaces. Must be in Units.json | | uniqueTo | String | defaults to none | The nation that this unit is unique to. Must be in Nations.json | | hurryCostModifier | Integer | defaults to 0 | If this unit is bought for gold/faith, it's price is increased by so much percent | | promotions | List of Strings | defaults to none | A list of all the promotions the unit automatically receives upon being built. Each promotion must be in UnitPromotions.json | | uniques | List of Strings | defaults to none | A list of the unique abilities this unit has. A list of almost all uniques can be found here | | replacementTextForUniques | String | defaults to none | If provided, this will be displayed instead of the list of uniques. Can be used for better formatting. | | attackSound | String | defaults to none | The sound that is to be played when this unit attacks. For possible values, see sounds | civilopediaText | List | Default empty | see civilopediaText chapter |

## UnitPromotions.json

Link to original

This file lists the available unit promotions.

Each promotion must have an icon, except progressions ending in " I", " II", " III" (no IV V VI allowed) are rendered by looking up an icon without those suffixes and adding stars.

Remember, promotions can be "bought" with XP, but also granted by the unit type, buildings, wonders and such. They are preserved when a unit upgrades, therefore special properties of nation unique units that can be inherited when they upgrade should be in a promotion, not uniques/stats in the units json (example: Slinger withdraw).

Each promotion can have the following properties: | Attribute | Type | Optional? | Notes | |-----------|------|-----------|-------| | name | String | Required | See above for "I, II, III" progressions | | prerequisites | List | Default empty | Prerequisite promotions | | effect | String | Default empty | Deprecated, use uniques instead | | unitTypes | List | Default empty | The unit types for which this promotion applies as specified in UnitTypes.json | | uniques | List | Default empty | List of effects, see here | | civilopediaText | List | Default empty | see civilopediaText chapter |

## UnitTypes.json

Link to original

This optional file is used for defining new types of units. The names of these can be used in unitFilters, and these types determine what domain the unit moves in: over land, over water or through the air. If the file is ommitted, the following are automatically added: Civilian, Melee, Ranged, Scout, Mounted, Armor, Siege, WaterCivilian, WaterMelee, WaterRanged, WaterSubmarine, WaterAircraftCarrier, Fighter, Bomber, AtomicBomber, and Missile.

attribute | Type | optional or not | notes
--- | --- | --- | ---
name | String | required | The name of the unit type
movementType | String | required | The domain through which the unit moves. Allowed values: "Water", "Land", "Air"
uniques | List of String | defaults to none | A list of the unique abilities every unit of this type has. A list of almost all uniques can be found here

## Sounds

Standard values are below. The sounds themselves can be found here.

- arrow, artillery, bombard, bombing, cannon, chimes, choir, click, coin, construction, elephant, fortify, gdrAttack, horse, jetgun, machinegun, metalhit, missile, nonmetalhit, nuke, paper, policy, promote, setup, shipguns, shot, slider, swap, tankshot, throw, torpedo, upgrade, whoosh.

Mods can add their own sounds, as long as any new value in attackSound has a corresponding sound file in the mod's sound folder, using one of the formats mp3, ogg or wav (file name extension must match codec used). Remember, names are case sensitive. Small sizes strongly recommended, Unciv's own sounds use 24kHz joint stereo 8-bit VBR at about 50-100kBps.