At least by upgrades its possible to adjust reduction as well, so upgraded damage won't be a problem
No way, this will work. Think about it: You need to modify every single damage effect every time the armor changes. Also, this only works, if you only have one single unit using armor, or you would need to adjust the effects dynamically for every shot.
Quote:
I didn't put much time on thinking about this system so I actually don't know all the issues or how to fix them. As I said before it could fit his needs. For maps that doesnt have damage buffs like that it wouldn't be a problem.
This has some issues, if you have any way to boost damage. If you, for example, can buff your physical damage by 100%, you effectively reduce the impact of armor by 50%
If we take your 5000 damage effect and say, the enemy has 5 armor, so reduces the damage by 2500 this means a 50% armor reduction.
Now the attacker gets 100% damage buff, deals 10.000 damage. But still, the armor reduces only 2500, so 5 armor does only reduce damage by 25%.
So having the max armor a unit would have at like 15-25 the difference is minor
You can definitely pick values to make both progressions quite similar for a set interval. For games with a controlable, low-ish amount of maximum armor, this is a valid method. However, for games with huge or even potentially unlimited amounts of armor, this might raise some armor-related imbalances, and you might end up not finding values to represent your desired behavior.
I made a comparison a while ago, these are comparisons between a WC3 armor system and the simplified stacking damage reduction behavior. As you can see, the progressions differ a little:
f(x) (blue) represents the simplified system, using a stacking 4% damage reduction behavior
g(x) (red) represents the WC3 armor system.
The simplified system has a more steep progression, making the armor weaker by trend at low values and stronger at high ones, compared to WC3 armor.
Also WC3 armor was designed to add an additional 6% ehp based on the base hp, while the simplified system would always add a percentage of current ehp. So the ehp progression for WC3 armor is linear, for simplified it is exponential.
So having a hero with a Devotion Aura walking around changing armor of 30 to 70 units, and an inner fire buff being placed randomly on a small army wouldn't be good :D?
Not sure, how costly Log() and Pow() actually are, might need a test. I increase the attributes in the test map with an additional behavior, and it triggers the trigger for every single point of armor, even if you increase 255 points at once, causing the trigger to run 255 times at once needlessly as well.
Before disabling that, it produced a small, noticeable lag spike when doing 255 armor calculations in one time interval.
Quote:
Is their anyway to place the Damage Reduction on the armor tab of the unit, when you hover over it?
You could make the attribute visible and take it as your actual armor stat and rename the armor to damage reduction in the text editor and modify it to represent the damage reduction ;) (or add a new damage reduction attribute and adjust that accordingly)
Quote:
Very nice, do you think with the introduction of Blizzard DOTA with the upcoming expansion they will have their own implication of a scaling %?
Well, implementing a scaling % system is as easy as using one single stacking behavior. Since it stacks multiplicatively, you can stack it as high as you want, a 5% damage reduction behavior would never give you a 100% reduction, it would always reduce the remaining damage by another 5% for each new stack.
Recreating the WC3 system accurately is a little more complicated, because the calculation formula is different.
Okay, this is a proof of concept for another WC3 armor system, involving a combination of data and triggers. It uses the same principle like my pre-1.4 system, however the involved calculations are a little more complicated now.
I will use a damage reduction buff and reduce the effect of the actual armor to zero. I will use a hidden attribute to keep track of the armor changes of a unit accurately. I will calculate the amount of armor reduction desired for the current amount of armor, and apply the according amount of stacks of the damage reduction behaviors.
This means, that, depending on the amount of behaviors and stacks I use, there will be discrepancies in the desired and the actual damage reduction.
Since all damage reduction buffs stack multiplicatively now, I decided to go for 2 different buffs with individual stack counts, to get a decent precision without ridiculous amounts of stacks required.
The values for these are educated guesses or result of experimenting, the optimal values might be different:
I picked one behavior with a reduction of 0.5% and 45 stacks and another one with 20% reduction and also 45 stacks. This results in a precision of about 0.5% and a maximum armor reduction of 1-(.8^45*.995^45)=99,9965%.
The testmap includes a damage test, one unit fires on another unit with modifiable armor. Select the target and enter a number in the chat to set the armor for that unit (255 max armor). The map displays the desired damage reduction, following the exact WC3 formula.
It also displays the damage dealt to the unit, calculates the actual reduction as well as the error compared to the formula.
Keep in mind, that triggers are only required, if the armor of a unit changes; however, because of the post-1.4 stacking mechanics, calculating the amount of needed behavior stacks involves costly functions like Log() and Pow(), so you might want to watch out for too frequent armor changes for many units. Also, negative armor is not supported for now. Also, the code is not really readable, as stated, it is only a proof of concept for people to decide, if this is actually worth bothering.
I had a nice working WC3 armor system using just a single, stackable buff and some triggers, but patch 1.4 broke it :/
Didn't find a solution yet, which does not involve creating and applying tons and tons of behaviors.
Use a second behavior, which has 4% damage amplification and gets applied, if armor becomes negative ;)
Yes, seems I thought about it the wrong way ;)
No way, this will work. Think about it: You need to modify every single damage effect every time the armor changes. Also, this only works, if you only have one single unit using armor, or you would need to adjust the effects dynamically for every shot.
Thats correct.
@SoulFilcher: Go
This has some issues, if you have any way to boost damage. If you, for example, can buff your physical damage by 100%, you effectively reduce the impact of armor by 50%
If we take your 5000 damage effect and say, the enemy has 5 armor, so reduces the damage by 2500 this means a 50% armor reduction.
Now the attacker gets 100% damage buff, deals 10.000 damage. But still, the armor reduces only 2500, so 5 armor does only reduce damage by 25%.
You can definitely pick values to make both progressions quite similar for a set interval. For games with a controlable, low-ish amount of maximum armor, this is a valid method. However, for games with huge or even potentially unlimited amounts of armor, this might raise some armor-related imbalances, and you might end up not finding values to represent your desired behavior.
I made a comparison a while ago, these are comparisons between a WC3 armor system and the simplified stacking damage reduction behavior. As you can see, the progressions differ a little:
f(x) (blue) represents the simplified system, using a stacking 4% damage reduction behavior
g(x) (red) represents the WC3 armor system.
The simplified system has a more steep progression, making the armor weaker by trend at low values and stronger at high ones, compared to WC3 armor.
Also WC3 armor was designed to add an additional 6% ehp based on the base hp, while the simplified system would always add a percentage of current ehp. So the ehp progression for WC3 armor is linear, for simplified it is exponential.
Not sure, how costly Log() and Pow() actually are, might need a test. I increase the attributes in the test map with an additional behavior, and it triggers the trigger for every single point of armor, even if you increase 255 points at once, causing the trigger to run 255 times at once needlessly as well.
Before disabling that, it produced a small, noticeable lag spike when doing 255 armor calculations in one time interval.
You could make the attribute visible and take it as your actual armor stat and rename the armor to damage reduction in the text editor and modify it to represent the damage reduction ;) (or add a new damage reduction attribute and adjust that accordingly)
Well, implementing a scaling % system is as easy as using one single stacking behavior. Since it stacks multiplicatively, you can stack it as high as you want, a 5% damage reduction behavior would never give you a 100% reduction, it would always reduce the remaining damage by another 5% for each new stack.
Recreating the WC3 system accurately is a little more complicated, because the calculation formula is different.
Okay, this is a proof of concept for another WC3 armor system, involving a combination of data and triggers. It uses the same principle like my pre-1.4 system, however the involved calculations are a little more complicated now.
I will use a damage reduction buff and reduce the effect of the actual armor to zero. I will use a hidden attribute to keep track of the armor changes of a unit accurately. I will calculate the amount of armor reduction desired for the current amount of armor, and apply the according amount of stacks of the damage reduction behaviors.
This means, that, depending on the amount of behaviors and stacks I use, there will be discrepancies in the desired and the actual damage reduction.
Since all damage reduction buffs stack multiplicatively now, I decided to go for 2 different buffs with individual stack counts, to get a decent precision without ridiculous amounts of stacks required.
The values for these are educated guesses or result of experimenting, the optimal values might be different:
I picked one behavior with a reduction of 0.5% and 45 stacks and another one with 20% reduction and also 45 stacks. This results in a precision of about 0.5% and a maximum armor reduction of 1-(.8^45*.995^45)=99,9965%.
The testmap includes a damage test, one unit fires on another unit with modifiable armor. Select the target and enter a number in the chat to set the armor for that unit (255 max armor). The map displays the desired damage reduction, following the exact WC3 formula.
It also displays the damage dealt to the unit, calculates the actual reduction as well as the error compared to the formula.
Keep in mind, that triggers are only required, if the armor of a unit changes; however, because of the post-1.4 stacking mechanics, calculating the amount of needed behavior stacks involves costly functions like Log() and Pow(), so you might want to watch out for too frequent armor changes for many units. Also, negative armor is not supported for now. Also, the code is not really readable, as stated, it is only a proof of concept for people to decide, if this is actually worth bothering.
I had a nice working WC3 armor system using just a single, stackable buff and some triggers, but patch 1.4 broke it :/ Didn't find a solution yet, which does not involve creating and applying tons and tons of behaviors.
€ Just had an idea, though...