• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Remove Diminishing Returns from Armor

Status
Not open for further replies.
Level 12
Joined
Nov 3, 2013
Messages
989
Normal wc3 armor/defense have diminishing returns
1 armor -> 6% dmg migitation
2 armor -> 11% dmg migitation

Can it be changed to something like armor in SC2 where 1 armor blocks 1 dmg?

Edit: Just removing the diminishing returns and have a linear multiplier could also be considered.
 
Level 26
Joined
Sep 26, 2009
Messages
2,427
I don't think so, because the damage taken calculation is made using one equation. I don't think you can change that.

However what you could do is maybe set armor to absorb no damage and then via DDS decrease it. It would imo require a list of units and their armor value or something.
 
Level 12
Joined
Nov 3, 2013
Messages
989
I don't think so, because the damage taken calculation is made using one equation. I don't think you can change that.

However what you could do is maybe set armor to absorb no damage and then via DDS decrease it. It would imo require a list of units and their armor value or something.

I would have to use a list of Unit Type and spam if else to find out their armor?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
You could just use a damage detection system, on damage event set damage = (damage / (1-armorReduction)) - armor
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Normal wc3 armor/defense have diminishing returns
1 armor -> 6% dmg migitation
2 armor -> 11% dmg migitation

There is no diminishing returns here, thats a common misconception.
Every point of armor adds the same amount of EHP (Effective Hitpoints)

However if you want a system where 1 armor blocks exactly 1 damage and so on, you have to use a DDS or code it yourself.
 
Level 12
Joined
Nov 3, 2013
Messages
989
There is no diminishing returns here, thats a common misconception.
Every point of armor adds the same amount of EHP (Effective Hitpoints)

However if you want a system where 1 armor blocks exactly 1 damage and so on, you have to use a DDS or code it yourself.

How is it NOT diminishing returns when the multiplier lowers/armor as it progresses further?

It's 1/12 less effective hitpoints per armor at 2 armor in comparison to 1 armor and the ratio only get worse, diminishing returns.

"The law of diminishing returns (also law of diminishing marginal returns or law of increasing relative cost) states that in all productive processes, adding more of one factor of production, while holding all others constant ("ceteris paribus"), will at some point yield lower per-unit returns."

There is a solution.
Set the armor of every unit to 0.
And add the resistant skin spell to units...
But it will only block physical damage.

Instead of removing armor i would change the gameplay constants to remove the reduction that armor yeilds and change the tooltip saying that it blocks x dmg per armor. And armor/defense only block Physical dmg too, but having one level of hardned skin per armor would not be a great idea
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,232
Armor does not have diminishing returns in WC3. It works pretty similar to D3 where it improves EHP linearly.

1 armor = 6% more hp when taking attack damage
2 armor = 12% more hp when taking attack damage
100 armor = 600% more hp when taking attack damage

It has diminishing returns with damage reduction but this is counter by damage reduction having division like properties when it comes to EHP. At 99% damage reduction, a 1% increase has the effect of giving you infinite EHP. At 0% damage reduction, a 1% increase has the effect of only giving you 1.0101...% more EHP. Each point of armor yields less damage reduction but each point of damage reduction yields more EHP. The result is a linear response when it comes to EHP, the actual amount of HP you have when you take damage.

The % per armor can be altered in the game play constants and defaults to 6%.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
JASS:
library FlatArmor requires DDS
    struct Armor extends array
        private static method onDamage takes nothing returns nothing
            local real armor
            set DDS[targetId].enabled = false
            set armor = R2I(GetUnitArmor(target) + 0.5)
            set damage = GetFullDamage(damage, armor) - armor
            set DDS[targetId].enabled = true
            if damage < 0 then
                set damage = 0
            endif
            call DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Damage: " + R2S(damage))
            call DisplayTimedTextToPlayer(Player(0), 0, 0, 10, "Armor: " + R2S(armor))
        endmethod
        implement DDS
    endstruct
endlibrary

Copy the DDS and ArmorUtils folders inot your map. Then copy the UnitIndexer, Life Saver and DDS Plugin Damage Event Archetype abilities into your map. Set the UnitIndexer library to use the UnitIndexer ability, LifeSaver and ArmorUtils to use the Life Saver ability and Damage Event Archetype DDS Plugin library to use the Archetype ability.

Credits to Rising_Dusk for ArmorUtils library and to Nestharus for his damage detectin library.

You need JNGP editor to use this. It will work automatically when imported correctly.
 

Attachments

  • Plugin Install Pack (2).w3x
    80.7 KB · Views: 40

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,232
For people who still believe that armor does have diminishing returns, the proof (kind of) that it does not...

Damage reduction is relative to itself.

A damage reduction of 50% means you take 0.5 times the damage you normally would and results in you having equivalently double your HP as EHP as you will need twice as much damage to kill.
A damage reduction of 75% means you take 0.25 times the damage you normally would and results in you having equivalently four times your HP as EHP as you will need 4 times as much damage to kill.

In stead of thinking of it as damage reduction, think of it as damage still dealt. This lets you convert it into a HP multiplyer to get EHP by inverting it.

EHP = (1 / damage taken) * HP

At 0% damage reduction (1.0 damage taken) your EHP = HP.
At 50% damage reduction (0.5 damage taken) your EHP = 1 / 0.5 * HP = 2 * HP
At 75% damage reduction (0.25 damage taken) your EHP = 1 / 0.25 * HP = 4 * HP
At 99% damage reduction (0.01 damage taken) your EHP = 1 / 0.01 * HP = 100 * HP
As you can see, inversely proportional action going on.

The armor to damage taken / reduction formula abuses this property to turn the EHP equation linear.

Damage Reduction = 1 / (1 / (armor * armorval) + 1)
Damage Taken = 1 / (1 + armor * armorval)
armorval is a constant representing the EHP value of each point of armor, default to 0.06 (6%) but can be changed in gameplay constants.

If we substitute this into the previous equation for EHP...
EHP = (1 / (1 / (1 + armor * armorval))) * HP
Or when simplified...
EHP = (1 + armor * armorval) * HP
As such EHP is directly proportional to HP, armor and armorval.

Since EHP is a measure of how tough something is (unlike damage reduction which is just a concept) this means that armor has no diminishing returns and is completely linear. An extra point of armor will add the same amount of EHP be it at 1 armor or 1000 armor.

This however does not apply to negative armor. Negative armor does have diminishing returns I think since it caps at double damage as armor goes to - infinity.

Additionally the minimum damage you can take after armor reduction (but before type reduction) is 1. This means that really high armor levels do suffer diminishing returns since they will not be able to reduce damage any further. However this never happens for reasonable values of armor and damage which is what all well made maps should have.

Also armor does not reduce ability damage. This is important to note when deciding if a unit needs more HP or more armor. Low HP and high armor means weak to abilities but strong to combat. Like wise, high HP and low armor means weak to combat but strong to abilities.
 
Status
Not open for further replies.
Top