• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Defense Damage Reduction Calculation

Status
Not open for further replies.
Level 10
Joined
Sep 3, 2009
Messages
458
Damage Calculation Formula Need Ideas!

Hello Everyone!

I'm making a system for my map.

That does this . . .

When I cast a spell or damage a unit it will calculate how much damage is reduced depending on the units defense.

Example:

Physical Spell - Deals 100 damage

Targets Defense is - 50

The final damage is - ???

My problem is in the final damage. I cant think of a formula on how much damage to reduce depending on the defense of a unit.

This system is independent on Warcrafts armor reduction.

So any suggestions?

Please and thank you!

P.S. I really don't know if this is the place to ask so pardon me ._. or better yet tell me where to ask these kinds of questions

EDIT: Forgot to put the stats I'll be using . . .

Strength - Affects Physical Damage

Magic - Affects Magical Damage

Defense - Affects Physical Damage Reduction

Critical % - Affects the chance to do a Critical Damage

Critical Bonus - Affects the damage added when a Critical happens

This'll be the genral stats I'll be using.
 
Last edited:
Level 8
Joined
Apr 8, 2009
Messages
499
My problem is in the final damage. I cant think of a formula on how much damage to reduce depending on the defense of a unit.

This system is independent on Warcrafts armor reduction.

so you don't use the standard Wc3 dmg reduction? can't see why not...


Formulas for dmg reduction:

1.
Attack Damage - Armor = Damage Dealt

100 damage - 25 armor = 75 damage dealt

Cons:
-I wonder what happens when the amount of armor is greater than Attack damage... negative damage does what?





2.
Take a maximum amount of armor, double it or add a lot of armor to it, save it as integer.
take units current armor and calculate the amount of % it is with previous saved integer.
reduce damage by that x% amount calculated.


max armor = 100, units armor is 30. 30/100 = 30% damage reducted.
Attack damage = 100, -30% = 70 Damage Dealt.


Cons:
-Could end up reducing the damage by either a ridiculously huge or small amount.



The above ideas are quite simple and easy to manage, can't think of any usefull formulas at the moment, hope these will be sufficient.



Having so much fun colorizing my posts~
 
Status
Not open for further replies.
Top