This page describes the mechanics by which damage is calculated in combat.
Total_Attack = unit_attack * unit_amount * unit_amount_mod * unit_vs_unit_mod * morale_mod * direction_mod * territory_mod * random_mod
Total_Attack and defense are then used to determine the final damage. The exact function is yet unknown, although some approximations are listed below. Note that damage numbers are displayed as integers, but they can in fact be fractions as well.
unit_attack is equal to the listed attack in the unit description + bonuses from research + bonuses from equipped hero gear.
Unit vs Unit modifiersEdit
unit_vs_unit_mod is determined by the following table:
morale_mod = (morale + 100) / 200
direction_mod = 1 if attacking from the front, 1.1 if attacking from the side, 1.2 if attacking from behind. This applies to ranged attacks as well.
Units deal less average damage per unit in large stacks than they do in smaller stacks.
Unit_amount is equal to the amount of units in a stack. An approximation for unit_amount_mod is:
unit_amount_mod = 31.49(unit amount)^(-0.14)
A few examples for unit_amount_mod values:
1 unit = 100% damage per unit (base)
10 units = 72% damage per unit.
80 units = 53% damage per unit.
200 units = 46.5% damage per unit.
400 units = 42% damage per unit.
500 units = 40.3% damage per unit.
600 units = 39.5% damage per unit.
territory_mod is equal to 1 if the player has less than 100 territory, 1.01 if the player has more than 100 territory, 1.05 if the player has more than 300 territory, and 1.1 if the player has more than 1000 territory. The territory mod is also applied to the player's defense value of his units. territory_mod is always equal to 1 for Hero units.
Each attack can deal one of ten different damage values, determined randomly. 0.95 <= random_mod <= 1.04
Defense effect approximationsEdit
The exact mechanism by which defense affects the final attack value to determine damage done is currently unknown. These are approximations:
Heroes vs Units & Units vs Units: Damage = Total_attack / (1 + 0.006 * target_defense)
Heroes vs Heroes:
Damage = Total_attack / (1.27 + 0.003 * target_defense)
Units VS Heroes: Damage = Total_attack / (17.23 + 0.004 * target_defense)
Note that defense of non-hero units is increased by territory_mod.
Updated Formula Edit
(the above formulas were tested and did not give an accurate estimate of actual damage)
Here are approximations that I have formulated using data collected in-game
Hero vs Hero : Damage = total_attack / (1.14 + 0.00011*target_defense)