Technology template files use the JSON format and are put in simulation/data/technologies (see mod layout).

The technologies available to be researched from a building are defined by

  <Technologies datatype="tokens"> 

If a technology is required for training or building then use


The basic format is:

    "genericName": "Athenian Town Phase",
    "specificName": {
        "athen": "Kōmópolis"
    "cost": { "food": 100, "wood": 100, "stone": 0, "metal": 50 },
    "requirements": { "all": [{ "entity": { "class": "Town", "number": 4 } }, { "civ": "athen" }] },
    "requirementsTooltip": "Requires five village structures",
    "supersedes": "village_phase",
    "replaces": ["town_phase"],
    "icon": "town_phase.png",
    "researchTime": 10,
    "autoResearch": false,
    "tooltip": "Advance to Town Phase",
    "modifications": [
        { "value": "ResourceGatherer/Rates/food.grain", "multiply": 15, "affects": "Spearman" },
        { "value": "ResourceGatherer/Rates/food.meat", "multiply": 10 }
    "affects": ["Female", "CitizenSoldier Melee"]

specificName: The civ specific name will override the generic name if the player has that civ.

researchTime: This is the time it takes to research the technology in seconds.

supersedes: This is for techs which are in a sequence. The tech which it supercedes is a requirement (in addition to requirements). The GUI "stacks" the set of superceding icons so this tech will only be visible when the tech which it supercedes has been researched.

replaces: When a tech is meant to unlock the same features as a different tech, it can use the "replaces" key. In this case, town-phase buildings are unlocked by researching the phase_town, but as the Athenian faction has a separate town phase, it needs to tell this is a replacement for the regular town phase.

requirements: This defines what is required for the tech to be available for research. The available requirements are:

  • { "tech": "town_phase" } - This tech must be researched
  • { "civ": "rome" } - The player must be this civ
  • { "notciv": "pers" } - The player mustn't be this civ
  • { "entity": { "class": "Village", "number": 3 } } - this means that the player must own three entities with the class Village, i.e. three houses, or a farmstead and two outposts, etc.
  • { "entity": { "class": "Town", "numberOfTypes": 2 } } - this means that the player must own two different types of entity with the class Town, i.e. a blacksmith and a defense tower meet the requirement but two towers do not.
  • { "all": [{...}, {...}, ...] } - All of the requirements in the list must be met.
  • { "any": [{...}, {...}, ...] } - At least one of the requirements in the list must be met.

requirementsTooltip: A human readable version of the requirements to be displayed in the tooltip.

icon: Icons should be placed in art/textures/ui/session/portraits/technologies.

autoResearch: If this is true then the technology will be instantly researched with no cost when the requirements are met. This could be useful for complicated technology setups or for civ specific bonuses. This is an optional field and if set then cost, researchTime etc. are not needed because it is not user visible.

modifications: This is an array of modifications that the technology makes. A modification specific affects attribute is specific to this modification. The values to modify will be added on request. The available modifications are:

  • multiply - multiplies the original property value by this number.
  • add - adds this number to the property value. Can be negative.
  • replace - this replaces the existing value (useful if no original value exists). The ordering of multiple replaces is not defined.

Note that the code does no validity checking for the modification, the technology writer is responsible.

affects: A list of sets of classes which determine which entities are affected by the modification. So the example above will affect females and melee citizen soldiers. So all of the classes within a string are required and it will affect an entity which matches any of the strings.

Note that it is possible to add one extra affects string per modification line. This string will be used as extra condition to apply the affect. The above modification would apply to "spearman females" (which don't exist) and "spearman melee citizen soldiers".

Technology Pairs

A technology pair has a pair json file which is added to the list of tokens in ProductionQueue. It has the following format:

    "genericName": "Tech Pair",
    "top": "techA",
    "bottom": "techB",
    "supersedes": "anotherTechPair",
        "requirements": { "civ": "civA" }

Each of the technologies which are part of the pair should also have a "pair":"techPair" attribute linking them to the pair definition.

Last modified 7 years ago Last modified on Jan 10, 2017, 3:34:24 PM
Note: See TracWiki for help on using the wiki.