Modders wiki updating (#10688)

* xpForNewUnits is not used anymore

* Adding links to json files

* Redid some tables (TODO)

* Deprecate cannotBeBuiltWith

* Update 2-Civilization-related-JSON-files.md

Standardised uniques link and description
Miscellaneous changes to grammar to be consistent

* First round of amendment

Fixed up some links
Made grammar more consistent
Removed deprecated `effect` from ModOptions.json
Added CityStateTypes.json

* Second round of amendment
Made grammar more consistent
Changed `Optional` header to `Default`
Removed tabs from json code
Changed all stats to a `<stats>`

* Undid accidental replacement

* Undid accidental replacement

* Made list more consistent

* Rewrote policy branch and turns in eras.json

* Third round of amendment

Split stats
Fixed a couple of stuff idk tbh

* Added stats

* Added nationFilter

* Final amendment

* Adding markdown table format based on suggestion

* Fixed errors/suggestions based on reviews

changed building.cost default to be -1
added footnotes for improvements instead of list
removed faith from unit.hurryCostModifier
removed assosciation of nationFilter with civFilter
This commit is contained in:
Why-not-now
2023-12-29 04:06:40 +08:00
committed by GitHub
parent 278288442b
commit 54afc5c350
6 changed files with 666 additions and 525 deletions

View File

@ -78,3 +78,22 @@ ij_properties_spaces_around_key_value_delimiter = false
[{*.yaml, *.yml}]
indent_size = 2
[{*.markdown,*.md}]
ij_continuation_indent_size = 4
ij_markdown_force_one_space_after_blockquote_symbol = true
ij_markdown_force_one_space_after_header_symbol = true
ij_markdown_force_one_space_after_list_bullet = false
ij_markdown_force_one_space_between_words = true
ij_markdown_format_tables = false
ij_markdown_insert_quote_arrows_on_wrap = true
ij_markdown_keep_indents_on_empty_lines = false
ij_markdown_keep_line_breaks_inside_text_blocks = true
ij_markdown_max_lines_around_block_elements = 1
ij_markdown_max_lines_around_header = 1
ij_markdown_max_lines_between_paragraphs = 1
ij_markdown_min_lines_around_block_elements = 1
ij_markdown_min_lines_around_header = 1
ij_markdown_min_lines_between_paragraphs = 1
ij_markdown_wrap_text_if_long = true
ij_markdown_wrap_text_inside_blockquotes = false

View File

@ -6,56 +6,47 @@
This file contains the beliefs that can be chosen for religions in your mod.
Each belief can have the following attributes:
Each belief has the following structure:
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | Required | Name of the belief |
| type | Enum | Required | Pantheon, Follower, Founder or Enhancer. |
| uniques | List of Strings | defaults to none | The unique abilities this belief adds to cities following it. May be chosen from the list of building uniques [here](../Unique-parameters.md#buildings-only), as well as the general uniques on that page |
| civilopediaText | List | Default empty | see [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| type | Enum | Required | Type of belief. Value must be Pantheon, Founder, Follower or Enhancer |
| uniques | List of Strings | empty | List of [unique abilities](../uniques) this belief adds to cities following it |
| civilopediaText | List | empty | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
## Buildings.json
[link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/Buildings.json)
This file should contain all the buildings and wonders you want to use in your mod.
This file contains all the buildings and wonders you want to use in your mod.
Each building can have the following attributes:
Each building has the following structure:
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | required | Name of the building |
| cost | Integer (≥0) | defaults to 0 | Amount of production required to build the building |
| food | Integer | defaults to 0 | Food produced by the building |
| production | Integer | defaults to 0 | Production produced by the building |
| gold | Integer | defaults to 0 | etc. |
| happiness | Integer | defaults to 0 | |
| culture | Integer | defaults to 0 | |
| science | Integer | defaults to 0 | |
| faith | Integer | defaults to 0 | |
| maintenance | Integer (≥0) | defaults to 0 | Maintenance cost of the building |
| isWonder | Boolean | defaults to false | Whether this building is a global wonder |
| isNationalWonder | Boolean | defaults to false | Whether this building is a national wonder |
| requiredBuilding | String | defaults to none | A building that has to be built before this building can be built. Must be in [Buildings.json](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Buildings.json) |
| cannotBeBuiltWith | String | defaults to none | The building [cannotBeBuiltWith] and this building cannot exist in the same city together. Should be in [Buildings.json](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Buildings.json) |
| providesFreeBuilding | String | defaults to none | When the building is built, [providesFreeBuilding] is also automatically added to the city |
| requiredTech | String | defaults to none | The tech that should be researched before this building may be built. Must be in [Techs.json](#techsjson) |
| requiredResource | String | defaults to none | The resource that is consumed when building this building. Must be in [TileResources.json](3-Map-related-JSON-files.md#tileresourcesjson) |
| requiredNearbyImprovedResources | List of Strings | defaults to none | The building can only be built if any of the resources in this list are within the borders of this city and have been improved. Each resource must be in [TileResources.json](3-Map-related-JSON-files.md#tileresourcesjson) |
| replaces | String | defaults to none | The name of a building that should be replaced by this building. Must be in [Buildings.json](#buildingsjson) |
| uniqueTo | String | defaults to none | If supplied, only the nation with this name can build this building. Must be in [Nations.json](#nationsjson) |
| xpForNewUnits | Integer | defaults to 0 | XP granted automatically to units built in this city |
| cityStrength | Integer | defaults to 0 | Strength bonus the city in which this building is built receives |
| cityHealth | Integer | defaults to 0 | Health bonus the city in which this building is built receives |
| hurryCostModifier | Integer | defaults to 0 | When this building is bought using gold or faith, the price is increased by this much percent |
| quote | String | defaults to none | If this building is a (national) wonder, this string will be shown on the completion popup |
| uniques | List of Strings | defaults to none | List of unique abilities this building has. Most of these can be found [here](../Modders/uniques) |
| replacementTextForUniques | String | defaults to none | If provided, this string will be shown instead of all of the uniques |
| percentStatBonus | Object | defaults to none | Percentual bonus for stats provided by the building. Valid keys are the names of stats (production, gold, science, etc.), valid values are Integers (≥0) |
| greatPersonPoints | Object | defaults to none | How many great person points for each type will be generated per turn. Valid keys are the names of great people (Great Scientist, Great Engineer, etc. .), valid values are Integers (≥0) |
| specialistSlots | Object | defaults to none | Specialist slots provided by this building. Valid keys are the names of specialists (as defined in [Specialists.json](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Specialists.json)), valid values are Integers, the amount of slots provided for this specialist |
| civilopediaText | List | Default empty | see [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| cost | Integer | -1 | Amount of production required to build the building. If -1, the `buildingCost` from `requiredTech` [column](#column-structure) is used |
| [`<stats>`](3-Map-related-JSON-files.md#general-stat) | Float | 0 | Per-turn yield produced by the building |
| maintenance | Integer | 0 | Maintenance cost of the building |
| isWonder | Boolean | false | Whether this building is a global wonder |
| isNationalWonder | Boolean | false | Whether this building is a national wonder |
| requiredBuilding | String | none | A building that has to be built before this building can be built. Must be in [Buildings.json](#buildingsjson) |
| requiredTech | String | none | The tech that should be researched before this building may be built. Must be in [Techs.json](#techsjson) |
| requiredResource | String | none | The resource that is consumed when building this building. Must be in [TileResources.json](3-Map-related-JSON-files.md#tileresourcesjson) |
| requiredNearbyImprovedResources | List of Strings | empty | The building can only be built if any of the resources in this list are within the borders of this city and have been improved. Each resource must be in [TileResources.json](3-Map-related-JSON-files.md#tileresourcesjson) |
| replaces | String | none | The name of a building that should be replaced by this building. Must be in [Buildings.json](#buildingsjson) |
| uniqueTo | String | none | If supplied, only the nation with this name can build this building. Must be in [Nations.json](#nationsjson) |
| cityStrength | Integer | 0 | Strength bonus the city in which this building is built receives |
| cityHealth | Integer | 0 | Health bonus the city in which this building is built receives |
| hurryCostModifier | Integer | 0 | When this building is bought using gold or faith, the price is increased by this much percent |
| quote | String | none | If this building is a (national) wonder, this string will be shown on the completion popup |
| uniques | List of Strings | empty | List of [unique abilities](../uniques) this building has |
| replacementTextForUniques | String | none | If provided, this string will be shown instead of all of the uniques |
| percentStatBonus | Object | none | Percentual bonus for stats provided by the building. Same format as [specialized stats](3-Map-related-JSON-files.md#specialized-stats) (numbers are in percent. i.e. `[30]` represents 30% __bonus__ to a stat) |
| greatPersonPoints | Object | none | Great person points by this building generated per turn. Valid keys are the names of units (Great Scientist, Warrior, etc.), valid values are Integers |
| specialistSlots | Object | none | Specialist slots provided by this building. Valid keys are the names of specialists (as defined in [Specialists.json](3-Map-related-JSON-files.md#specialistsjson)), valid values are Integers, the amount of slots provided for this specialist |
| civilopediaText | List | empty | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
## Nations.json
@ -63,147 +54,222 @@ Each building can have the following attributes:
This file contains all the nations and city states, including Barbarians and Spectator.
| Attribute | Type | Optional | Notes |
|----------------------|------------|------------------|------------------------------------------------------------------------------------------------------------------|
| name | String | Required | |
| leaderName | String | Default empty | Omit only for city states! If you want LeaderPortraits, the image file names must match exactly, including case. |
| style | String | Default empty | Modifier appended to pixel unit image names |
| adjective | String | Default empty | Currently unused |
| cityStateType | Enum | Default absent | Distinguishes Major Civilizations from City States (Cultured, Maritime, Mercantile, Militaristic) |
| startBias | List | Default empty | Zero or more of: terrainFilter or "Avoid [terrainFilter]". [^S] |
| preferredVictoryType | Enum | Default Neutral | Neutral, Cultural, Diplomatic, Domination or Scientific |
| startIntroPart1 | String | Default empty | Introductory blurb shown to Player on game start... |
| startIntroPart2 | String | Default empty | ... second paragraph. ***NO*** "TBD"!!! Leave empty to skip that alert. |
| declaringWar | String | Default empty | another greeting, voice hook supported [^V] |
| attacked | String | Default empty | another greeting, voice hook supported [^V] |
| defeated | String | Default empty | another greeting, voice hook supported [^V] |
| introduction | String | Default empty | another greeting, voice hook supported [^V] |
| neutralHello | String | Default empty | another greeting, voice hook supported [^V] |
| hateHello | String | Default empty | another greeting, voice hook supported [^V] |
| tradeRequest | String | Default empty | another greeting, voice hook supported [^V] |
| innerColor | 3x Integer | Default black | R, G, B for outer ring of nation icon |
| outerColor | 3x Integer | Required | R, G, B for inner circle of nation icon |
| uniqueName | String | Default empty | Decorative name for the special characteristic of this Nation |
| uniqueText | String | Default empty | Replacement text for "uniques". If empty, uniques are listed individually. |
| uniques | List | Default empty | Properties of the civilization - see [here](../Unique-parameters.md#general-uniques) |
| cities | List | Default empty | City names used sequentially for newly founded cities. |
| civilopediaText | List | Default empty | see [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
Each nation has the following structure:
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| leaderName | String | none | Omit only for city states! If you want LeaderPortraits, the image file names must match exactly, including case |
| style | String | none | Modifier appended to pixel unit image names |
| cityStateType | String | none | Distinguishes major civilizations from city states (must be in [CityStateTypes.json](#citystatetypesjson)) |
| startBias | List of strings | empty | Zero or more of: [terrainFilter](../Unique-parameters.md/#terrainfilter) or "Avoid [terrainFilter]". [^S] |
| preferredVictoryType | String | Neutral | The victory type major civilizations will pursue (need not be specified in [VictoryTypes.json](5-Miscellaneous-JSON-files.md#victorytypesjson)) |
| favoredReligion | String | none | The religion major civilization will choose if available when founding a religion. Must be in [Religions.json](#religionsjson) |
| startIntroPart1 | String | none | Introductory blurb shown to Player on game start... |
| startIntroPart2 | String | none | ... second paragraph. ___NO___ "TBD"!!! Leave empty to skip that alert. |
| declaringWar | String | none | Another greeting, voice hook supported [^V] |
| attacked | String | none | Another greeting, voice hook supported [^V] |
| defeated | String | none | Another greeting, voice hook supported [^V] |
| introduction | String | none | Another greeting, voice hook supported [^V] |
| neutralHello | String | none | Another greeting, voice hook supported [^V] |
| hateHello | String | none | Another greeting, voice hook supported [^V] |
| tradeRequest | String | none | Another greeting, voice hook supported [^V] |
| innerColor | [List of 3× Integer](5-Miscellaneous-JSON-files.md#rgb-colors-list) | black | RGB color for outer ring of nation icon |
| outerColor | [List of 3× Integer](5-Miscellaneous-JSON-files.md#rgb-colors-list) | Required | RGB color for inner circle of nation icon |
| uniqueName | String | none | Decorative name for the special characteristic of this nation |
| uniqueText | String | none | Replacement text for "uniques". If empty, uniques are listed individually |
| uniques | List | empty | List of [unique abilities](../uniques) this civilisation has |
| cities | List | empty | City names used sequentially for newly founded cities. Required for major civilizations and city states |
| civilopediaText | List | empty | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
<!-- | adjective | String | none | Currently unused | -->
[^S]: A "Coast" preference (_unless_ combined with "Avoid") is translated to a complex test for coastal land tiles, tiles next to Lakes, river tiles or near-river tiles, and such civs are processed first. Other startBias entries are ignored in that case.
Other positive (no "Avoid") startBias are processed next. Multiple positive preferences are treated equally, but get no "fallback".
Single positive startBias can get a "fallback" region if there is no (or no more) region with that primary type: any leftover region with as much of the specified terrain as possible will do.
Multiple "Avoid" entries are treated equally (and reduce chance for success - if no region is left avoiding _all_ specified types that civ gets a random one).
When combining preferred terrain with "Avoid", the latter takes precedence, and preferred terrain only has minor weight when choosing between regions that are not of a type to avoid.
These notes are **only** valid when playing on generated maps, loaded maps from map editor get no "regions" and startBias is processed differently (but you can expect single-entry startBias to work best).
These notes are __only__ valid when playing on generated maps, loaded maps from map editor get no "regions" and startBias is processed differently (but you can expect single-entry startBias to work best).
[^V]: See [Supply Leader Voices](../Images-and-Audio.md#supply-leader-voices)
## CityStateTypes.json
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/CityStateTypes.json)
This optional file is used for defining new types of city states. These types determine the benefits major civilizations gets when they befriend or ally the city state with influence. If the file is ommitted, the following are automatically added:
Cultured, Maritime, Mercantile, Militaristic, Religious.
Each city state type has the following structure:
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| friendBonusUniques | List of Strings | empty | List of [unique abilities](../uniques) granted to major civilizations when friends with this city state |
| allyBonusUniques | List of Strings | empty | List of [unique abilities](../uniques) granted to major civilizations when allied to city state |
| color | [List of 3× Integer](5-Miscellaneous-JSON-files.md#rgb-colors-list) | [255, 255, 255] | RGB color of text in civilopedia |
## Policies.json
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/Policies.json)
This file lists the available social policies that can be "bought" with culture.
This file contains all the available social policies that can be "bought" with culture.
They are organized in 'branches', each branch has an 'opener', one or more 'member' policies, and a 'finisher'. Therefore this file is organized using two levels - branch and member policy. The properties of the 'opener' are defined with the branch level, while the 'finisher' has an entry on the member level which _must_ be named as branch name + " Complete", case sensitive.
They are organized in 'branches', each branch has an 'opener', one or more 'member' policies, and a 'finisher'. Therefore this file is organized using two levels - branch and member policy.
Each policy branch can have the following properties:
The properties of the 'opener' are defined with the branch level, while the 'finisher' is an entry on the member level which _must_ be named as `branch name + " Complete"`, case sensitive. For example, the finisher of a policy branch "Tradition" will have the name "Tradition Complete".
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | Required | |
### Branch structure
Each policy branch has the following structure:
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| era | String | Required | Unlocking era as defined in [Eras.json](5-Miscellaneous-JSON-files.md#Eras.json) |
| priorities | Object | Default empty | Priorities for each victory type, [see here](#branch-priorities)
| uniques | List | Default empty | List of effects, [see here](../Unique-parameters.md#general-uniques) |
| policies | List | Default empty | List of member policies |
| priorities | Object | none | Priorities for each victory type, [see here](#branch-priorities)
| uniques | List | empty | List of [unique abilities](../uniques) this policy branch grants upon adopting it |
| policies | List | empty | List of [member policies](#member-policy-structure) and [branch 'finisher'](#branch-finisher-structure) - pay attention to the nesting of {} and [] |
Each member policy can have the following properties:
#### Member policy structure
| Attribute | Type | Optional? | Notes |
|-----------|------|-----------|-------|
| name | String | Required | |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| row | Integer | Required | Placement in UI, each unit approximately half the icon size |
| column | Integer | Required | Placement in UI, each unit approximately half the icon size |
| requires | List | Default empty | List of prerequisite policy names |
| uniques | List | Default empty | List of effects, [see here](../Unique-parameters.md#general-uniques) |
| requires | List | empty | List of prerequisite policy names |
| uniques | List | empty | List of [unique abilities](../uniques) this policy member grants upon adopting it |
#### Branch priorities
#### Branch finisher structure
The "priorities" object lists its branch's priorities for each victory type. The AI refers to this when deciding which branch to prioritize, also taking its preferred victory type into consideration. If two or more candidate branches have the same priority, the AI chooses a random branch among the candidates. All values are set to 0 if the object itself is missing or empty.
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| uniques | List | empty | List of [unique abilities](../uniques) this finisher grants upon adopting all the policy members in the branch |
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| Neutral | Int | Default 0 | Priority value when the AI's preferred victory type is Neutral |
| Cultural | Int | Default 0 | Priority value when the AI's preferred victory type is Cultural |
| Diplomatic | Int | Default 0 | Priority value when the AI's preferred victory type is Diplomatic |
| Domination | Int | Default 0 | Priority value when the AI's preferred victory type is Domination|
| Scientific | Int | Default 0 | Priority value when the AI's preferred victory type is Scientific |
### Branch priorities
The "priorities" object defines the priority major civilizations' AI give to a policy branch. The AI chooses the policy branch with the highest number for their preferred victory type. If two or more candidate branches have the same priority, the AI chooses a random branch among the candidates.
The object maps victory types to priority values for the major civilization using strings and integers. If the preferred victory type is not specified, the default priority value is set to 0.
The code below is an example of a valid "priorities" definition.
```json
"priorities": {
"Neutral": 0,
"Cultural": 10,
"Diplomatic": 0,
"Domination": 0,
"Scientific": 10
}
```
## Quests.json
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/Quests.json)
This file contains the Quests that may be given to major Civilizations by City States.
This file contains the quests that may be given to major civilizations by city states.
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | Required | Unique identifier name of the quest, it is also shown |
| description | String | Required | Description of the quest shown to players |
| type | Enum | Default Individual | Individual or Global |
| influence | Float | Default 40 | Influence reward gained on quest completion |
| duration | Integer | Default 0 | Maximum number of turns to complete the quest, 0 if there's no turn limit |
| minimumCivs | Integer | Default 1 | Minimum number of Civs needed to start the quest. It is meaningful only for type = Global |
Each quest has the following structure:
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | Defines criteria of quest, [see below](#quest-name) |
| description | String | Required | Description of the quest shown to players. Can add extra information based on `name`, [see below](#quest-name) |
| type | Enum | Individual | Individual or Global |
| influence | Float | 40 | Influence reward gained on quest completion |
| duration | Integer | 0 | Maximum number of turns to complete the quest. If 0, there is no turn limit |
| minimumCivs | Integer | 1 | Minimum number of Civs needed to start the quest. It is meaningful only for type = Global |
| weightForCityStateType | Object | none | Relative weight multiplier to this quest for each [city state type](#citystatetypesjson) or city state personality (Friendly, Neutral, Hostile, Irrational), [see below](#quest-weight) |
### Quest name
The name of the quest defines the criteria for the quest. If they are not defined in the predefined enum, they will have no behavior. In the description, square brackets `[]` in the description of the quest is replaced with extra information (except for `Invest`). The list of predefined quest names are as follows:
| Name | Criteria | Additional info |
| ---- | -------- | --------------- |
| Route | Connect the city state to the major civilization's capital using roads or railways | |
| Clear Barbarian Camp | Destroy the target barbarian camp | |
| Construct Wonder | Construct the target wonder | target `wonder` |
| Connect Resource | Connect the target resource to the major civilization's trade network | target `tileResource` |
| Acquire Great Person | Acquire the target great person | target `greatPerson` |
| Conquer City State | Defeat the target city state | target `cityState` |
| Find Player | Meet the target major civilization | target `civName` |
| Find Natural Wonder | Find the target natural wonder | target `naturalWonder` |
| Give Gold | Donate gold to the city state (amount does not matter) | `civName` "bully" for city state |
| Pledge to Protect | Pledge to protect city state | `civName` "bully" for city state |
| Contest Culture | Be the major civilization with the highest increase to culture during the duration | major civilization's `cultureGrowth` |
| Contest Faith | Be the major civilization with the highest increase to faith during the duration | major civilization's `faithGrowth` |
| Contest Technology | Be the major civilization with the most technologies researched during the duration | major civilization's `techsResearched` |
| Invest | Donating gold yield extra Influence based on value provided | __IMPORTANT__: value in square brackets is the extra influence in percent. i.e. \[50\] means 50% |
| Bully City State | Demand tribute from the target city state | target `city state` |
| Denounce Civilization | Denounce the major civilization which "bullied" the city state | `civName` "bully" for city state |
| Spread Religion | Spread major civilization's religion to the city state | major civilization's `religionName` |
### Quest weight
The "weightForCityStateType" object determines the quest's weight multiplier. When a city state initiates a quest, the initial weight is 1, and it is multiplied by values based on [city state type](#citystatetypesjson) and personality (Friendly, Neutral, Hostile, Irrational). The AI then randomly selects a quest based on the final weighted values.
The object maps city state type and personality to the weight multipliers for the city state using strings to floats. If the preferred victory type is not found, the default multiplier is 1.
The code below is an example of a valid "weightForCityStateType" definition. In this case, a friendly militaristic city state will be 0.4 (0.2 × 2) times as likely to pick this quest than a quest with weight 1.
```json
"weightForCityStateType": {
"Hostile": 2,
"Friendly": 0.2,
"Militaristic": 2
}
```
## Religions.json
[Link to original](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Religions.json)
This is just a list of Strings specifying all predefined Religion names. Corresponding icons must exist, that's all to it. After all, they're just containers for [Beliefs](#beliefsjson).
This is just a list of Strings specifying all predefined religion names. Corresponding icons must exist, that's all to it. After all, they're just containers for [beliefs](#beliefsjson).
## Specialists.json
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/Specialists.json)
This file should contain a list of all possible specialists that you want in your mod.
This file should contain a list of all possible specialists that citizens can be assigned to.
Each specialist can have the following attributes:
Each specialist has the following structure:
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | required | Name of the specialist |
| food | Integer | defaults to 0 | Amount of food produced by this specialist |
| production | Integer | defaults to 0 | Amount of production produced by this specialist |
| gold | Integer | defaults to 0 | etc. |
| culture | Integer | defaults to 0 | |
| science | Integer | defaults to 0 |
| faith | Integer | defaults to 0 |
| color | List of 3 Integers | required | Color of the image for this specialist |
| greatPersonPoints | Object | defaults to none | Great person points generated by this specialist. Valid keys are the names of the great person(Great Scientist, Great Merachant, etc.), valid values are Integers (≥0) |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| [`<stats>`](3-Map-related-JSON-files.md#general-stat) | Float | 0 | Per-turn yield produced by the specialist |
| color | [List of 3× Integer](5-Miscellaneous-JSON-files.md#rgb-colors-list) | Required | Color of the image for this specialist |
| greatPersonPoints | Object | none | Great person points generated by this specialist per turn. Valid keys are the names of units (Great Scientist, Warrior, etc.), valid values are Integers |
## Techs.json
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/Techs.json)
This file contains all the technologies. It is organized into an outer list of 'columns' which in turn contain one or more tech each.
This file contains all the technologies that can be researched with science. It is organized into an outer list of 'columns', which in turn contains one or more tech each.
#### Column structure
### Column structure
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| columnNumber | Integer | Required | Horizontal placement in the Tech Tree. |
| era | String | Required | References [Eras.json](5-Miscellaneous-JSON-files.md#Eras.json). |
| techCost | Integer | Required | Default cost of the techs in this column. |
| buildingCost | Integer | Required | Default cost of buildings requiring this tech. |
| wonderCost | Integer | Required | Default cost of wonders requiring this tech. |
| techs | List | Required | List of techs as follows - pay attention to the nesting of {} and []. |
Each tech column has the following structure:
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| columnNumber | Integer | Required | Horizontal placement in the Tech Tree |
| era | String | Required | Determines era reached after researching any technologies in this column. Must be in [Eras.json](5-Miscellaneous-JSON-files.md#Eras.json) |
| techCost | Integer | 0 | Default cost of the techs in this column |
| buildingCost | Integer | Required | Default cost of buildings requiring this tech |
| wonderCost | Integer | Required | Default cost of wonders requiring this tech |
| techs | List | Required | List of [techs](#tech-structure) - pay attention to the nesting of {} and [] |
#### Tech structure
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | Required | The name of this Technology. |
| row | Integer | Defaults to 0 | Vertical placement in the Tech Tree, must be unique per column. |
| cost | Integer | Defaults to column techCost | The amount of science required to research this tech. |
| prerequisites | List | Default empty | A list of the names of techs that are prerequisites of this tech. Only direct prerequisites are necessary. |
| quote | String | Default empty | A nice story presented to the player when they research this tech. |
| uniques | List | Default empty | Properties granted by the tech - see [here](../uniques.md). |
| civilopediaText | List | Default empty | see [civilopediaText chapter](5-Miscellaneous-JSON-files.md#Civilopedia-text). |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| row | Integer | 0 | Vertical placement in the Tech Tree, must be unique per column |
| cost | Integer | [Column techCost](#column-structure) | The amount of science required to research this tech |
| prerequisites | List of Strings | empty | A list of the names of techs that are prerequisites of this tech. Only direct prerequisites are necessary |
| quote | String | none | A nice story presented to the player when they research this tech |
| uniques | List of Strings | empty | List of [unique abilities](../uniques) this technology grants |
| civilopediaText | List | empty | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#Civilopedia-text) |

View File

@ -2,101 +2,107 @@
## Terrains.json
This file lists the base terrains, terrain features and natural wonders that can appear on the map.
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Vanilla/Terrains.json)
Each terrain entry can have the following properties:
This file contains the base terrains, terrain features and natural wonders that can appear on the map.
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | Required | |
Each terrain entry has the following structure:
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| type | Enum | Required | Land, Water, TerrainFeature, NaturalWonder |
| occursOn | List | Default none | Only for terrain features and Natural Wonders: The baseTerrain it can be placed on |
| turnsInto | String | Default none | Only for Natural Wonders: After placing the Natural Wonder its base terrain is changed to this |
| weight | Integer | Default 10 | Only for Natural Wonders: _relative_ weight it will be picked by the map generator |
| `<stats>` | Float | Optional | Per-turn yield or bonus yield for the tile, see [Stats](#stats) |
| overrideStats | Boolean | Default false | If on, a feature's yields replace any yield from underlying terrain instead of adding to it |
| unbuildable | Boolean | Default false | If true, nothing can be built here - not even resource improvements |
| impassable | Boolean | Default false | no unit can enter unless it has a special unique |
| movementCost | Integer | Default 1 | base movement cost |
| defenceBonus | Float | Default 0 | combat bonus for units being attacked here |
| RGB | List Integer * 3 | Default 'Gold' | RGB color for 'Default' tileset display |
| uniques | List | Default empty | List of effects, [see here](../uniques.md#terrain-uniques) |
| civilopediaText | List | Default empty | see [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
| occursOn | List of Strings | none | Only for terrain features and Natural Wonders: The baseTerrain it can be placed on |
| turnsInto | String | none | Only for NaturalWonder: the base terrain is changed to this after placing the Natural Wonder |
| weight | Integer | 10 | Only for NaturalWonder: _relative_ weight of being picked by the map generator |
| [`<stats>`](#general-stat) | Float | 0 | Per-turn yield or bonus yield for the tile |
| overrideStats | Boolean | false | If true, a feature's yields replace any yield from underlying terrain instead of adding to it |
| unbuildable | Boolean | false | If true, nothing can be built here - not even resource improvements |
| impassable | Boolean | false | No unit can enter unless it has a special unique |
| movementCost | Integer | 1 | Base movement cost |
| defenceBonus | Float | 0 | Combat bonus for units being attacked here |
| RGB | [List of 3× Integer](5-Miscellaneous-JSON-files.md#rgb-colors-list) | Gold | RGB color for 'Default' tileset display |
| uniques | List of Strings | empty | List of [unique abilities](../uniques) this terrain has |
| civilopediaText | List | empty | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
## TileImprovements.json
This file lists the improvements that can be constructed or created on a map tile by a unit (any unit having the appropriate unique).
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Vanilla/TileImprovements.json)
This file lists the improvements that can be constructed or created on a map tile by a unit having the appropriate unique.
Note that improvements have two visual representations - icon and pixel graphic in the tileset. Omitting the icon results in a horribly ugly user interface, while omitting tileset graphics will just miss out on an _optional_ visualization. If you provide a pixel graphic for FantasyHex, please be aware of the layering system and the ruleVariants in the tileset json. A single graphic may suffice if it has lots of transparency, as it will be drawn on top of all other terrain elements.
Each improvement can have the following properties:
Each improvement has the following structure:
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | Required | |
| terrainsCanBeFoundOn | List | Default empty | [Terrains](#terrainsjson) that allow this resource |
| techRequired | String | Default none | The name of the technology required to build this improvement |
| uniqueTo | String | Default none | The name of the nation this improvement is unique for |
| `<stats>` | Float | Optional | Per-turn bonus yield for the tile, see [Stats](#stats) |
| turnsToBuild | Integer | | Number of turns a worker spends building this (ignored for 'create' actions) |
| uniques | List | Default empty | List of effects, [see here](../Unique-parameters.md#improvement-uniques) |
| shortcutKey | String | Default none | Keyboard binding. At the moment a single character (no function keys or Ctrl combinations) |
| civilopediaText | List | Default empty | see [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | [^A] |
| terrainsCanBeBuiltOn | List of Strings | empty | Terrains that this improvement can be built on [^B]. Removable terrain features will need to be removed before building an improvement [^C]. Must be in [Terrains.json](#terrainsjson) |
| techRequired | String | none | The name of the technology required to build this improvement |
| uniqueTo | String | none | The name of the nation this improvement is unique for |
| [`<stats>`](#stats) | Integer | 0 | Per-turn bonus yield for the tile |
| turnsToBuild | Integer | -1 | Number of turns a worker spends building this. If -1, the improvement is unbuildable [^D]. If 0, the improvement is always built in one turn |
| uniques | List of Strings | empty | List of [unique abilities](../uniques) this improvement has |
| shortcutKey | String | none | Keyboard binding. Currently, only a single character is allowed (no function keys or Ctrl combinations) |
| civilopediaText | List | empty | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
- Tiles with no terrains, but positive turns to build, can be built only when the tile has a resource that names this improvement or special uniques are used. (TODO: missing something?)
- Tiles with no terrains, and no turns to build, are like great improvements - they're placeable. That means a unit could exist with a 'Can create [this]' unique, and that the improvement will not show in a worker's improvement picker dialog.
- Removable Terrain features will need to be removed before building an improvement - unless the feature is named in terrainsCanBeFoundOn _or_ the unique "Does not need removal of [terrainFeature]" is used (e.g. Camp allowed by resource).
- Special improvements: Road, Railroad, Remove \*, Cancel improvement order, City ruins, City center, Barbarian encampment - these have special meanings hardcoded to their names.
[^A]: Special improvements: Road, Railroad, Remove \*, Cancel improvement order, City ruins, City center, Barbarian encampment - these have special meanings hardcoded to their names.
[^B]: Improvements with an empty `terrainsCanBeBuiltOn` list and positive `turnsToBuild` value can only be built on [resources](#tileresourcesjson) with `improvedBy` or `improvement` that contains the corresponding improvement.
[^C]: The removal of terrain features is optional if the feature is named in `terrainsCanBeBuiltOn` _or_ the unique `Does not need removal of [tileFilter]` is used (e.g. Camp allowed by resource).
[^D]: They can still be created with the UnitAction unique `Can instantly construct a [improvementFilter] improvement`.
## TileResources.json
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Vanilla/TileResources.json)
This file lists the resources that a map tile can have.
Note the predefined resource _types_ cannot be altered in json.
Note the predefined `resourceType` enum cannot be altered in a json.
Note also that resources have two visual representations - icon and pixel graphic in the tileset. Omitting the icon results in a horribly ugly user interface, while omitting tileset graphics will miss out on a visualization on the map. If you provide a pixel graphic for FantasyHex, please be aware of the layering system and the ruleVariants in the tileset json. A single graphic may suffice if it has lots of transparency, as it will be drawn on top of terrain and features but below an improvement - if the single improvement graphic exists at all.
Each resource can have the following properties:
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | Required | |
| resourceType | Enum | Default Bonus | Bonus, Luxury or Strategic |
| terrainsCanBeFoundOn | List | Default empty | [Terrains](#terrainsjson) that allow this resource |
| `<stats>` | Float | Optional | Per-turn bonus yield for the tile, see [Stats](#stats), can be repeated |
| improvement | String | Default empty | The improvement ([TileImprovements.json](#tileimprovementsjson)) for this resource |
| improvementStats | Object | Default empty | The additional yield when improved as sub-object with one or more [Stats](#stats) |
| revealedBy | String | Default empty | The technology name required to see, work and improve this resource |
| unique | String | Default empty | Effects, [see here](../Unique-parameters.md#resource-uniques) - at the moment only one unique may be added |
| civilopediaText | List | Default empty | see [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
Each resource has the following structure:
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| resourceType | Enum | Bonus | Bonus, Luxury or Strategic |
| terrainsCanBeFoundOn | List of Strings | empty | Terrains that this resource can be found on. Must be in [Terrains.json](#terrainsjson) |
| [`<stats>`](#stats) | Integer | 0 | Per-turn bonus yield for the tile |
| improvementStats | Object | none | The additional yield when improved, see [specialized stats](3-Map-related-JSON-files.md#specialized-stats)|
| revealedBy | String | none | The technology name required to see, work and improve this resource |
| improvedBy | List of strings | empty | The improvements required for obtaining this resource. Must be in [TileImprovements.json](#tileimprovementsjson) |
| improvement | String | none | The improvement required to obtain this resource. Must be in [TileImprovements.json](#tileimprovementsjson) (redundant due to `improvedBy`) |
| unique | List of Strings | empty | List of [unique abilities](../uniques) this resource has |
| civilopediaText | List | empty | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
## Ruins.json
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Vanilla/Ruins.json)
This file contains the possible rewards ancient ruins give. It is not required, if omitted, the default file for the game is used, even in baseRuleSet mods.
This optional file contains the possible rewards ancient ruins give. If omitted, the default file for the game is used, even in baseRuleSet mods.
Each of the objects in the file represents a single reward you can get from ruins. It has the following properties:
Each of the objects in the file represents a single reward you can get from ruins. It has the following structure:
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | required | Name of the ruins. Never shown to the user, but they have to be distinct |
| notification | String | required | Notification added to the user when this reward is chosen. If omitted, an empty notification is shown. Some notifications may have parameters, refer to the table below. |
| weight | Integer (≥0) | defaults to 1 | Weight this reward should have. Higher weights result in a higher chance of it being chosen* |
| uniques | List of Strings | defaults to none | [uniques](../Uniques#one-time-effect) or [uniques](../Unique-parameters.md#one-time-effect-units) that will trigger when entering the ruins. If more than 1 unique is added, the notification will be shown multiple times due to a bug. |
| excludedDifficulties | List of Strings | defaults to None | A list of all difficulties on which this reward may _not_ be awarded |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | Name of the ruins. Never shown to the user, but they have to be distinct |
| notification | String | Required | Notification added to the user when this reward is chosen. If omitted, an empty notification is shown. Some notifications may have parameters, refer to the table below. |
| weight | Integer (≥0) | 1 | _Relative_ weight this reward is chosen next [^E] |
| uniques | List of Strings | empty | List of [unique abilities](../uniques) that will trigger when entering the ruins. If more than 1 unique is added, the notification will be shown multiple times due to a bug (may be outdated) |
| excludedDifficulties | List of Strings | empty | A list of all difficulties on which this reward may _not_ be awarded |
The exact algorithm for choosing a reward is the following:
[^E]: The exact algorithm for choosing a reward is the following:
- Create a list of all possible rewards, with rewards with a higher weight appearing multiple times. A reward with weight one will appear once, a reward with weight two will appear twice, etc.
- Shuffle this list
- Try give rewards starting from the top of the list. If any of the uniques of the rewards is valid in this context, reward it and stop trying more rewards.
- Create a list of all possible rewards. Each reward's frequency in the list corresponds to its weight, a reward with weight one will appear once, a reward with weight two will appear twice, etc.
- Shuffle this list
- Try give rewards starting from the top of the list. If any of the uniques of the rewards is valid in this context, reward it and stop trying more rewards.
### Notifications
Some of the rewards ruins can give will have results that are not deterministic when writing it in the JSON, so creating a good notification for it would be impossible. An example for this would be the "Gain [50]-[100] [Gold]" unique, which will give a random amount of gold. For this reason, we allow some notifications to have parameters, in which values will be filled, such as "You found [goldAmount] gold in the ruins!". All the uniques which have this property can be found below.
<!-- (need to update) -->
| Unique | Parameters |
| ------ | ---------- |
@ -111,58 +117,72 @@ Some of the rewards ruins can give will have results that are not deterministic
A few uniques can be added to ancient ruin effects to modify when they can be earned. These are:
- "Only available after [amount] turns"
- "Hidden when religion is disabled"
- "Hidden after a great prophet has been earned"
- "Only available after [amount] turns"
- "Hidden when religion is disabled"
- "Hidden after a great prophet has been earned"
## Tileset-specific json
## [Tileset-specific json](../Creating-a-custom-tileset.md)
[Link to original FantasyHex](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/TileSets/FantasyHex.json)
A mod can define new Tilesets or add to existing ones, namely FantasyHex. There is one json file per Tileset, named same as the Tileset, and placed in a subfolder named "TileSets" relative to the other json files. This is called TileSetConfig and has the following structure:
| Attribute | Type | Default value | Notes |
| --------- | ---- | -------- | ----- |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| [useColorAsBaseTerrain](../Creating-a-custom-tileset.md#useColorAsBaseTerrain) | Boolean | false | |
| [useSummaryImages](../Creating-a-custom-tileset.md#useSummaryImages) | Boolean | false | |
| [unexploredTileColor](../Creating-a-custom-tileset.md#unexploredTileColor) | Color | Dark Gray | `{"r":0.25,"g":0.25,"b":0.25,"a":1}` |
| [fogOfWarColor](../Creating-a-custom-tileset.md#fogOfWarColor) | Color | Black | `{"r":0,"g":0,"b":0,"a":1}` |
| [fallbackTileSet](../Creating-a-custom-tileset.md#fallbackTileSet) | String | "FantasyHex" | null to disable |
| [tileScale](../Creating-a-custom-tileset.md#tileScale) | Float | 1.0 | |
| [tileScales](../Creating-a-custom-tileset.md#tileScales) | Dictionary | empty | |
| [ruleVariants](../Creating-a-custom-tileset.md#ruleVariants) | Dictionary | empty | see below |
| [tileScale](../Creating-a-custom-tileset.md#tileScale) | Float | 1.0 | The scale of all tiles. Can be used to increase or decrease the size of every tile |
| [tileScales](../Creating-a-custom-tileset.md#tileScales) | Object | empty | Used by the "Minimal" tileset to scale all its tiles except the base terrain down. Overrides `tileScale` value for specified terrain |
| [ruleVariants](../Creating-a-custom-tileset.md#ruleVariants) | Object | empty | [See here](#layering-images) |
### Layering images
ruleVariants control substitutions when layering images for a tile, they are list looking like:
```json
"ruleVariants": {
"Grassland+Forest": ["Grassland", "GrasslandForest"],
"Plains+Forest": ["Plains", "PlainsForest"],
"Plains+Jungle": ["Plains", "PlainsJungle"],
// . . .
}
"ruleVariants": {
"Grassland+Forest": ["Grassland", "GrasslandForest"],
"Plains+Forest": ["Plains", "PlainsForest"],
"Plains+Jungle": ["Plains", "PlainsJungle"],
// . . .
}
```
Each line means "if the tile content is this... then combine the following png images". The key part follows a specific order and must match in its entirety, meaning "Plains+Forest" is not valid for "Plains+Forest+Deer", and when it matches no other image layering is done except roads and units (I think - *WIP*).
Each line means "if the tile content is this... then combine the following png images". The key part follows a specific order and must match in its entirety, meaning "Plains+Forest" is not valid for "Plains+Forest+Deer", and when it matches no other image layering is done except roads and units (I think - _WIP_).
When TileSetConfig's for the same Tileset are combined, for the first three properties the last mod wins, while ruleVariants are merged, meaning only an entry with the same key overwrites an earlier entry.
When TileSetConfig's for the same Tileset are combined, for the first three properties the last mod wins, while ruleVariants are merged, meaning only an entry with the same key overwrites an earlier entry. (TODO)
## Stats
Terrains, features, resources and improvements may list yield statistics. They can be one of the following:
Terrains, features, resources and improvements may list yield statistics. The statistics can be one of the following:
- production
- food
- gold
- science
- culture
- happiness
- faith
- production
- food
- gold
- science
- culture
- happiness
- faith
If an object carries general stats, any combination (or none) of these can be specified. For specialized stats, they might come as sub-object in a named field. Example:
### General stat
If an object carries general stat(s), it contains any combination (or none) of the above stats, each mapping to a corresponding number [^1]. For Example:
```json
"gold": 2,
"improvement": "Quarry",
"improvementStats": { "gold": 1, "production": 1 },
"gold": 2,
"improvement": "Quarry",
```
The values are usually integers, though the underlying code supports floating point. The effects are, however, insufficiently tested and therefore -so far- using fractional stats is unsupported. Go ahead and thoroughly test that in a mod and help out with feedback 😁.
### Specialized stats
For specialized stats, they might come as sub-object in a named field. The sub-object contains any combination (or none) of the above stats, each mapping to a corresponding number [^1]. For Example:
```json
"improvement": "Quarry",
"improvementStats": { "gold": 1, "production": 1 },
```
[^1]: The values are usually integers, though the underlying code supports floating point. The effects are, however, insufficiently tested and therefore -so far- using fractional stats is unsupported. Go ahead and thoroughly test that in a mod and help out with feedback 😁.

View File

@ -6,31 +6,31 @@
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 | Notes |
| --------- | ---- | -------- | ----- |
| name | String | required | The name of the units (required) |
| unitType | String | required | The type of the unit. Must be in [UnitTypes.json](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/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](2-Civilization-related-JSON-files.md#techsjson) |
| obsoleteTech | String | defaults to none | After researching this tech, the unit can no longer be build. Must be in [Techs.json](2-Civilization-related-JSON-files.md#techsjson) |
| requiredResource | String | defaults to none | Resource that is consumed by building this unit. Must be in [TileResources.json](3-Map-related-JSON-files.md#tileresourcesjson) |
| upgradesTo | String | defaults to none | Unit that this unit can upgrade to when it is available. Must be in [Units.json](#unitsjson) |
| replaces | String | defaults to none | If this unit is unique to a nation, this is the unit it replaces. Must be in [Units.json](#unitsjson) |
| uniqueTo | String | defaults to none | The nation that this unit is unique to. Must be in [Nations.json](2-Civilization-related-JSON-files.md#nationsjson) |
| 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](#unitpromotionsjson) |
| 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](../Unique-parameters.md#unit-uniques) |
| 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](#../Modders/Images-and-Audio.md#sounds)
| civilopediaText | List | Default empty | see [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
Each unit has the following structure:
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| unitType | String | Required | The type of the unit. Must be in [UnitTypes.json](#unittypesjson) |
| cost | Integer | -1 | The amount of production required to build this unit. The production needed is always positive |
| movement | Integer | 0 | The amount of movement points the unit has by |
| strength | Integer | 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 | The ranged attack strength of the unit. If omitted, the unit cannot ranged attack. If used, strength must be set too. |
| religiousStrength | Integer | 0 | The religious attack and defensive strength of the unit |
| range | Integer | 2 | The range from which ranged attacks can be preformed |
| interceptRange | Integer | 0 | Air units attacking within in this range will be intercepted |
| requiredTech | String | none | The tech required to build this unit. Must be in [Techs.json](2-Civilization-related-JSON-files.md#techsjson) |
| obsoleteTech | String | none | After researching this tech, the unit can no longer be build. Must be in [Techs.json](2-Civilization-related-JSON-files.md#techsjson) |
| requiredResource | String | none | Resource that is consumed by building this unit. Must be in [TileResources.json](3-Map-related-JSON-files.md#tileresourcesjson) |
| upgradesTo | String | none | Unit that this unit can upgrade to when it is available. Must be in [Units.json](#unitsjson) |
| replaces | String | none | If this unit is unique to a nation, this is the unit it replaces. Must be in [Units.json](#unitsjson) |
| uniqueTo | String | none | The nation that this unit is unique to. Must be in [Nations.json](2-Civilization-related-JSON-files.md#nationsjson) |
| hurryCostModifier | Integer | 0 | If this unit is bought for gold, its price is increased by so much percent |
| promotions | List of Strings | empty | A list of all the promotions the unit automatically receives upon being built. Each promotion must be in [UnitPromotions.json](#unitpromotionsjson) |
| uniques | List of Strings | empty | List of [unique abilities](../uniques) this unit has |
| replacementTextForUniques | String | none | If provided, this will be displayed instead of the list of uniques. Can be used for better formatting. |
| attackSound | String | none | The sound that is to be played when this unit attacks. For possible values, see [Sounds](../Images-and-Audio.md#sounds)
| civilopediaText | List | empty | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
## UnitPromotions.json
@ -42,28 +42,29 @@ Each promotion must have an icon, except progressions ending in " I", " II", " I
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:
Each promotion has the following structure:
| 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 and ignored, use uniques instead |
| column | Int | Yes | Determines placement order on the promotion picker screen. Name is historical, these coordinates no longer control placement directly. Promotions without coordinates are ensured to be placed last. (…) |
| row | Int | Yes | … In base mods without any coordinates, promotions without prerequisites are sorted alphabetically and placed top down, the rest of the screen will structure the dependencies logically. If your mod has a "Heal instantly", it is suggested to use row=0 to place it on top. |
| unitTypes | List | Default empty | The unit types for which this promotion applies as specified in [UnitTypes.json](#unittypesjson) |
| uniques | List | Default empty | List of effects, [see here](../uniques.md#unit-uniques) |
| civilopediaText | List | Default empty | see [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | See above for "I, II, III" progressions |
| prerequisites | List of Strings | empty | Prerequisite promotions |
| column | Integer | Optional | Determines placement order on the promotion picker screen. Name is historical, these coordinates no longer control placement directly. Promotions without coordinates are ensured to be placed last. (…) |
| row | Integer | Optional | … In base mods without any coordinates, promotions without prerequisites are sorted alphabetically and placed top down, the rest of the screen will structure the dependencies logically. If your mod has a "Heal instantly", it is suggested to use row=0 to place it on top |
| unitTypes | List of Strings | empty | The unit types for which this promotion applies as specified in [UnitTypes.json](#unittypesjson) |
| uniques | List of Strings | empty | List of [unique abilities](../uniques.md) this promotion grants to the units |
| civilopediaText | List | empty | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
## UnitTypes.json
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/UnitTypes.json)
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:
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 omitted, 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 | Notes |
| --------- | ---- | -------- | ----- |
| name | String | required | The name of the unit type |
| movementType | Enum | 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](../Unique-parameters.md#unit-uniques) |
Each unit type has the following structure:
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| movementType | Enum | Required | The domain through which the unit moves. Allowed values: "Water", "Land", "Air" |
| uniques | List of String | none | List of [unique abilities](../uniques.md) this promotion grants to units of this type |

View File

@ -6,33 +6,37 @@
This file defines the difficulty levels a player can choose when starting a new game.
Each difficulty level can have the following attributes:
Each difficulty level has the following structure:
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name | String | Required | Name of the difficulty level |
| baseHappiness | Integer | Default 0 |
| extraHappinessPerLuxury | Float | Default 0 |
| researchCostModifier | Float | Default 1 |
| unitCostModifier | Float | Default 1 |
| buildingCostModifier | Float | Default 1 |
| policyCostModifier | Float | Default 1 |
| unhappinessModifier | Float | Default 1 |
| barbarianBonus | Float | Default 0 |
| playerBonusStartingUnits | List of Units | Default empty | Can also be 'Era Starting Unit', maps to `startingMilitaryUnit` of the Eras file. All other units must be in [Units.json](4-Unit-related-JSON-files.md#Units.json)]. Applies only to human player civs |
| aiCityGrowthModifier | Float | Default 1 |
| aiUnitCostModifier | Float | Default 1 |
| aiBuildingCostModifier | Float | Default 1 |
| aiWonderCostModifier | Float | Default 1 |
| aiBuildingMaintenanceModifier | Float | Default 1 |
| aiUnitMaintenanceModifier | Float | Default 1 |
| aiFreeTechs | List of Techs | Default empty |
| aiMajorCivBonusStartingUnits | List of Units | Default empty | Same rules as playerBonusStartingUnits, See above. Applies only to AI major civs |
| aiCityStateBonusStartingUnits | List of Units | Default empty | Same rules as playerBonusStartingUnits, See above. Applies only to city-state civs |
| aiUnhappinessModifier | Float | Default 1 |
| aisExchangeTechs | Boolean | | Unimplemented |
| turnBarbariansCanEnterPlayerTiles | Integer | Default 0 |
| clearBarbarianCampReward | Integer | Default 25 |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| baseHappiness | Integer | 0 | |
| extraHappinessPerLuxury | Float | 0 | |
| researchCostModifier | Float | 1 | |
| unitCostModifier | Float | 1 | |
| unitSupplyBase | Integer | 5 | |
| unitSupplyPerCity | Integer | 2 | |
| buildingCostModifier | Float | 1 | |
| policyCostModifier | Float | 1 | |
| unhappinessModifier | Float | 1 | |
| barbarianBonus | Float | 0 | |
| barbarianSpawnDelay | Integer | 0 | |
| playerBonusStartingUnits | List of Strings | empty | Can also be 'Era Starting Unit', maps to `startingMilitaryUnit` of the Eras file. All other units must be in [Units.json](4-Unit-related-JSON-files.md#Units.json). Applies only to human player civs |
| aiCityGrowthModifier | Float | 1 | |
| aiUnitCostModifier | Float | 1 | |
| aiBuildingCostModifier | Float | 1 | |
| aiWonderCostModifier | Float | 1 | |
| aiBuildingMaintenanceModifier | Float | 1 | |
| aiUnitMaintenanceModifier | Float | 1 | |
| aiUnitSupplyModifier | Integer | 5 | |
| aiFreeTechs | List of Strings | empty | Must be in [Techs.json](2-Civilization-related-JSON-files.md#techsjson) |
| aiMajorCivBonusStartingUnits | List of Strings | empty | Same rules as playerBonusStartingUnits, See above. Applies only to AI major civs |
| aiCityStateBonusStartingUnits | List of Strings | empty | Same rules as playerBonusStartingUnits, See above. Applies only to city-state civs |
| aiUnhappinessModifier | Float | 1 | |
| turnBarbariansCanEnterPlayerTiles | Integer | 0 | |
| clearBarbarianCampReward | Integer | 25 | |
<!-- | aisExchangeTechs | Boolean | | Unimplemented | -->
## Eras.json
@ -42,23 +46,26 @@ This file should contain all the era's you want to use in your mod.
Each era can have the following attributes:
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name | String | required | Name of the era |
| researchAgreementCost | Integer (≥0) | defaults to 300 | Cost of research agreements when the most technologically advanced civ is in this era |
| iconRGB | List of 3 Integers | defaults to [255, 255, 255] | RGB color that icons for technologies of this era should have in the Tech screen |
| unitBaseBuyCost | Integer (≥0) | defaults to 200 | Base cost of buying units with Faith, Food, Science or Culture when no other cost is provided |
| startingSettlerCount | Integer (≥0) | defaults to 1 | Amount of settler units that should be spawned when starting a game in this era (setting this to zero is discouraged [^1]) |
| startingSettlerUnit | String | defaults to "Settler" | Name of the unit that should be used for the previous field. Must be in [Units.json](4-Unit-related-JSON-files.md#unitsjson), or a unit with the "Founds a new city" unique must exist |
| startingWorkerCount | Integer (≥0) | defaults to 0 | Amount of worker units that should be spawned when starting a game in this era |
| startingWorkerUnit | String | defaults to "Worker" | Name of the unit that should be used for the previous field. If startingWorkerCount>0, then it must exist in [Units.json](4-Unit-related-JSON-files.md#unitsjson), or a unit with the "Can build [filter] improvements on tiles" unique must exist |
| startingMilitaryUnitCount | Integer (≥0) | defaults to 1 | Amount of military units that should be spawned when starting a game in this era |
| startingMilitaryUnit | String | defaults to "Warrior" | Name of the unit that should be used for the previous field. Must be in [Units.json](4-Unit-related-JSON-files.md#unitsjson) |
| startingGold | Integer (≥0) | defaults to 0 | Amount of gold each civ should receive when starting a game in this era |
| startingCulture | Integer (0) | defaults to 0 | Amount of culture each civ should receive when starting a game in this era |
| settlerPopulation | Integer (>0) | defaults to 1 | Default amount of population each city should have when settled when starting a game in this era |
| settlerBuildings | List of Strings | defaults to none | Buildings that should automatically be built whenever a city is settled when starting a game in this era |
| startingObsoleteWonders | List of Strings | defaults to none | Wonders (and technically buildings) that should be impossible to built when starting a game in this era. Used in the base game to remove all wonders older than 2 era's |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | |
| researchAgreementCost | Integer (≥0) | 300 | Cost of research agreements when the most technologically advanced civ is in this era |
| iconRGB | [List of 3× Integer](#rgb-colors-list) | white | RGB color that icons for technologies of this era should have in the Tech screen |
| startingSettlerCount | Integer (≥0) | 1 | Amount of settler units that should be spawned when starting a game in this era (setting this to zero is discouraged [^1]) |
| startingSettlerUnit | String | "Settler" | Name of the unit that should be used for the previous field. Must be in [Units.json](4-Unit-related-JSON-files.md#unitsjson), or a unit with the "Founds a new city" unique must exist |
| startingWorkerCount | Integer (≥0) | 0 | Amount of worker units that should be spawned when starting a game in this era |
| startingWorkerUnit | String | "Worker" | Name of the unit that should be used for the previous field. If startingWorkerCount>0, then it must exist in [Units.json](4-Unit-related-JSON-files.md#unitsjson), or a unit with the "Can build [filter] improvements on tiles" unique must exist |
| startingMilitaryUnitCount | Integer (≥0) | 1 | Amount of military units that should be spawned when starting a game in this era |
| startingMilitaryUnit | String | "Warrior" | Name of the unit that should be used for the previous field. Must be in [Units.json](4-Unit-related-JSON-files.md#unitsjson) |
| startingGold | Integer (≥0) | 0 | Amount of gold each civ should receive when starting a game in this era |
| startingCulture | Integer (≥0) | 0 | Amount of culture each civ should receive when starting a game in this era |
| settlerPopulation | Integer (>0) | 1 | Amount of population each city should have when settled when starting a game in this era |
| settlerBuildings | List of Strings | empty | Buildings that should automatically be built whenever a city is settled when starting a game in this era |
| startingObsoleteWonders | List of Strings | empty | Wonders (and technically buildings) that should be impossible to built when starting a game in this era. Used in the base game to remove all wonders older than 2 era's |
| baseUnitBuyCost | Integer | 200 | Default value used for the unique `Can be purchased with [stat] [cityFilter]` |
| embarkDefense | Integer | 3 | Default defense for embarked unit in this era |
| startPercent | Integer | 0 | When starting, percentage (\[0\]%-\[100\]%) of turns skipped in total turns specified in [Speed.json](#speedsjson) |
| citySound | String | "cityClassical" | Sound used when city is founded in this era |
[^1]: Successfully setting startingSettlerCount to zero in a mod (idea: conquer or die) is not easy. Some player-controlled settings require at least one Settler, through any source (see difficulties for other possible settler sources), or you won't be able to start a game: Once City Challenge requires one for all players, and allowing any city-states requires one for those. Would also affect defeat rules.
@ -70,32 +77,41 @@ This file should contain all the speeds you want to use in your mod.
Each speed can have the following attributes:
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| name | String | required | Name of the speed |
| modifier | Float (≥0) | defaults to 1.0 | Overall game speed modifier |
| productionCostModifier | Float (≥0) | defaults to the value of `modifier` | Scales production cost of units and buildings |
| goldCostModifier | Float (≥0) | defaults to the value of `modifier` | Scales gold costs |
| scienceCostModifier | Float (≥0) | defaults to the value of `modifier` | Scales science costs |
| cultureCostModifier | Float (≥0) | defaults to the value of `modifier` | Scales culture costs |
| faithCostModifier | Float (≥0) | defaults to the value of `modifier` | Scales faith costs |
| improvementBuildLengthModifier | Float (≥0) | defaults to the value of `modifier` | Scales the time it takes for a worker to build tile improvements |
| barbarianModifier | Float (≥0) | defaults to the value of `modifier` | Scales the time between barbarian spawns |
| goldGiftModifier | Float (≥0) | defaults to the value of `modifier` | Scales the influence gained from gifting gold to city-states |
| cityStateTributeScalingInterval | Float (≥0) | defaults to 6.5 | The number of turns it takes for the amount of gold a player demands from city-states to increase by 5 gold |
| goldenAgeLengthModifier | Float (≥0) | defaults to the value of `modifier` | Scales the length of golden ages |
| religiousPressureAdjacentCity | Integer (≥0) | defaults to 6 | Defines how much religious pressure a city exerts on nearby cities |
| peaceDealDuration | Integer (≥0) | defaults to 10 | The number of turns a peace deal lasts |
| dealDuration | Integer (≥0) | defaults to 30 | The number of turns a non-peace deal (research agreement, open borders, etc.) lasts |
| startYear | Float | defaults to -4000 | The start year of the game (negative is BC/BCE) |
| turns | List of HashMaps | required | The amount of time passed between turns ("yearsPerTurn") and the range of turn numbers ("untilTurn") that this duration applies to |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | Name of the speed |
| modifier | Float (≥0) | 1.0 | Overall game speed modifier |
| productionCostModifier | Float (≥0) | `modifier` value | Scales production cost of units and buildings |
| goldCostModifier | Float (≥0) | `modifier` value | Scales gold costs |
| scienceCostModifier | Float (≥0) | `modifier` value | Scales science costs |
| cultureCostModifier | Float (≥0) | `modifier` value | Scales culture costs |
| faithCostModifier | Float (≥0) | `modifier` value | Scales faith costs |
| improvementBuildLengthModifier | Float (≥0) | `modifier` value | Scales the time it takes for a worker to build tile improvements |
| barbarianModifier | Float (≥0) | `modifier` value | Scales the time between barbarian spawns |
| goldGiftModifier | Float (≥0) | `modifier` value | Scales the influence gained from gifting gold to city-states |
| cityStateTributeScalingInterval | Float (≥0) | 6.5 | The number of turns it takes for the amount of gold a player demands from city-states to increase by 5 gold |
| goldenAgeLengthModifier | Float (≥0) | `modifier` value | Scales the length of golden ages |
| religiousPressureAdjacentCity | Integer (≥0) | 6 | Defines how much religious pressure a city exerts on nearby cities |
| peaceDealDuration | Integer (≥0) | 10 | The number of turns a peace deal lasts |
| dealDuration | Integer (≥0) | 30 | The number of turns a non-peace deal (research agreement, open borders, etc.) lasts |
| startYear | Float | -4000 | The start year of the game (negative is BC/BCE) |
| turns | List | Required | List of time interval per turn, [see below](#time-interval-per-turn) |
The below code is an example of a valid "turns" definition and it specifies that the first 50 turns of a game last for 60 years each, then the next 30 turns (and any played after the 80th) last for 40 years each.
### Time interval per turn
The "turns" attribute defines the number of years passed between turns. The attribute consists of a list of hashmaps, each hashmaps in turn having 2 required attributes: "yearsPerTurn" (Float) and "untilTurn" (Integer)
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| yearsPerTurn | Integer | Required | Number of years passed between turns |
| untilTurn | Integer | Required | Which turn that this "speed" is active until (if it is the last object, this is ignored) |
The code below is an example of a valid "turns" definition and it specifies that the first 50 turns of a game last for 60 years each, then the next 30 turns (and any played after the 80th) last for 40 years each.
```json
"turns": [
{"yearsPerTurn": 60, "untilTurn": 50},
{"yearsPerTurn": 40, "untilTurn": 80}
{"yearsPerTurn": 60, "untilTurn": 50},
{"yearsPerTurn": 40, "untilTurn": 80}
]
```
@ -105,28 +121,23 @@ The below code is an example of a valid "turns" definition and it specifies that
This file is a little different:
- Does not exist in Vanilla ruleset
- Is entirely optional but will be created after downloading a mod
- Does not exist in Vanilla ruleset
- Is entirely optional but will be created after downloading a mod
Note that this file controls _declarative mod compatibility_ (Work in progress) - e.g. there's [uniques](../uniques.md#modoptions-uniques) to say your Mod should only or never be used as 'Permanent audiovisual mod'.
Incompatibility filtering works so far between extension and base mods, but feel free to document known extension-to-extension incompatibilities using the same Unique now. Stay tuned!
The file can have the following attributes, including the values Unciv sets (no point in a mod author setting those):
The file can have the following attributes, not including the values Unciv sets (no point in a mod author setting those):
| Attribute | Type | Optional | Notes |
|---------------------|---------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| isBaseRuleset | Boolean | false | Differentiates mods that change the vanilla ruleset or replace it |
| maxXPfromBarbarians | Integer | 30 | *Deprecated*, see [constants](#ModConstants) |
| uniques | List | empty | Mod-wide specials, [see here](../uniques.md#modoptions-uniques) |
| techsToRemove | List | empty | List of [Technologies](2-Civilization-related-JSON-files.md#techsjson) or [-filters](../Unique-parameters.md#technologyfilter) to remove (isBaseRuleset=false only) |
| buildingsToRemove | List | empty | List of [Buildings or Wonders](2-Civilization-related-JSON-files.md#buildingsjson) or [-filters](../Unique-parameters.md#buildingfilter) to remove (isBaseRuleset=false only) |
| unitsToRemove | List | empty | List of [Units](4-Unit-related-JSON-files.md#unitsjson) or [-filters](../Unique-parameters.md#baseunitfilter) to remove (isBaseRuleset=false only) |
| nationsToRemove | List | empty | List of [Nations](2-Civilization-related-JSON-files.md#nationsjson) or [-filters](../Unique-parameters.md#nationfilter) to remove (isBaseRuleset=false only) |
| lastUpdated | String | empty | Set automatically after download - Last repository update, not necessarily last content change |
| modUrl | String | empty | Set automatically after download - URL of repository |
| author | String | empty | Set automatically after download - Owner of repository |
| modSize | Integer | empty | Set automatically after download - kB in entire repository, not sum of default branch files |
| constants | Object | empty | see [ModConstants](#ModConstants) |
| Attribute | Type | | Notes |
| --------- | ---- | ------- | ----- |
| isBaseRuleset | Boolean | false | Replaces vanilla ruleset if true |
| uniques | List | empty | Mod-wide specials, [see here](../uniques.md#modoptions-uniques) |
| techsToRemove | List | empty | List of [Technologies](2-Civilization-related-JSON-files.md#techsjson) or [technologyFilter](../Unique-parameters.md#technologyfilter) to remove (isBaseRuleset=false only) |
| buildingsToRemove | List | empty | List of [Buildings or Wonders](2-Civilization-related-JSON-files.md#buildingsjson) or [buildingFilter](../Unique-parameters.md#buildingfilter) to remove (isBaseRuleset=false only) |
| unitsToRemove | List | empty | List of [Units](4-Unit-related-JSON-files.md#unitsjson) or [unitFilter](../Unique-parameters.md#baseunitfilter) to remove (isBaseRuleset=false only) |
| nationsToRemove | List | empty | List of [Nations](2-Civilization-related-JSON-files.md#nationsjson) or [nationFilter](../Unique-parameters.md#nationfilter) to remove (isBaseRuleset=false only) |
| constants | Object | empty | See [ModConstants](#modconstants) |
### ModConstants
@ -134,46 +145,46 @@ Stored in ModOptions.constants, this is a collection of constants used internall
This is the only structure that is _merged_ field by field from mods, not overwritten, so you can change XP from Barbarians in one mod
and city distance in another. In case of conflicts, there is no guarantee which mod wins, only that _default_ values are ignored.
| Attribute | Type | Default | Notes |
|------------------------------------------|--------|-----------|-------|
| maxXPfromBarbarians | Int | 30 | [^A] |
| cityStrengthBase | Float | 8.0 | [^B] |
| cityStrengthPerPop | Float | 0.4 | [^B] |
| cityStrengthFromTechsMultiplier | Float | 5.5 | [^B] |
| cityStrengthFromTechsExponent | Float | 2.8 | [^B] |
| cityStrengthFromTechsFullMultiplier | Float | 1.0 | [^B] |
| cityStrengthFromGarrison | Float | 0.2 | [^B] |
| unitSupplyPerPopulation | Float | 0.5 | [^C] |
| minimalCityDistance | Int | 3 | [^D] |
| minimalCityDistanceOnDifferentContinents | Int | 2 | [^D] |
| unitUpgradeCost | Object | see below | [^J] |
| naturalWonderCountMultiplier | Float | 0.124 | [^E] |
| naturalWonderCountAddedConstant | Float | 0.1 | [^E] |
| ancientRuinCountMultiplier | Float | 0.02 | [^F] |
| maxLakeSize | Int | 10 | [^H] |
| riverCountMultiplier | Float | 0.01 | [^I] |
| minRiverLength | Int | 5 | [^I] |
| maxRiverLength | Int | 666 | [^I] |
| religionLimitBase | Int | 1 | [^K] |
| religionLimitMultiplier | Float | 0.5 | [^K] |
| pantheonBase | Int | 10 | [^L] |
| pantheonGrowth | Int | 5 | [^L] |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| maxXPfromBarbarians | Int | 30 | [^A] |
| cityStrengthBase | Float | 8.0 | [^B] |
| cityStrengthPerPop | Float | 0.4 | [^B] |
| cityStrengthFromTechsMultiplier | Float | 5.5 | [^B] |
| cityStrengthFromTechsExponent | Float | 2.8 | [^B] |
| cityStrengthFromTechsFullMultiplier | Float | 1.0 | [^B] |
| cityStrengthFromGarrison | Float | 0.2 | [^B] |
| unitSupplyPerPopulation | Float | 0.5 | [^C] |
| minimalCityDistance | Int | 3 | [^D] |
| minimalCityDistanceOnDifferentContinents | Int | 2 | [^D] |
| unitUpgradeCost | Object | [See below](#unitupgradecost) | [^J] |
| naturalWonderCountMultiplier | Float | 0.124 | [^E] |
| naturalWonderCountAddedConstant | Float | 0.1 | [^E] |
| ancientRuinCountMultiplier | Float | 0.02 | [^F] |
| spawnIceBelowTemperature | Float | -0.8 | [^G] |
| maxLakeSize | Int | 10 | [^H] |
| riverCountMultiplier | Float | 0.01 | [^I] |
| minRiverLength | Int | 5 | [^I] |
| maxRiverLength | Int | 666 | [^I] |
| religionLimitBase | Int | 1 | [^K] |
| religionLimitMultiplier | Float | 0.5 | [^K] |
| pantheonBase | Int | 10 | [^L] |
| pantheonGrowth | Int | 5 | [^L] |
Legend:
- [^A]: Max amount of experience that can be gained from combat with barbarians
- [^B]: Formula for city Strength:
Strength = baseStrength + strengthPerPop + strengthFromTiles +
((%techs * multiplier) ^ exponent) * fullMultiplier +
(garrisonBonus * garrisonUnitStrength * garrisonUnitHealth/100) +
((%techs \* multiplier) ^ exponent) \* fullMultiplier +
(garrisonBonus \* garrisonUnitStrength \* garrisonUnitHealth/100) +
defensiveBuildingStrength
where %techs is the percentage of techs in the tech tree that are complete
If no techs exist in this ruleset, %techs = 0.5 (=50%)
- [^C]: Formula for Unit Supply:
Supply = unitSupplyBase (difficulties.json)
unitSupplyPerCity * amountOfCities + (difficulties.json)
unitSupplyPerPopulation * amountOfPopulationInAllCities
unitSupplyPerCity \* amountOfCities + (difficulties.json)
unitSupplyPerPopulation \* amountOfPopulationInAllCities
unitSupplyBase and unitSupplyPerCity can be found in difficulties.json
unitSupplyBase, unitSupplyPerCity and unitSupplyPerPopulation can also be increased through uniques
- [^D]: The minimal distance that must be between any two cities, not counting the tiles cities are on
@ -182,9 +193,10 @@ Legend:
First constant is for cities on the same landmass, the second is for cities on different continents.
- [^E]: NaturalWonderGenerator uses these to determine the number of Natural Wonders to spawn for a given map size. The number scales linearly with map radius: #wonders = radius * naturalWonderCountMultiplier + naturalWonderCountAddedConstant. The defaults effectively mean Tiny - 1, Small - 2, Medium - 3, Large - 4, Huge - 5, Custom radius >=109 - all G&K wonders.
- [^F]: MapGenerator.spreadAncientRuins: number of ruins = suitable tile count * this
- [^G]: MapGenerator.spawnIce: spawn Ice where T < this, with T calculated from temperatureExtremeness, latitude and perlin noise.
- [^H]: MapGenerator.spawnLakesAndCoasts: Water bodies up to this tile count become Lakes
- [^I]: RiverGenerator: river frequency and length bounds
- [^J]: A [UnitUpgradeCost](#UnitUpgradeCost) sub-structure.
- [^J]: A [UnitUpgradeCost](#unitupgradecost) sub-structure.
- [^K]: Maximum foundable Religions = religionLimitBase + floor(MajorCivCount * religionLimitMultiplier)
- [^L]: Cost of pantheon = pantheonBase + CivsWithReligion * pantheonGrowth
@ -192,17 +204,18 @@ Legend:
These values are not merged individually, only the entire sub-structure is.
| Attribute | Type | Default | Notes |
| --------- | ---- | -------- | ----- |
| base | Float | 10 | |
| perProduction | Float | 2 | |
| eraMultiplier | Float | 0 | |
| exponent | Float | 1 | |
| roundTo | Int | 5 | |
| Attribute | Type | | Notes |
| --------- | ---- | ------- | ----- |
| base | Float | 10 | |
| perProduction | Float | 2 | |
| eraMultiplier | Float | 0 | |
| exponent | Float | 1 | |
| roundTo | Int | 5 | |
The formula for the gold cost of a unit upgrade is (rounded down to a multiple of `roundTo`):
( max((`base` + `perProduction` * (new_unit_cost - old_unit_cost)), 0)
* (1 + eraNumber * `eraMultiplier`) * `civModifier`
(
max((`base` + `perProduction` \* (new_unit_cost - old_unit_cost)), 0)
\* (1 + eraNumber \* `eraMultiplier`) \* `civModifier`
) ^ `exponent`
With `civModifier` being the multiplicative aggregate of ["\[relativeAmount\]% Gold cost of upgrading"](../uniques.md#global-uniques) uniques that apply.
@ -210,7 +223,7 @@ With `civModifier` being the multiplicative aggregate of ["\[relativeAmount\]% G
[link to original](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/GlobalUniques.json)
Defines uniques that apply globally. e.g. Vanilla rulesets define the effects of Unhappiness here.
GlobalUniques defines uniques that apply globally. e.g. Vanilla rulesets define the effects of Unhappiness here.
Only the `uniques` field is used, but a name must still be set (the Ruleset validator might display it).
When extension rulesets define GlobalUniques, all uniques are merged. At the moment there is no way to change/remove uniques set by a base mod.
@ -222,14 +235,15 @@ When extension rulesets define GlobalUniques, all uniques are merged. At the mom
As an exception to the general rule, this file in a Base Ruleset mod will not _replace_ the default, but add to it like extension mods do.
Also, place it under `<mod>/jsons/` normally even if the original is found one level above the vanilla jsons.
| Attribute | Type | Optional | Notes |
|-----------------|--------------| -------- |----------------------------------------------------------|
| name | String | Required | Entry name |
| civilopediaText | List | Optional | [see here](5-Miscellaneous-JSON-files.md#civilopedia-text) |
| steps | List(String) | Optional | Plain text |
Each tutorial has the following structure:
If an entry contains both `steps`and `civilopediaText` attributes, the `civilopediaText` is shown first.
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | Entry name |
| civilopediaText | List | Optional | See [civilopediaText chapter](5-Miscellaneous-JSON-files.md#civilopedia-text) |
| steps | List of Strings | Optional | Plain text |
If an entry contains both `steps` and `civilopediaText` attributes, the `civilopediaText` is shown first.
## VictoryTypes.json
@ -238,17 +252,17 @@ If an entry contains both `steps`and `civilopediaText` attributes, the `civilope
These files contain which victories this mod provides, and what milestones must be reached for someone to win a victory.
Most of the file contains of strings that are shown to the user in the victory screen, with the rest being the requirements for winning.
Each victory can have the following attributes:
Each victory have the following structure:
| Attribute | Type | Optional | Notes |
| --------- | ---- | -------- | ----- |
| Attribute | Type | Default | Notes |
| --------- | ---- | ------- | ----- |
| name | String | Required | Name of the victory |
| victoryScreenHeader | String | Defaults to "" | Shown in the footer of the victory in the `our status` in the victory screen |
| victoryString | String | Defaults to "" | Shown in the footer of the victory screen when you won the game with this victory |
| defeatString | String | Defaults to "" | Shown in the footer of the victory screen when someone else won the game with this victory |
| hiddenInVictoryScreen | Boolean | Defaults to false | Whether progress of this victory is hidden in the victory screen |
| requiredSpaceshipParts | List of Strings | Defaults to "" | What spaceship parts must be added to the capital for the corresponding milestone |
| Milestones | List of Strings | Required | List of milestones that must be accomplished to win, see [below](#Milestones) |
| victoryScreenHeader | String | none | Shown in the footer of the victory in the `our status` in the victory screen |
| victoryString | String | none | Shown in the footer of the victory screen when you won the game with this victory |
| defeatString | String | none | Shown in the footer of the victory screen when someone else won the game with this victory |
| hiddenInVictoryScreen | Boolean | false | Whether progress of this victory is hidden in the victory screen |
| requiredSpaceshipParts | List of Strings | empty | What spaceship parts must be added to the capital for the corresponding milestone |
| Milestones | List of Strings | Required | List of milestones that must be accomplished to win, [see below](#milestones) |
### Milestones
@ -257,7 +271,7 @@ Currently the following milestones are supported:
| Milestone | Requirement |
| --------- | ----------- |
| Build [building] | Build the building [building] in any city |
| Anyone build [building] | Anyone must build the building [building] for all players to have this milestone |
| Anyone should build [building] | Anyone must build the building [building] for all players to have this milestone |
| Add all [comment] in capital | Add all units in the `requiredSpaceshipParts` field of this victory to the capital |
| Destroy all players | You must be the only major civilization with any cities left |
| Capture all capitals | Capture all the original capitals of major civilizations in the game |
@ -266,7 +280,6 @@ Currently the following milestones are supported:
| Become the world religion | Have your religion be the majority religion in a majority of cities of all major civs |
| Have highest score after max turns | Basically time victory. Enables the 'max turn' slider and calculates score when that amount is reached |
## Civilopedia text
Any 'thing' defined in json and listed in the Civilopedia can supply extra text, specifically for the Civilopedia. This can be used to explain special considerations better when the automatically generated display is insufficient, or for 'flavour', background stories and the like. Such text can be formatted and linked to other Civilopedia entries, within limits.
@ -274,42 +287,54 @@ Any 'thing' defined in json and listed in the Civilopedia can supply extra text,
An example of the format is:
```json
"civilopediaText": [
{ "text": "Ancient ruins provide a one-time random bonus when explored" },
{ "separator": true },
{
"text": "This line is red and links to the Scout including icons",
"link": "Unit/Scout",
"color": "red"
},
{
"text": "A big fat header sporting a golden star",
"header": 1,
"starred": true,
"color": "#ffeb7f"
},
],
"civilopediaText": [
{ "text": "Ancient ruins provide a one-time random bonus when explored" },
{ "separator": true },
{
"text": "This line is red and links to the Scout including icons",
"link": "Unit/Scout",
"color": "red"
},
{
"text": "A big fat header sporting a golden star",
"header": 1,
"starred": true,
"color": "#ffeb7f"
},
],
```
List of attributes - note not all combinations are valid:
| Attribute | Type | Description |
|--------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
| `text` | String | Text to display. |
| `link` | String | Create link and icon, format: Category/Name or _external_ link ('http://','https://','mailto:'). |
| `icon` | String | Show icon without linking, format: Category/Name. |
| `extraImage` | String | Display an Image instead of text. Can be a path found in a texture atlas or or the name of a png or jpg in the ExtraImages folder. |
| `imageSize` | Float | Size in world units of the [extraImage], the smaller coordinate is calculated preserving aspect ratio. Defaults to available width. |
| `header` | Integer | Header level. 1 means double text size and decreases from there. |
| `size` | Integer | Text size, default is 18. Use `size` or `header` but not both. |
| `indent` | Integer | Indent level. 0 means text will follow icons, 1 aligns to the right of all icons, each further step is 30 units. |
| `padding` | Float | Vertical padding between rows, defaults to 5 units. |
| `color` | String | Sets text color, accepts names or 6/3-digit web colors (e.g. #FFA040). |
| `separator` | Boolean | Renders a separator line instead of text. Can be combined only with `color` and `size` (line width, default 2). |
| `starred` | Boolean | Decorates text with a star icon - if set, it receives the `color` instead of the text. |
| `centered` | Boolean | Centers the line (and turns off automatic wrap). For an `extraImage`, turns on crop-to-content to equalize transparent borders. |
| Attribute | Type | Description |
| --------- | ---- | ----------- |
| `text` | String | Text to display |
| `link` | String | Create link and icon, format: Category/Name or _external_ link ('http://','https://','mailto:') |
| `icon` | String | Show icon without linking, format: Category/Name |
| `extraImage` | String | Display an Image instead of text. Can be a path found in a texture atlas or or the name of a png or jpg in the ExtraImages folder |
| `imageSize` | Float | Size in world units of the [extraImage], the smaller coordinate is calculated preserving aspect ratio. available width |
| `header` | Integer | Header level. 1 means double text size and decreases from there |
| `size` | Integer | Text size, is 18. Use `size` or `header` but not both |
| `indent` | Integer | Indent level. 0 means text will follow icons, 1 aligns to the right of all icons, each further step is 30 units |
| `padding` | Float | Vertical padding between rows, 5 units |
| `color` | String | Sets text color, accepts names or 6/3-digit web colors (e.g. #FFA040) |
| `separator` | Boolean | Renders a separator line instead of text. Can be combined only with `color` and `size` (line width, default 2) |
| `starred` | Boolean | Decorates text with a star icon - if set, it receives the `color` instead of the text |
| `centered` | Boolean | Centers the line (and turns off automatic wrap). For an `extraImage`, turns on crop-to-content to equalize transparent borders |
The lines from json will 'surround' the automatically generated lines such that the latter are inserted just above the first json line carrying a link, if any. If no json lines have links, they will be inserted between the automatic title and the automatic info. This method may, however, change in the future.
Note: `text` now also supports inline color markup. Insert `«color»` to start coloring text, `«»` to stop. `color` can be a name or 6/8-digit hex notation like `#ffa040` (different from the `color` attribute notation only by not allowing 3-digit codes, but allowing the alpha channel).
Effectively, the `«»` markers are replaced with `[]` _after_ translation and then passed to [Gdx markup language](https://libgdx.com/wiki/graphics/2d/fonts/color-markup-language).
Effectively, the `«»` markers are replaced with `[]` _after_ translation and then passed to [gdx markup language](https://libgdx.com/wiki/graphics/2d/fonts/color-markup-language).
## RGB colors list
Certain objects can be specified to have its own unique color. The colors are defined by a list of 3× Integer in this order: red, green, blue. The range of color is from \[0, 0, 0\] (black) to \[255, 255, 255\] (white).
Note: The default of some objects are [gdx color classes](https://javadoc.io/doc/com.badlogicgames.gdx/gdx/latest/com/badlogic/gdx/graphics/Color.html). The values of the constants are as follows:
| name | value |
| ---- | ----- |
| gold | [225, 215, 0] |
| white | [255, 255, 255] |
| black | [0, 0, 0] |

View File

@ -4,8 +4,8 @@ This page contains an overview of all different parameters used in uniques and w
Each of the different parameter types is described below, including all possible values for them.
These are split into two categories:
- descriptions: e.g., "the name of any unit"
- `Text that looks like this`. This last one must be used exactly the same
- descriptions: e.g., "the name of any unit"
- `Text that looks like this`. This last one must be used exactly the same
Note that all of these are case-sensitive!
@ -41,6 +41,16 @@ Allows filtering for specific civs.
- Nation name
- A unique a Nation has (verbatim, no placeholders)
## nationFilter
Allows filtering for specific nations. Used by [ModOptions.nationsToRemove](Mod-file-structure/5-Miscellaneous-JSON-files.md#modoptionsjson).
- `All`
- `City-states`
- `Major`
- Nation name
- A unique a Nation has (verbatim, no placeholders)
## baseUnitFilter
Unit filters can be divided up into two parts: `baseUnitFilter`s and `mapUnitFilter`s.
@ -50,30 +60,30 @@ The latter is tested against the unit as it appears on the map, including its na
The following are allowed to be used:
- unit name
- unit type - e.g. Melee, Ranged, WaterSubmarine, etc.
- `Land`, `Water`, `Air`
- `land units`, `water units`, `air units`
- `non-air` for non-air non-missile units
- `Military`, `military units`
- `Civilian`, `civilian units`
- `All`
- `Melee`
- `Ranged`
- `Nuclear Weapon`
- `Great Person`, `Great`
- `Embarked`
- Matching [technologyfilter](#technologyfilter) for the tech this unit requires - e.g. `Modern Era`
- Any exact unique the unit has
- Any exact unique the unit type has
- Any combination of the above (will match only if all match). The format is `{filter1} {filter2}` and can match any number of filters. For example: `
- unit name
- unit type - e.g. Melee, Ranged, WaterSubmarine, etc.
- `Land`, `Water`, `Air`
- `land units`, `water units`, `air units`
- `non-air` for non-air non-missile units
- `Military`, `military units`
- `Civilian`, `civilian units`
- `All`
- `Melee`
- `Ranged`
- `Nuclear Weapon`
- `Great Person`, `Great`
- `Embarked`
- Matching [technologyfilter](#technologyfilter) for the tech this unit requires - e.g. `Modern Era`
- Any exact unique the unit has
- Any exact unique the unit type has
- Any combination of the above (will match only if all match). The format is `{filter1} {filter2}` and can match any number of filters. For example: `
## mapUnitFilter
This indicates a unit as placed on the map. Compare with `baseUnitFilter`.
- Any matching [baseUnitFilter](#baseunitfilter)
- Any [nationFilter](#nationfilter) matching the owner
- Any [civFilter](#civfilter) matching the owner
- Any unique the unit has - also includes uniques not caught by the [baseUnitFilter](#baseunitfilter), for example promotions
- `Wounded`
- `Embarked`
@ -85,42 +95,42 @@ This indicates a unit as placed on the map. Compare with `baseUnitFilter`.
Allows to only activate a unique for certain buildings. Allowed options are:
- `All`
- `Buildings`, `Building`
- `Wonders`, `Wonders`
- `National Wonder`
- `World Wonder` -- All wonders that are not national wonders
- building name
- The name of the building it replaces (so for example uniques for libraries will apply to paper makers as well)
- an exact unique the building has (e.g.: `spaceship part`)
- `Culture`, `Gold`, etc. if the building is `stat-related` for that stat. Stat-related buildings are defined as one of the following:
- Provides that stat directly (e.g. +1 Culture)
- Provides a percentage bonus for that stat (e.g. +10% Production)
- Provides that stat as a bonus for resources (e.g. +1 Food from every Wheat)
- Provides that stat per some amount of population (e.g. +1 Science for every 2 population [cityFilter])
- `All`
- `Buildings`, `Building`
- `Wonders`, `Wonders`
- `National Wonder`
- `World Wonder` -- All wonders that are not national wonders
- building name
- The name of the building it replaces (so for example uniques for libraries will apply to paper makers as well)
- an exact unique the building has (e.g.: `spaceship part`)
- `Culture`, `Gold`, etc. if the building is `stat-related` for that stat. Stat-related buildings are defined as one of the following:
- Provides that stat directly (e.g. +1 Culture)
- Provides a percentage bonus for that stat (e.g. +10% Production)
- Provides that stat as a bonus for resources (e.g. +1 Food from every Wheat)
- Provides that stat per some amount of population (e.g. +1 Science for every 2 population [cityFilter])
## cityFilter
cityFilters allow us to choose the range of cities affected by this unique:
- `in this city`
- `in all cities`
- `in other cities`
- `in all coastal cities`
- `in capital`
- `in all non-occupied cities` - all cities that are not puppets and don't have extra unhappiness from being recently conquered
- `in all cities with a world wonder`
- `in all cities connected to capital`
- `in all cities with a garrison`
- `in non-enemy foreign cities` - In all cities owned by civs other than you that you are not at war with
- `in foreign cities`
- `in annexed cities`
- `in puppeted cities`
- `in holy cities`
- `in City-State cities`
- `in cities following this religion` - Should only be used in pantheon/follower uniques for religions
- `in all cities in which the majority religion is a major religion`
- `in all cities in which the majority religion is an enhanced religion`
- `in this city`
- `in all cities`
- `in other cities`
- `in all coastal cities`
- `in capital`
- `in all non-occupied cities` - all cities that are not puppets and don't have extra unhappiness from being recently conquered
- `in all cities with a world wonder`
- `in all cities connected to capital`
- `in all cities with a garrison`
- `in non-enemy foreign cities` - In all cities owned by civs other than you that you are not at war with
- `in foreign cities`
- `in annexed cities`
- `in puppeted cities`
- `in holy cities`
- `in City-State cities`
- `in cities following this religion` - Should only be used in pantheon/follower uniques for religions
- `in all cities in which the majority religion is a major religion`
- `in all cities in which the majority religion is an enhanced religion`
## improvementFilter
@ -128,28 +138,27 @@ For filtering a specific improvement.
Allowed values are:
- improvement name (Note that "Road" and "Railroad" _do_ work as improvementFilters, but not as tileFilters at the moment.)
- `All`
- `Great Improvements`, `Great`
- `All Road` - for Roads & Railroads
- improvement name (Note that "Road" and "Railroad" _do_ work as improvementFilters, but not as tileFilters at the moment.)
- `All`
- `Great Improvements`, `Great`
- `All Road` - for Roads & Railroads
## populationFilter
A filter determining a part of the population of a city. It can be any of the following values:
- `Population`
- `Specialists`
- `Unemployed`
- `Followers of the Majority Religion` or `Followers of this Religion`, both of which only apply when this religion is the majority religion in that city
- `Population`
- `Specialists`
- `Unemployed`
- `Followers of the Majority Religion` or `Followers of this Religion`, both of which only apply when this religion is the majority religion in that city
## regionType
Used for dividing the world into regions in each of which a single player is placed at the start of the game.
Allowed values are `Hybrid` and the name of any terrain that has one of the following two uniques:
- `A Region is formed with at least [amount]% [simpleTerrain] tiles, with priority [amount]`
- `A Region is formed with at least [amount]% [simpleTerrain] tiles and [simpleTerrain] tiles, with priority [amount]`
- `A Region is formed with at least [amount]% [simpleTerrain] tiles, with priority [amount]`
- `A Region is formed with at least [amount]% [simpleTerrain] tiles and [simpleTerrain] tiles, with priority [amount]`
## simpleTerrain
@ -157,10 +166,10 @@ Used by NaturalWonderGenerator to place natural wonders
Allowed values are:
- `Land`
- `Water`
- `Elevated`
- The name of any terrain
- `Land`
- `Water`
- `Elevated`
- The name of any terrain
## stats
@ -186,7 +195,7 @@ Allowed values are:
This indicates the terrain on a single tile. The following values are allowed:
- A filter names a specific json attribute (by name):
- A filter names a specific json attribute (by name):
- Base terrain
- Terrain features
- Base terrain uniques
@ -194,31 +203,32 @@ This indicates the terrain on a single tile. The following values are allowed:
- Resource
- Natural wonder
- A [nationFilter](#nationfilter) matching the tile owner
- Or the filter is a constant string choosing a derived test:
- `All`
- `Water`, `Land`
- `Coastal` (at least one direct neighbor is a coast)
- `River` (as in all 'river on tile' contexts, it means 'adjacent to a river on at least one side')
- `Open terrain`, `Rough terrain` (note all terrain not having the rough unique is counted as open)
- `Friendly Land` - land belonging to you, or other civs with open borders to you
- `Foreign Land` - any land that isn't friendly land
- `Enemy land` - any land belonging to a civ you are at war with
- `Water resource`, `Strategic resource`, `Luxury resource`, `Bonus resource`
- `Natural Wonder` (as opposed to above which means testing for a specific Natural Wonder by name, this tests for any of them)
- Or the filter is a constant string choosing a derived test:
- `All`
- `Water`, `Land`
- `Coastal` (at least one direct neighbor is a coast)
- `River` (as in all 'river on tile' contexts, it means 'adjacent to a river on at least one side')
- `Open terrain`, `Rough terrain` (note all terrain not having the rough unique is counted as open)
- `Friendly Land` - land belonging to you, or other civs with open borders to you
- `Foreign Land` - any land that isn't friendly land
- `Enemy land` - any land belonging to a civ you are at war with
- `Water resource`, `Strategic resource`, `Luxury resource`, `Bonus resource`
- `Natural Wonder` (as opposed to above which means testing for a specific Natural Wonder by name, this tests for any of them)
Please note all of these are _case-sensitive_.
Also note: Resource filters depend on whether a viewing civ is known in the context where the filter runs. Water and specific tests require a viewing civ, and if the resource needs a tech to be visible, that tech to be researched by the viewing civ. The other resource category tests can succeed without a known viewing civ only for resources not requiring any tech. So - test your mod!
Note: Resource filters depend on whether a viewing civ is known in the context where the filter runs. Water and specific tests require a viewing civ, and if the resource needs a tech to be visible, that tech to be researched by the viewing civ. The other resource category tests can succeed without a known viewing civ only for resources not requiring any tech. So - test your mod!
So for instance, the unique "[stats] from [tileFilter] tiles [cityFilter]" can match several cases:
## tileFilter
Any of:
- [terrainFilter](#terrainfilter) for this tile
- [improvementFilter](#improvementfilter) for this tile
- `Improvement` for all improvements
- `unimproved` if no improvement exists
- [terrainFilter](#terrainfilter) for this tile
- [improvementFilter](#improvementfilter) for this tile
- `Improvement` for tiles with any improvements
- `unimproved` for tiles with no improvement
## terrainQuality
@ -226,7 +236,7 @@ Used to indicate for what use the terrain should be viewed when dividing the wor
Allowed values are:
- improvement name (Note that "Road" and "Railroad" _do_ work as improvementFilters, but not as tileFilters at the moment.)
- "All"
- "Great Improvements", "Great"
- "All Road" - for Roads & Railroads
- improvement name (Note that "Road" and "Railroad" _do_ work as improvementFilters, but not as tileFilters at the moment.)
- "All"
- "Great Improvements", "Great"
- "All Road" - for Roads & Railroads