## Combat mechanicsEdit

This article discusses how combat damage and casualties are calculated.

### Basic Principles of CombatEdit

Each round:

- The damage from all troops in both armies is counted
- Damage is assigned among different troop types
- The number of casualties of each troop type are determined
- Regeneration and necromancy are calculated
- The round ends, and if there are troops left on both sides, the next round starts.

## Assigning damage among troop typesEdit

Understanding damage assignment is key to understanding how combat is resolved.

- Each damage type is calculated separately. So normal damage is applied, then fire damage, then cold damage.
- Damage is assigned to different units based on total unit upkeep as a proportion of their army. So if an army consists of 8 Axe Warriors (16 upkeep) and 2 Zeppelins (16 upkeep), then half of the attackers' damage will be resolved against the Axe Warriors, and half against the Zeppelins.
- If there were 16 Axe Warriors (32 upkeep) and 2 Zeppelins (16 upkeep), then the Axe Warriors would take 2/3 of the damage, and the Zeppelins 1/3.

- Casualties are determined by dividing damage dealt by base HP of the unit. So if a stack of Axe Warriors takes 120 damage, they lose (120 damage) / (100 hp) = 1.3 casualties. Damage rounds down - so that would kill one Axe Warrior.
- Resistances reduce the damage dealt.
- If our stack of Axe Warriors has 50% Normal resistance, and takes 120 damage, then the calculation is instead (120 damage) / (100 hp + 50% resist = 150 hp) = 0.8 casualties. So in this case, no Axe Warriors are killed.
- Resistance only applies to one damage type. If the same stack of Axe Warriors was instead hit by 120 Fire damage, and had no Fire resistance, they would take full damage and lose one Warrior.
- There is a difference between the way unit resistance (base unit value + upgrades) and hero resistance (from skills and equipment) are applied. Hero resistance appears to have a slightly higher effect. (verification needed - as I understand it the hero's resistance is simply added to the unit's resistance if any)
- Resistance also suffers from diminishing returns. this means the more you have the less the effect will be. This is most noticeable with 100 and 200 resistance. 100 resistance means 50% damage reduction whilst 200 resistance means only 66% damage reduction 900 resist means a 90% reduction of the damage. you can work this out as a HP boost with the following calculations (base HP + Unit HP upgrades)x ((100 + HP %) / 100) x ((100 + resistance) /100) this give you your units HP against a particular damage type.

### Multiple armies on one sideEdit

In alliance battles, there are usually multiple separate armies on each side. Damage assignment works exactly the same way, except that each stack of units controlled by a different player is treated differently.

So if player A sends in 10 Axe Warriors, and player B sends in 5 Axe Warriors, and they fight an opponent that does 120 damage to them

- Player A's Axe Warriors take 2/3 of the damage, or 80
- Player B's Axe Warriors take 1/3 of the damage, or 40
- Neither player loses any troops, even though if one player had sent in all 15, one would have died.

### 3-way combatEdit

Some battles involve three sides - typically two alliances and a neutral third party, such as a Temple or Fortress. In this case

- Each army treats all opposing army as 'enemies' and divides damage among all units in both their enemy armies as if they were all in a single army. So if army A has 1000 upkeep, army B has 1500 upkeep and army C has 500 upkeep, then
- Army A takes (1000/2500) = 40% of the damage dealt by army C, and (1000/1500) = 67% of the damage dealt by army B
- Army B takes (1500/2000) = 75% of the damage dealt by army A, and (1500/2500) = 60% of the damage dealt by army C
- Army C takes (500/2000) = 25% of the damage dealt by army A, and (500/1500) = 33% of the damage dealt by army B.

## RegenerationEdit

Courtesy of Tear:

- Z - real regeneration, applied SEPARATELY on each unit
- Y - unit amount alive in the beginning of the round
- X - dead units in the round
- R - regeneration rate stated/ written in the game (sum of all its sources, basic unit attributes, hero skill, artifacts, potion... ) - this is the number that is capped at 50% !

Z = R x √((Y-X)/Y)

### EXAMPLEEdit

- Y = 200 units enter the round
- X = 140 units die in the round
- R = 20 %

So...

- Z = 0,2 x √((200-140)/200)
- Z = 0,2 x √0,3
- Z = 0,2 x 0,548
- Z = 0,1095 = ca 11 %

So, each unit has its own separate 11 % chance to come to life again in the end of the round.

Technically, it can be 0 from 140 dead units, or 140 from 140, but the biggest chances are for ca 15 resurrected units.

For those more clever of you, who refuse to be involved in this kind of insanity, just remember this:

**The fewer units die from the overall amount, the better are their chances for regeneration.**

## NecromancyEdit

Necromancy is calculated as a proportion of (your) destroyed upkeep. So if you lose two Nightmares with 40 Upkeep each, 10% Necromancy will give you (2x40)*0.1 = 8 skeletons.

Necromancy is applied after Regeneration, so only really dead units will come back. Like Regeneration it's a % chance per unit, so if you fight three identical battles you should expect to get different Necromancy amounts on each.

**Tip** - if you're using Necromancy you're going to end up with a lot of Skeletons. Upgrade them! And avoid fighting against Frost Cannons, which do a flat damage bonus to each unit and are great for crowd controlling your undead horde.

## Magic damageEdit

Magic damage increases the power of spells and does not to armies. When an army is hit by a spell, magic damage is assigned the same way as combat damage, with the following exceptions.

- The army's Magic Resist scores are added to their elemental resistance when determining casualties.
- It's unclear whether Regeneration and Necromancy apply.
- It must be stated that magic damage and damage is not the same.
- Magic damage is for spells and damage is for armies.