Difference between revisions of "Damage Formula"

From TheReincarnation
Jump to: navigation, search
(Damage Formula)
Line 9: Line 9:
 
*'''UnitA''' is the attacking unit
 
*'''UnitA''' is the attacking unit
 
*'''UnitR''' is the unit receiving the attack
 
*'''UnitR''' is the unit receiving the attack
*'''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 (warlord, enchantress, dread knight, witch), 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
 
*'''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|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_resistance''' is the resistance of UnitR to the [[Attack Type|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

Revision as of 00:21, 6 July 2016

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
  • 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), 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