WC3 Armor Sytem

Status
Not open for further replies.
Level 3
Joined
Apr 28, 2010
Messages
48
Hi, getting into the game here. I was wondering if anyone has developed an armor system or could give me pointers similar to WC3 armor system.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,284
So far I only know that it can be done via triggers. I think I heard somewhere that someone did it via just the data editor but you are probably better off with triggers for now unless someone knows exactly how to do it with the data editor.
Cancel out the damage dealt by rehealing the unit by the armor reduction.
 
Level 3
Joined
Apr 28, 2010
Messages
48
Afaik, the way the behaviors as a damage response work now, it does heal after you take damage. I setup a trigger to calc data to the numbers on the screen.

Without buff damage was doing 50 damage and taking 50 damage
With the buff 50% damage response fraction it was saying I was doing 50 damage and only taking 25 damage. Probably because it calculated the damage taken first before the behavior has a chance to react. Thus, if a unit takes damage thats fatal it wont be reduced.

So I thought that maybe I could maybe down the road try doing this. Tell me if you'd think this would work.
Instead of it having a damage response, it could give a buff of HP based on the % of armor you have. So, if you have 100HP and 15% armor reduction you'd have 115 HP. Recreate the UI to show -% Armor Reduction to make it appear as if its damage reduction. Now you tack on another buff that increases spell damage taken by the % of armor reduction to scale with the HP, so it strictly effects ranged/melee damage/splash damage.
Problem is that if you get a debuff or buff that is like 5% more hp. I won't truly be 5% HP. So, maybe use shields instead of HP, this would separate the two. Shields would become armor reduction for a unit.
But, the problem there, is that if a unit takes damage the UI won't show life being taken, only shields. So, I would have to split the damage to shields based on the percent somehow. But, I think that would work.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,284
WC3's armor system worked by multiplying effective hitpoints when taking damage in a linear way. Having 100 armor means that when taking damage you equivently have 600% more hp in normal melee. The damage is then reduced so that your actual received damage is the same percentage as the damage dealing to the multiplied hp would be. It is capped at atleast 1 damage (multiplied by armor modifiers after that cap).
 
Level 3
Joined
Apr 28, 2010
Messages
48
WC3's armor system worked by multiplying effective hitpoints when taking damage in a linear way. Having 100 armor means that when taking damage you equivently have 600% more hp in normal melee. The damage is then reduced so that your actual received damage is the same percentage as the damage dealing to the multiplied hp would be. It is capped at atleast 1 damage (multiplied by armor modifiers after that cap).

Right, I think I have method of actually doing that. Thanks for the reply they get me using my brain more. But, its going to have to be put on hold for awhile.

For now I made created this, for attributes only. How would I write the event so there isn't a cluster of data going on though, instead of using "any unit takes damage"

Also is there a condition for validating damage type, I can't seem to find it.

Not
->Condition
Triggering Damage Type == Spell

user5565pic824112594321.jpg
 
Level 3
Joined
Apr 28, 2010
Messages
48
Ok I created a armor heal system.

Need condition value. In map int trigger, Set variable. Entry as parent damage effect kind, CEffectDamage. Which is spell. Then use this variable as the condition value. I named the global variable DamageTypeSpell.


SetVariable(damageTypeSpell, (CatalogFieldValueGet(c_gameCatalogEffect, "CEffectDamage", "Kind", c_playerAny)))



Here is the trigger


bool gt_GlobalArmorReduction_Func (bool testConds, bool runActions) {
// Variable Declarations
fixed lv_armorNumber;
fixed lv_damageTaken;
fixed lv_armorHealPercent;

// Variable Initialization
lv_armorNumber = 0.0;
lv_damageTaken = 0.0;
lv_armorHealPercent = 0.0;

// Conditions
if (testConds) {
if (!((!((CatalogFieldValueGet(c_gameCatalogEffect, (EventUnitDamageEffect()), "Kind", UnitGetOwner(EventUnitDamageSourceUnit())) == gv_damageTypeSpell))))) {
return false;
}
}

// Actions
if (!runActions) {
return true;
}

lv_armorNumber = ((((IntToFixed(UnitBehaviorCount(EventUnit(), "Force")) + IntToFixed(UnitBehaviorCount(EventUnit(), "ForceP"))) * 0.14) + IntToFixed(UnitBehaviorCount(EventUnit(), "StatsArmorDummy"))) - (IntToFixed(UnitBehaviorCount(EventUnit(), "StatsNegativeArmorDummy")) + 2.0));
lv_damageTaken = EventUnitDamageAmount();
lv_armorHealPercent = ((lv_armorNumber * 0.06) / (1.0 + (0.06 * lv_armorNumber)));
CatalogFieldValueSet(c_gameCatalogEffect, "ArmorHealDamage", "VitalArray[Life].Change", 1, FixedToString((lv_damageTaken * lv_armorHealPercent), c_fixedPrecisionAny));
UnitCreateEffectUnit(EventUnit(), "ArmorHealDamage", EventUnit());
UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, FixedToText(lv_damageTaken, c_fixedPrecisionAny));
return true;
}
 
