[General] Damage, Armor calculations

Status
Not open for further replies.
Level 3
Joined
Aug 27, 2019
Messages
44
Calculating damage is very complicated because there are ton on modifiers in WC3 system.

Is there some tutorial that covers all things that affect to damage calculations?

My Footman has at least 3 things that affect damage before armor.

Attacker:
Combat - Attack 1 damage - Damage base 11
Combat - Attack 1 damage - Damage number of dice 1
Combat - Attack 1 damage - Damage side per die 2

I did some testing against unit with following stats

Defender:
Combat - Defense base - 0
Combat - Defense type - Large

Tooltip show 12-13 damage

Actually did 11 or 12 damage. I cant figure where that 1 extra damage comes from.

Need help with damage calculations. I really wish to understand fundamentals behind this.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
Footman attack = 11 (base) + 1 (number of dice) to 11 (base) + 1 (number of dice) * 2 (sides per die)
= 11 + 1 to 11 + 1 * 2
= 12 to 13.

Note that due to how multiple dice work the probability distribution of the damage is not constant across the numerical range if the number of dice and sides per dice is larger than 1. Instead it will be some Gaussian distribution around the average of the range.

Assuming no damage against armor type reductions then the 11 or 12 damage rather than 12 or 13 can be explained by floating point error or unit life regeneration. Unit life is a 32bit floating point, and hence fraction of life exist. Instead of dealing 12 damage it might deal 11.9999995 (made up example) damage due to floating point error. Like wise if the unit has any sort of life regeneration it might near instantly recover 0.0000005 health and so no longer be missing 12 or 13 whole life.

When defence amount reduction is applied it can at most lower damage to 1, which will happen at some insanely large armor amount. This is applied before damage and defence type and so the minimum 1 damage limit can be modified by those.
 
Level 3
Joined
Aug 27, 2019
Messages
44
Thank you doctor!

Does this work same way as dungeons & dragons combat dices?

If I want to have unit with damage 2d6 + 3 can I do it like this?

Damage base 3
Damage number of dice 2
Damage side per die 6

EDIT:

Tested 2d6 + 3 idea, result is 5-15 damage.

2d6 = 2 - 12
+3
= 5 - 15
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
If I want to have unit with damage 2d6 + 3 can I do it like this?
Probably seeing how the RPG mechanics of WC3 were likely inspired by DnD.

There are two reasons to use multiple dies.
  1. One of the upgrade fields allows one to increase damage in number of die.
  2. More die create a better gaussian probability distribution. This means that statistically the damage dealt will vary less often from the average.
Generally in modern RTS design such randomness is avoided. For example in StarCraft II all damage amounts are fixed and so effectively a single dice with only 1 side.
 
Status
Not open for further replies.
Top