Damage Formula

From TheReincarnation
Revision as of 10:24, 6 July 2016 by Machiavelli (talk | contribs)
Jump to: navigation, search

The battle simulator feature is a decent method for inquiring how much damage one unit will do to another, or which units will win in a certain matchup or arrangement, but for the sake of understanding the mechanics of the game and precisely calculating damage dealt from one stack to another, the damage formula is needed.


Damage Formula

UnitR_Losses = Number_of_UnitA * UnitA_attack_power * (accuracy/100) * UnitA_damage_modifier * UnitA_efficiency * (1 - (UnitR_resistance/100)) * UnitR_defensive_abilities / UnitR_hitpoints

  • UnitA is the attacking unit
  • UnitR is the unit receiving the attack
  • UnitA_attack_power may be modified by valor, berserk, battle spells, battle items, etc.
  • accuracy is Unit A's accuracy in attacking UnitR; base accuracy is 0.3 on defense and regular attacks and 0.2 on sieges, but often modified by Sun favor, accuracy-related unit abilities (fear, swift, beauty, marksmanship, clumsiness), enchantments, battle spells, heroes, etc.
  • UnitA_damage_modifier is typically a random number between 0.2 and 0.8, but the average of 0.5 is usually used
  • UnitR_resistance is the resistance of UnitR to the attack type of UnitA's attack; if there is more than one attack type (e.g. FIRE BREATH), the average of these attack types is used; often modified by battle spells, items, hero abilities (mind shield, ice shield, unholy aura), enchantments (Black Sabbath), and uniques
  • UnitR_Defensive_Abilities would be non-accuracy-related unit abilities like healing (0.7), scales (0.75), regeneration (0.8), charm (0.5), large shield (0.5 if UnitA's attack is ranged), weakness (2.0), etc., which would all be multiplied together

Alternate Version of Damage Formula

Alternatively, this calculation can be broken up into intermediate parts...

Attack = Number_of_UnitA * UnitA_attack_power * accuracy * UnitA_damage_modifier * UnitA_efficiency
Defend = UnitR_hitpoints / (1 - (UnitR_resistance/100))
UnitR_Losses = Attack/Defend

Examples

Regular Attack: 245 Water Elemental attacking Vampire

  • accuracy modifiers: 30% (standard accuracy in a regular attack) - 10% (swift) = 20%; therefore, accuracy/100 = 0.2
  • resistance modifiers: poison (75%), ranged (95%); (1 - (85/100)) = 0.15

Vampire_Losses = 245 * 400,000 * 0.2 * 0.5 * 1.0 * 0.15 * 0.5 / 4500 = 163.3 => 163 dead Vampire

Using the Damage Formula to your benefit

Using the damage formula, you can know how damage is calculated and therefore determine the easiest ways to increase it.

For example, the damage formula will demonstrate that getting a level 17 warlord, which will increase your damage on a siege by roughly 16% (assuming Sun favor and that some of your units won't suffer the siege attack's 10% accuracy penalty), is far better than getting a level 17 veteran whose level 9 valor increases damage by only 12% on primary attacks (if not less) and not at all on secondary attacks. This formula will also demonstrate that Sun favor's 3% accuracy is also slightly superior to Lucifer favor's 10% AP increase.

Perhaps most importantly, this formula will allow you to decide what battle spells and items you should be using. For example, using candle against 90% melee-resistant Titans will increase the damage done to them by Treant by 100%, whereas using Potion of Valor would produce much less significant gains. The same sorts of comparisons can be used when a green is deciding between using Rust Armor, Sword of Light, Flame Blade, or Eye of the Eagle, when a nether is deciding between Foul Water, Battle Lust, or Flame Blade, or when a Phantasm mage is deciding between Double Time or Sleep.

Damage-Soaking Formula

UnitR_Soaking_Ability = UnitR_hitpoints / (accuracy * (1 - (UnitR_resistance/100)) * UnitR_defensive_abilities * UnitR_netpower)

  • UnitR_defensive_abilities -- although it may seem counter-intuitive, this factor is on the bottom so that we can use the exact same coefficients as above, e.g. 0.5 for large shield (if UnitA's attack is ranged), 0.7 for healing, 2.0 for weakness, etc.; keep in mind that dividing by 0.5, like in the case of large shield or charm, is the same as multiplying the numerator (hitpoints) by 2


Using the equation above, which might be called the Damage-Soaking Formula, you can calculate how well certain units are at defending against various attacks.

For example, if you were an Ascendant mage attacking an verdant mage who was known to be using a heavy HE top with an eye+candle (+10% accuracy for HE, -10% resistances for attacker) defensive assignment, you'll have to decide between using an AA, unicorn, KT, dominion, djinni, or treant top, at which point you could compare their ability to take damage from the HE, which we'll assume to also have a 7% accuracy boost from Nature's Lore and a 3% boost from Sun favor.


Unicorn Ranged-Paralyze Soaking Ability = 2500 / (0.35 * 0.65 * 1 * 375) = 29.30
Archangel Ranged-Paralyze Soaking Ability = 5000 / (0.45 * 0.75 * 0.7 * 750) = 28.22
Knight Templar Ranged-Paralyze Soaking Ability = 375 / (0.5 * 0.925 * 0.5 * 60) = 27.03
Dominion Ranged-Paralyze Soaking Ability = 80000 / (0.45 * 0.25 * 0.7 * 39013) = 26.04
Djinni Ranged-Paralyze Soaking Ability = 7650 / (0.5 * 0.425 * 1 * 1700) = 21.18
Treant Ranged-Paralyze Soaking Ability = 4200 / (0.5 * 0.39 * 1 * 423) = 50.92


Unicorn Ranged-Lightning Soaking Ability = 2500 / (0.35 * 0.8 * 1 * 375) = 23.81
Archangel Ranged-Lightning Soaking Ability = 5000 / (0.45 * 0.4 * 0.7 * 750) = 52.91
Knight Templar Ranged-Lightning Soaking Ability = 375 / (0.5 * 0.925 * 0.5 * 60) = 27.03
Dominion Ranged-Lightning Soaking Ability = 80000 / (0.45 * 0.25 * 0.7 * 39013) = 26.04
Djinni Ranged-Lightning Soaking Ability = 7650 / (0.5 * 0.175 * 1 * 1700) = 51.43
Treant Ranged-Paralyze Soaking Ability = 4200 / (0.5 * 0.765 * 1 * 423) = 25.99


Dropping the clear losers, and now weighting them in respect to their the proportions of HE damage output, we have...
Archangel Soaking Ability = 28.22 * (13/20.5) + 52.91 * (7.5/20.5) = 37.25
Djinni Soaking Ability = 21.18 * (13/20.5) + 51.43 * (7.5/20.5) = 32.25
Treant Soaking Ability = 50.92 * (13/20.5) + 25.99 * (7.5/20.5) = 41.80


Usually there will only be 2 or 3 candidates to calculate, and usually the calculations won't be nearly this complicated (lots of accuracy bonuses, candle, two attacks with two attack types each... yuck!), so this was a pretty ridiculous example. That said, clearly treants are the winners here!

When running these calculations, keep in mind that results over 100 should be considered "excellent," results over 65 should be considered "good," and results over 40 should be considered "decent." A result under 30 is quite bad, but it may be inevitable if your opponent is a green using heavy HE + eye/candle, a red using heavy RD/chims + stun/oil, or any other stacking that yields high damage output.