Having 100 armor means that when taking damage you equivently have 600% more hp in normal melee
Wrong. For every armor point you get, you get x% of the remaining damage absorbing.
So its like this:
[1 armor = 6% increase]
0 armor : 0%
1 armor : 6%
2 armor: 11.64 (6% + 94% (100% - 6%) * 0.06 (6% increase))
3 armor: 16,9416 (11.64 + 88.36% (100% - 11.64%) * 0.06))
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,284
Anachron.... Apparently you do not read up much about WC3...

Battlenet said:
For positive Armor, damage reduction =((armor)*0.06)/(1+0.06*(armor))
For negative Armor, it is damage increase = 2-0.94^(-armor) since you take more damage for negative armor scores.
A Positive Armor of 1 reduces damage by about 5.7%. A negative armor of 10 increases damage by 46.1%. A unit with 20 armor basically has 55% extra hitpoints -- 100 would become effectively 155.

The source article has been vandalized as 20 armor grants more than 50% damage reduction and thus allows the unit to take double damage (over 100% more hits as each does half damage). It used to be right but has been changed to be incorrect for some stupid reason, the formula is right though.
20 armor grants 120% more equivelent HP.
100 armor grants 600% more equivelent HP.
You however are completly wrong...


Formula for damage reduction...
damage reduction =((armor)*0.06)/(1+0.06*(armor))
damage reduction = armor / (50/3 + armor)
damage reduction = (3/50) / ((3/50) + armor)
(3/50) = a constant = 0.06

Formula for damage multiplyer
damage multiplyer = 1 - (3 / (3 + 50*armor))
damage multiplyer = ((3 + 50*armor) - 3) / (3 + 50*armor)
damage multiplyer = (50*armor) / (3 + 50*armor)
damage multiplyer = armor / (3/50 + armor)
damage multiplyer = (50/3) / ((50/3) + armor)
(50/3) = a constant = 16.666666666666666666666666666667

Formula for equivelent extra hitpoints
extra hp = ((50/3) + armor) / (50/3)

99% damage reduction is 1650 armor
Ofcourse this is all subject to armor multiplyer changed from game play constants but this was the usual melee armor behaviour.
 
Last edited:
Level 3
Joined
Apr 28, 2010
Messages
48
Ya... Anachron that is just how it appears, doesn't mean its coded that way. You're just seeing the bookcover, not the book. I have to agree with Dr.SuperGood.

Its kind of hard to believe this stuff wasn't implemented into galaxy.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,284
Why is it coded badly?

Look how efficent the opperations are in it, it looks prety good to me. Additionally the algerthim used allows prediictable results and does not cause the 1 Damage problem sc2 suffers from with its armor unless armor are at insane values.

If anything I like WC3 armor more than Sc2 armor because having 100 amor does not make your 100 damage usless.
 
Level 3
Joined
Apr 28, 2010
Messages
48
Don't get me wrong though, there are or could be better systems for different kind of games created. Could the WC3 system be improved upon? Definitely. Its just a matter of perspective I believe.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,284
WC3 system is great for armor flexibility. Already I have played maps in SC2 where I deal 1000 damage but the boss has 1000 armor so I can not kill him cause I deal 1 damage a hit and he reheals 300 hit points a second. In WC3 I would be dealing more than 1 damage per hit although he still would be very insane to kill. Thus the WC3 armor is more noob friendly to use than SC2 armor.

In SC2, you have to make damn sure that all your damages are around the armor level as well as the hitpoints do not increase exponentially or you can easilly end up being unable to damage stuff.
 
Level 3
Joined
Apr 28, 2010
Messages
48
Kinda just curious now..
SC2 armor system reduces the damage taken by the amount of armor you have?
So.. Marine A has 100 hp,
Marine B attacks for 15 damage,
Marine A has 5 armor,
Marine A takes 10 damage (15-5),
Marine A is left with 90 hp?

1 point of armor in SC2 = 1 damage reduced
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,284
By deault only...

Under each damage effect you can alter them so that armor works differently.

For example you could have an anti tank gun with AP rounds which ignore armor completly. You could have a machine gun turret which deals insane damage very fast but even a few armor would null all its damage. You could even have some crazy armor inversion laser which deals extra damage the more armor a target unit has.

The fact remains the damage formula is... max(1,damage - reduction_multiplyer*armor).

This aspect of armor seems yet unexplored.
 
Status
Not open for further replies.
Top