# Calculating damage reduction of armor parts

I am currently implementing a turn-based puzzle/RPG game.
The situation now is the following: The player can have up to 4 armor parts: Helmet, Gloves, Trousers and upper-body-armor.
I actually planned to calculate the damage reduction like this:
ActualDamage = Damage*(1-helmetReduction-gloveReduction-trousersReduction-upperArmorReduction)

But I see some problems with that: If the player collects 4 armor parts with, let's say 0.3, 0.4, 0.2, 0.1 reduction, then the damage will be removed completely.
This is not what I want to achieve.
So I am no looking for a way to consider all armor parts, but have a different formular for calculating then together.
I know a way would be to have an upper limit of damage reduction, but that seems like a dirty hack for me.

I know there are games which already do this (e.g. Diablo 3). In Diablo 3 all armor parts add to the global toughness value which then seems to reduce the damage.
How could such a thing be done for example?

Edit:
To clarify: I am acutally looking for a way/formula which takes every armor piece into account and gives an overall damage reduction value, which is, in every case < 100%.

• Do I understand correctly you are looking for 1) combine a couple of armor pieces into one single value? And 2) never prevent 100% of damage? Commented Jul 19, 2015 at 14:18
• Yes, this is exactly what I want to do. Easiest way would be to iterate over all armor piece and add their reduction values together. But that could result in preventing the whole damage, which I do not want. Commented Jul 19, 2015 at 14:37

You could reduce the damage for each piece individually. That way you never reach 0 unless a piece reduces it by 100%. You can get very low though.

You could also make the different pieces never total 100%.

• Helmet max 15%
• torso max 20%
• arms max 10%
• legs max 10%

Max damage resistance would be 55% like that.

You could also go with a much more refined system as complicated as you want. I like this system:

• Attacker will do 100 damage.
• Defender has 50 armor
• damageMultiplier = damage / (damage + armor)
• finalDamage = damage * damageMultiplier

In this case the multiplier will be .66. So a total of 34% will be absorbed. Let's hava a look at a extreme example.

damage = 100;
armor = 1000;
damageMultiplier = damage / ( damage + armor); // .09
totalDamage = damage * damageMultiplier; // 9 damage, 91 damage absorbed by a whooping 1000 armor.


This is a fairly simple system. It also allows you to work magic on the damage and armor. Add bonuses and multiply it by the players strength and if you do this formula last you will always be good.

• I accepted this answer, because I like the second technique you describe really much. The first part you describe, making sure every combination would be below 100%, was actually what I do not want to do (I also wrote that). But the second part seems to me to be a really good solution, as it does not force to have a hardcoded cap or to make sure every combination stays below 100%. Also it allows to use additional stats. Commented Jul 19, 2015 at 19:11

Think ease of use.

You always have to start with what you want to achieve first.

And it can all be made simple - I want the weakest unit to kill the weakest player with 20 hits. I want the strongest unit to kill the strongest player with 10 hits. The rest is just curving the increments between them.

You can build any game on these two considerations alone. Anything else is just style.

Chasing individual numbers on individual pieces, without a good overall concept results in those games where you get so beefed up, nothing is a threat to your shiny armor, and any monster is just a tedium waiting to happen - a formality that you have to resolve by clicking on it to kill it.

E.G.

Think of your maximum reduction - then you always know what the max possible is. Then spread your reduction among your sources. These numbers almost fall in place themselves if you have the starting concept clear.

If you know 50% dr is the max you can have. You can easily split that between the sources. Say 50% (25%) to the armor, 15%(7.5%) to boots, 35%(17.5) to helmet. Round one up the other one down if you want to lose the decimals.

And group things, damage - or * (armor set 1) .... (armor set = the pieces) Its way easy to have configs that work with group attributes.

Now... people usually go for % multipliers because its easy. Slapping 50% damage reduction on something guarantees you get the same result even if you do 10 damage or 904004 damage. And its an easy shortcut in the original concept, put the good gear on - you die in 20 hits, take it off you die in 10.

If you really want to toy with damage reduction however you simply subtract damage and give flat damage reduction. You can scale it a lot better, and its portrayed more meaningfully to the player. If you ignore functionality - people would usually like to have 50'000 damage reduction as opposed to 50%. Then a guy can boast having 10'000 more than the other guy - instead of 0.7 percent.

Most designers don't bother and just slap some numbers to get along with the ride. Blizzard is known for actually planning ahead for their dps outputs. And that is much better seen in diablo 2 rather than 3. Even though diablo 2 has a bunch of useless modifiers the low end and the high end are done very comfortably.

If you can plan your dps scale. You can know your weakest unit will never be too weak, and your strongest unit will never be too strong.

