Effective health

Effective Health (EH) is the mathematical concept of the actual health of a unit or structure, after modifiers for damage and health are considered. Effective health is calculated with the formula: h : Defender basic health. h′ : Defender new health (basic health + modifiers directly altering health). d : Attacker basic damage. d′ : Attacker new damage (basic damage + modifiers directly altering damage). EH = h * (h′ / h) * (d / d′)

This simplifies to: EH = h′ * d / d′ Or in English: effective health is (new health) times (old damage) divided by (new damage).

Examples
Consider situation A:


 * Attacker base damage is 10.
 * Defender base health is 100.

In situation A, there are no damage modifiers, therefore the defender's effective health = 100 * 10 / 10 = 100, the same as base health. The defender survives 10 hits from the attacker.

Now consider situation B:


 * Attacker base damage is 10.
 * Attacker has 1 weapon upgrade, increasing damage by 1.
 * Defender base health is 100.
 * Defender has 3 armor upgrades, reducing damage by 3.

In situation B, new damage = 10 + 1 - 3 = 8, and the defender's effective health = 100 * 10 / 8 = 125.

In situation B, the defender effectively has 25% more health than in situation A, and will therefore last approximately 25% longer (there is a slight rounding due to overkill on the final attack).

Damage Modifiers in StarCraft 2
In Starcraft 2, damage modifiers for d′ are calculated in the following order :
 * 1) Attacker damage tech upgrades.
 * 2) Defender armor OR shield tech upgrades (shield upgrades if the unit has >= 1 active shield strength, otherwise armor upgrades are considered ).
 * 3) Hardened shields.
 * 4) Guardian shield.