Game data is stored in several large JSON files. The structure is described briefly here.
User-visible text in several different languages is stored in files named BattleNations_*.json. When Z2 makes an incremental update to the game, they often put new text in Delta_*.json to reduce the size of the download.
Statistics for combat units are stored in BattleUnits.json. Some of the interesting fields of the unit object are as follows.
| ||0=None, 1=Partial, 2=Blocking|
| ||Building level required. Check buildings to see which one trains this unit.|
| ||Training time in seconds|
| ||Cost to train unit|
| ||Cost to heal unit|
| ||Healing time in seconds|
| ||Unit image file name, usually without .png extension|
| ||Key used to look up unit name from BattleNations_en.json|
| ||Prerequisites such as player level, buildings, and missions; see below|
| ||Key used to look up shortened unit name|
| ||Player, Hostile, Neutral, Hero, Villain, etc.|
| ||Array of unit ranks; see below|
| ||Cold, Stun, etc.|
| ||Array of unit tags like Soldier, Vehicle, etc.|
| ||Unit weapons information; see below|
stats array contains statistics that change as the unit gains ranks. Useful fields are:
There are often various requirements that must be met before a unit can be trained. These are stored in a list of prereq objects, each of which has a type
_t and other data. Here are some of the possible types.
| || Minimum player |
| || Must complete |
| || Must have the building with ID |
| || |
| ||A limited-time offer or event defined by the game server.|
Unit attacks are somewhat complicated. Each unit has a list of
weapons, and each weapon has a list of
abilities. Ability statistics are stored in a separate file, BattleAbilities.json. Unit rank, weapon, and ability statistics are combined to produce the attack stats, as follows:
mindmg = (floor(weapon.base_damage_min * ability.damageFromWeapon) + ability.damage) * (1 + (rank.power * ability.damageFromUnit * 0.02)) maxdmg = (floor(weapon.base_damage_max * ability.damageFromWeapon) + ability.damage) * (1 + (rank.power * ability.damageFromUnit * 0.02)) crit = (weapon.base_critPercent * ability.critFromWeapon) + ability.criticalHitPercent + (rank.critical * ability.critFromUnit) + ability.criticalBonuses[target_type] offense = (weapon.base_ATK * ability.attackFromWeapon) + ability.attack + (rank.accuracy * ability.attackFromUnit) minrange = ability.minRange maxrange = ability.maxRange + weapon.rangeBonus
Fractions are rounded down. A crit value of 5% is considered "normal"; the game does not display crit in the unit attack window if it is equal to 5%.
Other useful fields in the weapon object are:
| ||Ammunition available before reload|
| ||Key used to look up weapon name from BattleNations_en.json|
| ||Number of turns to reload|
All abilities on a weapon share the same ammo pool.
Other useful fields in the ability object are:
| ||Number of turns before this attack can be reused|
| ||Ammo used per attack|
| ||Armor piercing|
| ||front or back|
| || Number of attacks; see also |
| ||Prep time|
| ||Suppression multiplier|
| ||Suppression bonus damage|
| ||Array of damage types|
| ||Turns before this weapon can be used again|
| ||Attack icon file name|
| ||0=Contact, 1=Direct, 2=Precise, 3=Indirect|
| ||Maximum range|
| ||Penalty to when target is at range|
| ||Target's won't be lowered below this percentage|
| ||Minimum range|
| ||Key used to look up ability name|
| ||Prereqs and costs to research this attack|
| || Number of shots; see also |
| ||Status effects such as . The keys reference StatusEffectsConfig.json, and the values give the percentage chance.|
| ||Air, Ground, etc.|
| ||Multiple of the base damage applied by the DoT|
| ||Damage caused by environmental DoT effects|
| ||Damage type|
| ||True if damage diminishes with time|
| ||Armor piercing|
| ||Duration of the effect|
| || Which immunity defends against this effect (|
| ||Armor damage modifiers that apply while the effect is active|
| ||True if unit is unable to attack|
| ||True if unit's defense is reduced|
| ||True if taking damage ends the effect|
| ||Damage modifiers (example: 1.5x damage while frozen)|
| || |
Building information is in Compositions.json. Each building has a set of
componentConfigs, many of which are optional.
StructureMenu block contains the building's
cost to build.
Construction contains the
Building size on the map is described by the
Placeable block, which gives the building's
height, and tells whether it
Sellable contains the sell price.
Houses make a
contribution to the player's
RequireWorkers. The number needed while the building is in operation is
workers. Some buildings
canToggle on and off. They need
minWorkers for upkeep while they are turned off.
Assistance gives the
rewards for assisting another player's building. There is an
interactionLimit to how many times a given building can be assisted per day.
BattleReward gives the reward for raiding the building. The occupy reward is 3.8 times the raid reward, rounded up.
Some buildings can be upgraded. They have a
BuildingUpgrade block which contains a list of
levels. Each level has an
upgradeTime. There are several other fields in this block that influence the operation of the building, as explained below.
Taxes block describes buildings that automatically produce output on a certain schedule, such as houses, orchards, and the Supply Drop. It contains a
paymentInterval, which gives the time in minutes (unlike most other times in the game files). The production output is given by
ResourceProducer buildings such as the Stone Quarry and Iron Mine generate output constantly, without the need for user interaction. The resource is identified by
outputType, and it is produced at the given
outputRate per hour, multiplied by the
output percentage from
JobList contains a list of
jobs that can be made by shops, farms, ranches, and mills. This includes both regular goods and quest-related items. The
demandCategory is unreliable, so consult Economy.json to be sure. Only the job identifiers are stored in Buildings.json; the full information is in JobInfo.json. The
cost is multiplied by the
input percentage from
BuildingUpgrade, and the
rewards are multiplied by
buildTime is in seconds, as usual.
Hospitals and repair bays contain a
Healing block, which contains the messages displayed by certain actions.
BuildingUpgrade section has a number of important fields for healing buildings. The
maximumHealingQueueSize tells how many units can be waiting for treatment (not counting the one currently being healed). Costs are multiplied by the
input percentage, and time required is multiplied by
ProjectList contains a list of units that the building can train. The level of the building required to train a unit is found in that unit's
buildingLevel field, and the player level is in the
prereq structure. Some units have a
visibilityPrereq, and won't show up in the in-game build list until a certain condition is met (such as an active promotional offer).
DefenseStructure has information about structures that can participate in battles, including their
repairTime. The combat statistics are in the BattleUnits.json file, identified by
Garrison buildings have a
Some decorations give a bonus to nearby buildings. The
RadialMod block gives the
stats that are affected and the
radius of the buff. The
tags field gives a list of building types that receive the bonus.
There is usually a limit to the number of bonuses a building can receive. The
maxModStack tells the maximum number of decors of exactly the same type that can affect a single building (only 3 Moats can stack modifiers, for example). In other cases, several different decorations may be in the same
modCategory. For example, a Farm can't get bonuses from both a Water Tower and Concrete Reservoir, because they are both in the Irrigation category. Bonus categories are defined in RadialMod.json.
Buildings that can be buffed have a
RadialModBuffable block that tells which
tags they repond to.