Diablo 3 failed massively on damage progression when it first came out - it don't know how it is now but progression was horrid, the developing player hit a rock solid wall, they were unable to penetrate without being stuck in boring no challenge land for a long time. Whereas in diablo 2 you could get in the challenge areas and do some damage, but anything there could kill you in a couple of easy hits - so your play focused on controlling the field so you can soak your attackers with damage, without giving them much room to retaliate. That allows people who want a challenge, to try it. Everybody else who don't want hardship can always go back to the lower/safer/easier areas and re-grind - but being unable to challenge harder mobs due to the brick wall scaling of difficulty injects massive boredom into gameplay.

Few people really ever understand damage is all about pacing and threat.

ActualDamage = Damage*(0.99^Armor)

This gives a diminishing return. With any amount of armor, the 1st armor reduces damage by 1% and each subsequent armor only reduces damage by 1% OF THE REMAINING damage.

With this method, when you have 0 armor you take full damage, but no matter how much armor you have, you will never reach 100% damage reduction.

I think you will find this method very elegant and easy to implement. It scales infinitely because you can have millions of armor and still take damage against mobs that deal adequate damage.

You'll need to create some way to control the damage passing through.

For example: light armor has a maximum reduction of 75%, medium 85% and heavy 95%. If the total reduction combined is above the number, use that value instead.

You could also create a weighed reduction: say the player wears one heavy, two medium and one light piece of armor: (95+85+85+75)/4 =85% maximum redudtion.

Thus if the player's combined armor is below 85%, the player's armor is used, otherwise it is capped at 85%.

Don't have the damage reduction be additive, have it multiplicative.

Damage = Damage *
(1.0 - helmetReduction) *
(1.0 - gloveReduction) *
(1.0 - trousersReduction) *
(1.0 - upperArmorReduction)


Each layer of armor reduces not the complete damage, but the damage remaining from the previous layer. As long as no single layer reaches 1.0, you will always have a bit of rest damage. You can also scale this system upwards and add additional armor slots later without breaking anything.

• this is "the answer": simple and elegant Commented Jul 21, 2015 at 6:28

I think it would make the most sense to use percentage based reduction, if you don't want to remove damage entirely.

For example different pieces could provide different percentages of damage reduction:

• Helmet - 5%
• Gloves - 5%
• Chest - 15%
• Legs - 10%

Total reduction = 35%

Then for example if your character is hit for 40 points of damage you would do the following:

40 - ((40 / 100) * 35)


This gives you the damage value of 26 that your character would take

Edit: having read the comments of the Op. There will have to be a hard cap on the percentage avoidance if he wants to avoid 100%. The other way to do this would have a maximum avoidance for each type of armor that does not add up to 100%.

As it is also not described how these armor prices come to be. If they are pre determined values then it would be trivial to make sure they don't add up to 100%. If they are randomly generated simply put a cap on the maximum for each type.

• Actually this is exactly what I described and what I do not want to achieve. With the values you showed, it would work. But I want to make sure that not 100% of damage is reduced, no matter which armor pieces are combined. Commented Jul 19, 2015 at 14:38
• In that case you'll need to create some way to control the damage passing through. For example: light armor has a maximum reduction of 75%, medium 85% and heavy 95%. If the total reduction combined is above the number, use that value instead? You could also create a weighed reduction: say the player wears one heavy, two medium and one light piece of armor: (95+85+85+75)/4 =85% maximum redudtion. Thus if the player's combined armor is below 85%, the player's armor is used, otherwise it is capped at 85%. Would that work for you? Commented Jul 19, 2015 at 14:44
• The armor/damage system is not planned to be that complex that you would need distinction between light/heavy/medium armor. But I like the idea of weighting the reduction really much. Could you write this as an answer please, so I can accept it? Commented Jul 19, 2015 at 14:54

I was having the same issues, but after getting sleep, i figured out a method that may work, the way I'm doing it is armor rating that can increase infinitely, monsters damage will always increase as well,

So as for damage reduction i came up with this

For every 5 AR will give +1 to damage reduction divider If the damage that is being dealt to you would be equal or less to your AR it would be divided by said divider value, if damage is higher, the difference would then be included with the divider

Example: AR: 24 (since 5 only goes into 24 4 times, the divider is 4) Vs Damage: 36 (the difference is 12, so the remainder is 24)

Divide the AR by the divider and add it to the difference

24/4 = 6 + 12 = 18 damage taken out of 36

• Interesting. So armor gives 80% reduction, but only up to a certain amount of incoming damage. That damage ceiling is determined by how much armor you have. What you have is ActualDamage = Damage - INTEGER( Armor / 5 ). This actually gives the player tremendous incentive to monitor the incoming damage carefully. Commented Feb 9, 2019 at 5:28