Game Files/JSON

Game data is stored in several large files. The structure is described briefly here.

Text
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.

Units
Statistics for combat units are stored in BattleUnits.json. Some of the interesting fields of the unit object are as follows.

Ranks
The  array contains statistics that change as the unit gains ranks. Useful fields are:

Prerequisites
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  and other data. Here are some of the possible types.

Attacks
Unit attacks are somewhat complicated. Each unit has a list of, and each weapon has a list of. 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: All abilities on a weapon share the same ammo pool.

Other useful fields in the ability object are:

Status Effects
Status effects like Stun and Poison are described in the file StatusEffectsConfig.json.

Buildings
Building information is in Compositions.json. Each building has a set of, many of which are optional.

The  block contains the building's ,  ,  , and   to build. contains the.

Building size on the map is described by the  block, which gives the building's   and , and tells whether it.

contains the sell price.

Population
Houses make a  to the player's.

Many buildings. The number needed while the building is in operation is. Some buildings  on and off. They need  for upkeep while they are turned off.

Rewards
gives the  for assisting another player's building. There is an  to how many times a given building can be assisted per day.

gives the reward for raiding the building. The occupy reward is 3.8 times the raid reward, rounded up.

Upgrades
Some buildings can be upgraded. They have a  block which contains a list of. Each level has an  and. There are several other fields in this block that influence the operation of the building, as explained below.

Production
The  block describes buildings that automatically produce output on a certain schedule, such as houses, orchards, and the Supply Drop. It contains a, which gives the time in minutes (unlike most other times in the game files). The production output is given by.

Houses can be upgraded to increase the revenue generated. The produced is multiplied by the   percentage from the   section, and  is multiplied by.

buildings such as the Stone Quarry and Iron Mine generate output constantly, without the need for user interaction. The resource is identified by, and it is produced at the given   per hour, multiplied by the   percentage from.

contains a list of  that can be made by shops, farms, ranches, and mills. This includes both regular goods and quest-related items. The  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  is multiplied by the   percentage from , and the   are multiplied by. The  is in seconds, as usual.

Healing
Hospitals and repair bays contain a  block, which contains the messages displayed by certain actions.

The  section has a number of important fields for healing buildings. The  tells how many units can be waiting for treatment (not counting the one currently being healed). Costs are multiplied by the  percentage, and time required is multiplied by.

Training
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  field, and the player level is in the   structure. Some units have a, and won't show up in the in-game build list until a certain condition is met (such as an active promotional offer).

Defense
has information about structures that can participate in battles, including their  and. The combat statistics are in the BattleUnits.json file, identified by.

buildings have a  and.

Bonus Decor
Some decorations give a bonus to nearby buildings. The  block gives the   that are affected and the   of the buff. The  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  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. 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  block that tells which   they repond to.