mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 07:18:57 +07:00
Reorganize modders documentation files
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
# How to create a UI skin for Unciv
|
||||
# 5 - Creating a UI skin mod
|
||||
|
||||
**You should read the [Mods](Mods.md) page first before proceeding**
|
||||
|
||||
In order to add a UI skin mod (yes, UI skins are just another type of mod), all you need to do is add your images under `Images/Skins/MyCoolSkinExample` and enable the mod as a permanent visual mod - the game will recognize the skin, and allow you to pick it in the options menu.
|
||||
In order to add a UI skin mod (yes, UI skins are just another type of mod), all you need to do is add your images under `Images/Skins/MyCoolSkinExample` and enable the mod as a permanent visual mod.
|
||||
|
||||
The game will then recognize the skin, and allow you to pick it in the options menu.
|
||||
|
||||
Just like [tilesets](Creating-a-custom-tileset.md), UI skins can be used to alter the appearance of Unciv. Please note that UI skins do not support custom icons and fonts and not every UI element can be customized yet too.
|
||||
|
||||
@ -199,4 +201,4 @@ The color this UI element should have.
|
||||
|
||||
A float value. Default value: null
|
||||
|
||||
The alpha this UI element should have. Overwrites the alpha value of tint if specified.
|
||||
The alpha this UI element should have. Overwrites the alpha value of tint if specified.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# How to make Unciv use your custom tileset
|
||||
# 4 - Making a custom tileset
|
||||
|
||||
**You should read the [Mods](Mods.md) page first before proceeding**
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Images and Audio
|
||||
# 3 - Images and Audio
|
||||
|
||||
## Permanent audiovisual mods
|
||||
|
||||
@ -59,12 +59,12 @@ For example, [here](https://github.com/vegeta1k95/Civ-5-Icons) is mod showing ho
|
||||
|
||||
### Adding icons for Unit Types
|
||||
|
||||
The Unit Types as defined in [UnitTypes.json](../Other/Unit-related-JSON-files#unittypesjson) have no icons in the base game, but Civilopedia can decorate their entries if you supply images named 'Images/UnitTypeIcons/<UnitType>.png'.
|
||||
The Unit Types as defined in [UnitTypes.json](Mod file structure/4-Unit-related-JSON-files.md#unittypesjson) have no icons in the base game, but Civilopedia can decorate their entries if you supply images named 'Images/UnitTypeIcons/<UnitType>.png'.
|
||||
(while you're at it, you may override the default icon for the Unit Type _category header_ - it's 'UnitTypes.png' in the same folder, or the icons used for the movement domains - 'DomainLand', 'DomainWater', 'DomainAir')
|
||||
|
||||
### Adding icons for Beliefs
|
||||
|
||||
The individual Beliefs - as opposed to Belief types, as defined in [Beliefs.json](../Other/Civilization-related-JSON-files#beliefsjson) have no icons in the base game, but Civilopedia can decorate their entries if you supply images named 'Images/ReligionIcons/<Belief>.png'.
|
||||
The individual Beliefs - as opposed to Belief types, as defined in [Beliefs.json](Mod file structure/2-Civilization-related-JSON-files.md#beliefsjson) have no icons in the base game, but Civilopedia can decorate their entries if you supply images named 'Images/ReligionIcons/<Belief>.png'.
|
||||
Civilopedia falls back to the icon for the Belief type - as you can see in the base game, but individual icons have precedence if they exist.
|
||||
|
||||
## Sounds
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Making a new Civilization
|
||||
# 2 - 'My first mod' - Making a new Civilization
|
||||
|
||||
So you want to add your favorite civilization?
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# JSON files for mods
|
||||
# 1 - Mod file structure Overview
|
||||
|
||||
These pages are a work in progress. Information they contain may be incomplete.
|
||||
|
||||
@ -7,33 +7,33 @@ The JSON files that make up mods can have many different fields, and as not all
|
||||
## Table of Contents
|
||||
|
||||
- [General Overview of JSON files](#general-overview-of-json-files)
|
||||
- [Civilization-related JSON files](../Other/Civilization-related-JSON-files.md)
|
||||
- [Beliefs.json](../Other/Civilization-related-JSON-files.md#beliefsjson)
|
||||
- [Buildings.json](../Other/Civilization-related-JSON-files.md#buildingsjson)
|
||||
- [Nations.json](../Other/Civilization-related-JSON-files.md#nationsjson)
|
||||
- [Policies.json](../Other/Civilization-related-JSON-files.md#policiesjson)
|
||||
- [Quests.json](../Other/Civilization-related-JSON-files.md#questsjson)
|
||||
- [Religions.json](../Other/Civilization-related-JSON-files.md#religionsjson)
|
||||
- [Specialists.json](../Other/Civilization-related-JSON-files.md#specialistsjson)
|
||||
- [Techs.json](../Other/Civilization-related-JSON-files.md#techsjson)
|
||||
- [Map-related JSON files](../Other/Map-related-JSON-files.md)
|
||||
- [Terrains.json](../Other/Map-related-JSON-files.md#terrainsjson)
|
||||
- [TileResources.json](../Other/Map-related-JSON-files.md#tileresourcesjson)
|
||||
- [TileImprovements.json](../Other/Map-related-JSON-files.md#tileimprovementsjson)
|
||||
- [Ruins.json](../Other/Map-related-JSON-files.md#ruinsjson)
|
||||
- [Tileset-specific json](../Other/Map-related-JSON-files.md#tileset-specific-json)
|
||||
- [Unit-related JSON files](../Other/Unit-related-JSON-files.md)
|
||||
- [Units.json](../Other/Unit-related-JSON-files.md#unitsjson)
|
||||
- [UnitPromotions.json](../Other/Unit-related-JSON-files.md#unitpromotionsjson)
|
||||
- [UnitTypes.json](../Other/Unit-related-JSON-files.md#unittypesjson)
|
||||
- [Miscellaneous JSON files](../Other/Miscellaneous-JSON-files.md)
|
||||
- [Difficulties.json](../Other/Miscellaneous-JSON-files.md#difficultiesjson)
|
||||
- [Eras.json](../Other/Miscellaneous-JSON-files.md#erasjson)
|
||||
- [ModOptions.json](../Other/Miscellaneous-JSON-files.md#modoptionsjson)
|
||||
- [Tutorials.json](../Other/Miscellaneous-JSON-files.md#tutorialsjson)
|
||||
- [Stats](../Other/Map-related-JSON-files.md#stats)
|
||||
- [Sounds](Images-and-Audio.md#sounds)
|
||||
- [Civilopedia text](../Other/Miscellaneous-JSON-files.md#civilopedia-text)
|
||||
- [Civilization-related JSON files](2-Civilization-related-JSON-files.md)
|
||||
- [Beliefs.json](2-Civilization-related-JSON-files.md#beliefsjson)
|
||||
- [Buildings.json](2-Civilization-related-JSON-files.md#buildingsjson)
|
||||
- [Nations.json](2-Civilization-related-JSON-files.md#nationsjson)
|
||||
- [Policies.json](2-Civilization-related-JSON-files.md#policiesjson)
|
||||
- [Quests.json](2-Civilization-related-JSON-files.md#questsjson)
|
||||
- [Religions.json](2-Civilization-related-JSON-files.md#religionsjson)
|
||||
- [Specialists.json](2-Civilization-related-JSON-files.md#specialistsjson)
|
||||
- [Techs.json](2-Civilization-related-JSON-files.md#techsjson)
|
||||
- [Map-related JSON files](3-Map-related-JSON-files.md)
|
||||
- [Terrains.json](3-Map-related-JSON-files.md#terrainsjson)
|
||||
- [TileResources.json](3-Map-related-JSON-files.md#tileresourcesjson)
|
||||
- [TileImprovements.json](3-Map-related-JSON-files.md#tileimprovementsjson)
|
||||
- [Ruins.json](3-Map-related-JSON-files.md#ruinsjson)
|
||||
- [Tileset-specific json](3-Map-related-JSON-files.md#tileset-specific-json)
|
||||
- [Unit-related JSON files](4-Unit-related-JSON-files.md)
|
||||
- [Units.json](4-Unit-related-JSON-files.md#unitsjson)
|
||||
- [UnitPromotions.json](4-Unit-related-JSON-files.md#unitpromotionsjson)
|
||||
- [UnitTypes.json](4-Unit-related-JSON-files.md#unittypesjson)
|
||||
- [Miscellaneous JSON files](5-Miscellaneous-JSON-files.md)
|
||||
- [Difficulties.json](5-Miscellaneous-JSON-files.md#difficultiesjson)
|
||||
- [Eras.json](5-Miscellaneous-JSON-files.md#erasjson)
|
||||
- [ModOptions.json](5-Miscellaneous-JSON-files.md#modoptionsjson)
|
||||
- [Tutorials.json](5-Miscellaneous-JSON-files.md#tutorialsjson)
|
||||
- [Stats](3-Map-related-JSON-files.md#stats)
|
||||
- [Sounds](../Images-and-Audio.md#sounds)
|
||||
- [Civilopedia text](5-Miscellaneous-JSON-files.md#civilopedia-text)
|
||||
|
||||
## General Overview of JSON files
|
||||
|
@ -0,0 +1,208 @@
|
||||
# 2 - Civilization-related JSON files
|
||||
|
||||
## Beliefs.json
|
||||
|
||||
[link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/Beliefs.json)
|
||||
|
||||
This file contains the beliefs that can be chosen for religions in your mod.
|
||||
|
||||
Each belief can have the following attributes:
|
||||
|
||||
| Attribute | Type | Optional | Notes |
|
||||
| --------- | ---- | -------- | ----- |
|
||||
| name | String | Required | Name of the belief |
|
||||
| type | String | Required | The type of the belief. Valid values are: "Pantheon", "Follower", "Founder" and "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) |
|
||||
|
||||
## 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.
|
||||
|
||||
Each building can have the following attributes:
|
||||
|
||||
| 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) |
|
||||
|
||||
## Nations.json
|
||||
|
||||
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/Nations.json)
|
||||
|
||||
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 |
|
||||
| attacked | String | Default empty | another greeting |
|
||||
| defeated | String | Default empty | another greeting |
|
||||
| introduction | String | Default empty | another greeting |
|
||||
| neutralHello | String | Default empty | another greeting |
|
||||
| hateHello | String | Default empty | another greeting |
|
||||
| tradeRequest | String | Default empty | another greeting |
|
||||
| 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) |
|
||||
|
||||
[^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).
|
||||
|
||||
## 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.
|
||||
|
||||
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.
|
||||
|
||||
Each policy branch can have the following properties:
|
||||
|
||||
| Attribute | Type | Optional | 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 |
|
||||
|
||||
Each member policy can have the following properties:
|
||||
|
||||
| Attribute | Type | Optional? | 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) |
|
||||
|
||||
#### Branch priorities
|
||||
|
||||
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 | 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 |
|
||||
|
||||
## 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.
|
||||
|
||||
| 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 |
|
||||
|
||||
## 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).
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
Each specialist can have the following attributes:
|
||||
|
||||
| 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) |
|
||||
|
||||
## 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.
|
||||
|
||||
#### 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 []. |
|
||||
|
||||
#### 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). |
|
168
docs/Modders/Mod file structure/3-Map-related-JSON-files.md
Normal file
168
docs/Modders/Mod file structure/3-Map-related-JSON-files.md
Normal file
@ -0,0 +1,168 @@
|
||||
# 3 - Map-related JSON files
|
||||
|
||||
## Terrains.json
|
||||
|
||||
This file lists the base terrains, terrain features and natural wonders that can appear on the map.
|
||||
|
||||
Each terrain entry can have the following properties:
|
||||
|
||||
| Attribute | Type | Optional | 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) |
|
||||
|
||||
|
||||
## 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).
|
||||
|
||||
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:
|
||||
|
||||
| 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) |
|
||||
|
||||
- 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.
|
||||
|
||||
## TileResources.json
|
||||
|
||||
This file lists the resources that a map tile can have.
|
||||
|
||||
Note the predefined resource _types_ cannot be altered in 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 | String | 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) |
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
Each of the objects in the file represents a single reward you can get from ruins. It has the following properties:
|
||||
|
||||
| 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 |
|
||||
|
||||
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.
|
||||
|
||||
### 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.
|
||||
|
||||
| Unique | Parameters |
|
||||
| ------ | ---------- |
|
||||
| Free [] found in the ruins | The name of the unit will be filled in the notification, including unique units of the nation |
|
||||
| [] population in a random city | The name of the city to which the population is added will be filled in the notification |
|
||||
| Gain []-[] [] | The exact amount of the stat gained will be filled in the notification |
|
||||
| [] free random reasearchable Tech(s) from the [] | The notification must have placeholders equal to the number of techs granted this way. Each of the names of these free techs will be filled in the notification |
|
||||
| Gain enough Faith for a Pantheon | The amount of faith gained is filled in the notification |
|
||||
| Gain enough Faith for []% of a Great Prophet | The amount of faith gained is filled in the notification |
|
||||
|
||||
### Specific uniques
|
||||
|
||||
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"
|
||||
|
||||
## Tileset-specific 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 |
|
||||
| --------- | ---- | -------- | ----- |
|
||||
| [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 |
|
||||
|
||||
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"],
|
||||
// . . .
|
||||
}
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
## Stats
|
||||
|
||||
Terrains, features, resources and improvements may list yield statistics. They can be one of the following:
|
||||
|
||||
- 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:
|
||||
|
||||
```json
|
||||
"gold": 2,
|
||||
"improvement": "Quarry",
|
||||
"improvementStats": { "gold": 1, "production": 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 😁.
|
69
docs/Modders/Mod file structure/4-Unit-related-JSON-files.md
Normal file
69
docs/Modders/Mod file structure/4-Unit-related-JSON-files.md
Normal file
@ -0,0 +1,69 @@
|
||||
# 3 - Unit-related JSON files
|
||||
|
||||
## Units.json
|
||||
|
||||
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/Units.json)
|
||||
|
||||
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) |
|
||||
|
||||
|
||||
## UnitPromotions.json
|
||||
|
||||
[Link to original](https://github.com/yairm210/Unciv/blob/master/android/assets/jsons/Civ%20V%20-%20Gods%20%26%20Kings/UnitPromotions.json)
|
||||
|
||||
This file lists the available unit promotions.
|
||||
|
||||
Each promotion must have an icon, except progressions ending in " I", " II", " III" (no IV V VI allowed) are rendered by looking up an icon without those suffixes and adding stars.
|
||||
|
||||
Remember, promotions can be "bought" with XP, but also granted by the unit type, buildings, wonders and such. They are preserved when a unit upgrades, therefore special properties of nation unique units that can be inherited when they upgrade should be in a promotion, not uniques/stats in the units json (example: Slinger withdraw).
|
||||
|
||||
Each promotion can have the following properties:
|
||||
|
||||
| Attribute | Type | Optional | Notes |
|
||||
|-----------------|--------|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| name | String | Required | See above for "I, II, III" progressions |
|
||||
| prerequisites | List | Default empty | Prerequisite promotions |
|
||||
| effect | String | Default empty | Deprecated 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) |
|
||||
|
||||
## 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:
|
||||
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 | String | required | The domain through which the unit moves. Allowed values: "Water", "Land", "Air" |
|
||||
| uniques | List of String | defaults to none | A list of the unique abilities every unit of this type has. A list of almost all uniques can be found [here](../Unique-parameters.md#unit-uniques) |
|
302
docs/Modders/Mod file structure/5-Miscellaneous-JSON-files.md
Normal file
302
docs/Modders/Mod file structure/5-Miscellaneous-JSON-files.md
Normal file
@ -0,0 +1,302 @@
|
||||
# Miscellaneous JSON files
|
||||
|
||||
## Difficulties.json
|
||||
|
||||
[Link to original](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Difficulties.json)
|
||||
|
||||
This file defines the difficulty levels a player can choose when starting a new game.
|
||||
|
||||
Each difficulty level can have the following attributes:
|
||||
|
||||
| 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)] |
|
||||
| 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 | See above |
|
||||
| aiCityStateBonusStartingUnits | List of Units | Default empty | See above |
|
||||
| aiUnhappinessModifier | Float | Default 1 |
|
||||
| aisExchangeTechs | Boolean | | Unimplemented |
|
||||
| turnBarbariansCanEnterPlayerTiles | Integer | Default 0 |
|
||||
| clearBarbarianCampReward | Integer | Default 25 |
|
||||
|
||||
## Eras.json
|
||||
|
||||
[Link to original](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Eras.json)
|
||||
|
||||
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 were 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 |
|
||||
| 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) |
|
||||
| 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. Must be in [Units.json](4-Unit-related-JSON-files.md#unitsjson) |
|
||||
| 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 |
|
||||
|
||||
## Speeds.json
|
||||
|
||||
[Link to original](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/Speeds.json)
|
||||
|
||||
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 |
|
||||
|
||||
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.
|
||||
|
||||
```json
|
||||
"turns": [
|
||||
{"yearsPerTurn": 60, "untilTurn": 50},
|
||||
{"yearsPerTurn": 40, "untilTurn": 80}
|
||||
]
|
||||
```
|
||||
|
||||
## ModOptions.json
|
||||
|
||||
<!-- [Link to original](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/ModOptions.json) -->
|
||||
|
||||
This file is a little different:
|
||||
|
||||
- Does not exist in Vanilla ruleset
|
||||
- Is entirely optional but will be created after downloading a mod
|
||||
|
||||
The file can have the following attributes, 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) |
|
||||
|
||||
### ModConstants
|
||||
|
||||
Stored in ModOptions.constants, this is a collection of constants used internally in Unciv.
|
||||
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] |
|
||||
|
||||
|
||||
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) +
|
||||
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
|
||||
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
|
||||
The number is the amount of tiles between two cities, not counting the tiles the cities are on.
|
||||
e.g. "C__C", where "C" is a tile with a city and "_" is a tile without a city, has a distance of 2.
|
||||
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
|
||||
- [^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.
|
||||
- [^K]: Maximum foundable Religions = religionLimitBase + floor(MajorCivCount * religionLimitMultiplier)
|
||||
- [^L]: Cost of pantheon = pantheonBase + CivsWithReligion * pantheonGrowth
|
||||
|
||||
#### UnitUpgradeCost
|
||||
|
||||
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 | |
|
||||
|
||||
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`
|
||||
) ^ `exponent`
|
||||
With `civModifier` being the multiplicative aggregate of ["\[relativeAmount\]% Gold cost of upgrading"](../uniques.md#global-uniques) uniques that apply.
|
||||
|
||||
## Tutorials.json
|
||||
|
||||
[link to original](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Tutorials.json)
|
||||
|
||||
**Note a Base Ruleset mod can define a "welcome page" here by adding a "Tutorial" with a name equal to the name of the mod!**
|
||||
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 |
|
||||
|
||||
If an entry contains both `steps`and `civilopediaText` attributes, the `civilopediaText` is shown first.
|
||||
|
||||
|
||||
## VictoryTypes.json
|
||||
|
||||
[link to original](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/VictoryTypes.json)
|
||||
|
||||
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:
|
||||
|
||||
| Attribute | Type | Optional | 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) |
|
||||
|
||||
### Milestones
|
||||
|
||||
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 |
|
||||
| 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 |
|
||||
| Complete [amount] Policy branches | Fully complete at least [amount] policy branches |
|
||||
| Win diplomatic vote | At any point in the game win a diplomatic vote (UN). You may lose afterwards and still retain this milestone |
|
||||
| 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.
|
||||
|
||||
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"
|
||||
},
|
||||
],
|
||||
```
|
||||
|
||||
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|Width in world units of the [extraImage], height 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).|
|
||||
|
||||
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).
|
@ -1,4 +1,4 @@
|
||||
# Mods
|
||||
# 1 - Introduction to Mods
|
||||
|
||||
## What's this about?
|
||||
|
||||
@ -35,7 +35,7 @@ Mods are located in a `/mods` directory, on Desktop that should be next to your
|
||||
|
||||
Mods typically have 2 subfolders:
|
||||
|
||||
- `jsons` - here you should put files that alter the data of game objects, the order of the files is as in [the base json files](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons). More information on these can be found [here](JSON-files-for-mods.md)
|
||||
- `jsons` - here you should put files that alter the data of game objects, the order of the files is as in [the base json files](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons). More information on these can be found [here](Mod file structure/1-Overview.md)
|
||||
- `Images` - here you should put game images, as in [the base image files](/https://github.com/yairm210/Unciv/tree/master/android/Images). Please read [about atlases](#more-on-images-and-the-texture-atlas) for important details.
|
||||
|
||||
In order to remove objects from the game, you'll need to create a ModOptions file in the `/jsons` subfolder - there's an example [here](https://github.com/yairm210/Unciv-mod-example/blob/master/Removing%20Things/jsons/ModOptions.json)
|
||||
|
@ -150,7 +150,7 @@ These can be strung together with ", " between them, for example: `+2 Production
|
||||
|
||||
## technologyFilter
|
||||
|
||||
At the moment only implemented for [ModOptions.techsToRemove](../Other/Miscellaneous-JSON-files.md#modoptionsjson).
|
||||
At the moment only implemented for [ModOptions.techsToRemove](Mod file structure/5-Miscellaneous-JSON-files.md#modoptionsjson).
|
||||
|
||||
Allowed values are:
|
||||
|
||||
|
Reference in New Issue
Block a user