Damage calculations

*warning: these are not officially confirmed equations, but found experimentally by fans (namely: Nebs, Sfidanza, Pitsu and some others (feel free to complain if your name should be added))*

damage done by creatures

A. In case the attackers attack skill is higher than (or equal to) defenders defense:

Damage = trunc(creature damage value * stack size * (1 + 0,05 * (attack-defense)) * (1 + attack boosters) * (1 – defense boosters))

Command “trunc” means that the decimal places are ignored. 15,999 is truncated to integer 15.

That means, each additional point in attack vs defense difference increases the damage by 5% (linear regression). Equation holds true at least to attack-defense difference 39. From the game code one can read that maximal increase is 3 fold (attack-defense differences beyond 60 do not give a bonus anymore)

B. In case attackers attack is lower than defenders defense value

Damage = trunc(creature damage value * stack size * (1 - (defense-attack) / (20+defense-attack)) * (1 + attack boosters) * (1 - defence boosters))

This means that the first point of difference gives 5% damage reduction. Each following point gives less (nonlinear regression type 1-x/(A+x)). This equation seems to give correct values up to defense-attack difference 50. From the game code one can read that the maximum reduction is down to 10% of the original unmodified damage left.

Example:
59 pixies with attack 1 and damage 1-2 attack treants with defense (hero and defend command bonus included) 51.
Damage min = 59*1 * (1 -50/(20+50))=16.85.. i.e 16
Damage max = 59 * 2 *(1-50/(20+50))=33.71.. i.e 33 (note, 33 is not twice the minimum damage 16)

Example 2:
25 unicorns with damage range 10-20 fight against wights under a hero with advanced defense skill. Wight defense is 11 points higher than unicorns attack.
Damage min = 25*10*(1-11/31)*(1-0.2(adv. def gives 20% bonus))= 129.03 i.e. 129
Damage max =25*20*(1-11/31)*(1-0.2)= 258.06 i.e. 258

Hero damage

Hero default damage depends on hero level, target creature level and can be affected by some hero skills abilities.

creature level A level 1 hero kills (K1) A level 31 hero kills (K31)
1212
219
30,86,5
40,54,5
50,33
60,22
70,11,5

The damage depends linearly on hero level and can be calculated:

Damage = trunc{ hit points * [K1 + (K31-K1)/30 * (Hero level – 1)] – 0,01}

As for elemental damage calculation, there is occasionally 1 point difference from the damage shown in game.

Rangers “Deadeye shot” ability adds 3 virtual levels to the hero. Thus a ranger can deal more damage than other heroes at identical levels. Additionally, campaign maps may contain scripts that boost certain hero or hero class.

Elemental bonus damage.

Damage bonus depends on the level of irresistible magic skill and presence of primal altar buildings in your towns.

Basic IM 5% bonus damage
Advanced IM 10 %
Expert IM 15 %

Each altar of primal elements adds 10 % cumulatively.

Bonus damage = base damage * (0,05 * IM skill level + 0,1 * number of altars)

The result is truncated to integer (decimals are ignored and 15.99 means 15 damage)
Note: for spells I occasionally get 1 point less bonus damage than the equation gives. Thus, there may be something missing here.

Elemental damage is not affected by resistances and immunities. But the base damage is. For example when hitting golems and gremlins with circle of winter, golems take less elemental damage, due to resisting the original spell.

In combat log the bonus damage is listed first and then the total (base+bonus) is given.

Example
Good luck shines to black dragons and they deal 14429 damage. The hero is expert in irresistible magic and there are 3 towns with the primal altar built.
Bonus elemental damage = 14429 * (0.05 * 3 + 0.1 * 3 ) = 6493

Spell Power of Caster Creatures

The size of a stack and its spell power are in logarithmic relationship. The following equation should give correct values in a vast majority of cases.

SP = trunc(9,12 * ln (1+ size/growth)) – 1

If the equation gives a value below 1, SP is set to 1, since it cannot be lower.

The creatures who have a spell or ability depending on spell power are as follows:
(link to be added)

Damage of Moat and Towers in Siege

A moat is added to defensive structures when citadel is build (town level 10 earliest). The central tower is added at the same time. Two more towers are added with the castle building (town level 13 or 16 earliest). The damage done by all these structures is a linear function of town level. Upgrading citadel to castle does not improve the moat or central tower damage (beside +1 to town level). Different towns, however, have different damages and different effects. Common rules are that the moat damage is dealt in the end of a creatures turn (a creature in moat takes damage only if it does not leave the moat) and moat/towers damage is not a subject for damage reduction or increase by hero skills and abilities

Damage = trunc ( K * town level)

K values are listed below.

townmoatmain towersude towersmoat effect
academy9,4481,951,39damage per mine, mines disappear after activation, casts blind for 1,25 turns
inferno5,661,951,39
haven4,7231,951,39
necropolis4,7231,951,39casts advanced weakness for 5 turns, casts vulnerability
dungeon4,591,891,3528 damage poison for three actions
sylvan4,4751,841,315a chance to entangle for 5 turns, may renew during these 5 turns waiting.

Please login to view comments.