I wanted to overhaul my armor system in my map. I adjusted all enemy damage effects to be reduced by 1% per armor point, so 1 armor equals 1% damage reduction.
Obviously, I need to somehow prevent people from reaching 100 armor (which could eventually be possible, when taking into account passive or buff spells, auras, items etc). So I thought, I do not use armor directly, but I use a new, hidden attribute behavior, which gives 1 bonus armor for every point and has a maximum stack value of 75; so damage reduction will be hard-capped at 75%.
However, this does not work as expected. If I have for example 70 armor already, and I equip an item, which gives 15 armor, I am at 75. So far so good, but if I unequip the item again, I am not at 70 again, but only at 60. So it takes away the whole 15 attribute points, even though, it was only able to add 5.
This is fixed, when removing all armor bonuses; however in the case of passive armor spells, this is not possibe.
hmm, i would use some kind of formular, that decreases the armor gain after x points of armor that you get...
something like mod = 75/(Armor^2 + 75)
however you then should use a % gain per point of 6,2% * mod that would give you at 75 armor a reduction of 75,11%
if you can get any more armor, well lets say if you manage to get 208 armor your dmg reduction would only be 79,01%
if you need the exel/open office file, send me a PM
hmm, i would use some kind of formular, that decreases the armor gain after x points of armor that you get... something like mod = 75/(Armor^2 + 75) however you then should use a % gain per point of 6,2% * mod that would give you at 75 armor a reduction of 75,11% if you can get any more armor, well lets say if you manage to get 208 armor your dmg reduction would only be 79,01% if you need the exel/open office file, send me a PM
Sounds great in theory, do you happen to have an actual realization of this ingame, which does not use a million of behaviors? ;)
Seems your problem is that you are deducting armor based on the number of stacks of the %dr buff. Try making it that the %dr buff is constantly updated using an apply/remove behavior system where the stack amount is controlled using the Unit Compare Field Validator to count armor. The logic would be if %dr buff is less than armor and less than 75 stacks apply the %dr buff while if armor is less than 75 remove %dr buffs till they are equal.
If you want armor just to be an indicator of %dr then you probably need to give the items a hidden counting behavior that stacks adnausium so that you can have over 75 counting behavior stacks given by items yet only 75 %dr stacks. You could then use requirements for an apply/remove the %dr buff system. For this have a buff that periodically (1/16 sec) applies the %dr behavior with a disabling requirement of %dr buff count is greater than counter buff count and the %dr buff count is greater than 74. Have a second buff that periodically (1/16 sec) removes the %dr behavior with a disabling requirement of the counter buff count is greater than the %dr buff count.
Currently, I do NOT use any %dmgred behavior. At all. I just use the usual armor.
Also, right now, the solution is data-only, no trigger system involved (does not mean I won't use triggers at all)
Currently, all I did was modifying ALL damage effects in my map, so their damage gets reduced by 1% per point of armor (every damage effect has the armor reduction field, which determines, how much damage is reduced per point of armor. I just set all damage effects manually to reduce the incoming damage by 1 % - so if a unit causes 10 damage, I set the armor reduction to 0.1, if it causes 50, reduction is 0.5 and so on)
To prevent hitting 100 armor, this preventing any damage of those effects, I used an attribute buff called armor, maximum stack count of 75, which provides 1 point of armor per stack. I modified all spells, items etc to not add plain armor, but a bonus to this attribute.
Because of this, the armor value and thus the damage reduction never surpasses 75, which works just fine.
However, the attributes behave unexpected, once they hit max. Thats my current problem. Once the attribute surpasses 75, it does not increase anymore. But as soon as points are removed, it decreases instantly, even, if the sum of attribute points present on this unit is still more than 75.
I could try your approach, though. Just to get armor, I would need a behavior, which applies a behavior, which applies an attribute (aka behavior) :p. Crazy.
I still say my system would work just swap the %dr buff with your attribute then though using a buff probably would be simpler for the %dr than having to modify every damage effect since you would just need the damage reduced per point of armor to be a flat 0 since you can add the points of armor and the damage reduction in the same buff.
hmm, what about adding a second hidden buff without a stack limit but no effect. items spells etc. increase or decrease that buff however your armor buff scales with that new one only that your armor buff is capped at 75.
so you get something like 10/10 50/50 75/75 100/75 76/75
why are you guys telling him to change his damage reduction buff when he has said he doesnt use one???
This is how I would do it much like you aready are....
Requires small ammount of triggering
Create A second behavior called (Dummy_True_Armor)
instead of directly adding your armor behavior add this guy
the point of this guy is to keep a true count of how much armor the unit actually has
Create a trigger that detects any change in the ammount of (Dummy_True_Armor)
Calculate how much armor you want the unit to actually have after this change and adjust the actual (attributed armor behavior)
That should solve your problem
for example
your max armor is 75
The units armor is 70
you add an item granting 15 amor
the true armor value would be 85
your trigger would be hard coded not to apply more then 75 stacks of the actuall armor attribute behavior
then when the item is remove your trigger would calculate true armor at 70 stacks and apply 70 stacks of the armor attribute behavior
This sounds like something I may do on my own map. That is adjusting the armor/ damage reduction property on all the damage effects manually.
Using damage reduction behaviors out right causes issues considering the behaviors reduce the damage after the damage has already been dealt or something along those lines.... Ive read about quite a few people having issues with it.
This is the first time Ive read that you can actually edit the damage effects themselvs to handle armor as a percentage.
So basicly you are using a trigger to adjust the %dr whatever where I said to use two behaviors and two requirements connected to two effects. End result would be the same but yours would probably be more laggy since data tends to cause less issues than triggers if there are alot of units. On the other hand your method does allow for more flexibility like diminishing returns, so it is a personal preference.
After fiddling around a lot more, I overhauled the whole System.
Since I would need special attention for the attributes anyway (either by using additional behaviors and periodic checks or by triggers), I figured I could trigger the system completely.
Also the 1% reduce for each effect did not work out so well, because any damage bonus/malus buff would screw the reduction completely, or would somehow require to adjust the damage reduction per armor as well, which should not be THAT easy.
Quote:
Using damage reduction behaviors out right causes issues considering the behaviors reduce the damage after the damage has already been dealt or something along those lines.... Ive read about quite a few people having issues with it.
Tested, does not seem to be true. Damage is reduced, before it is dealt. You can prevent death for units, even if you damage them with more damage than their maximum health.
Quote:
...since data tends to cause less issues than triggers if there are alot of units.
Even though, this is somewhat true for similar tasks, you cannot say that in general.
If you perform the exact same tasks in data or using triggers, your statement is most likely true, and data will be superior performance-wise.
But if you compare these 2 completely different approaches, you cannot just say that. Your data method involves periodic behavior changes, requirement or validator checks. Using triggers would react to the UnitAttributeChanged event, which would make it a one time event.
Whatever, my current method works like this:
Added an attribute for armor, could stack indefinitely in theory.
Added a damage reduction buff, stacks based on precision. Currently, I use 200 stacks of 0.5% damage reduction (0.995 fraction); could be increased probably.
Attribute change is handled by trigger, trigger checks the current armor and reduction stacks, and applies or removes reduction checks, if needed.
Armor reduction can use any formula; I currently use the WC3 base formula (reduce = 0.06*armor/(1+0.06*armor) ).
Renamed the usual armor to Reduction %, this is set according to the current armor reduction via catalog.
So now I have an attribute called armor, which, for example, says 10. The Reduction % field (formerly known as Armor) shows 37.5 in this case, the damage reduction behavior is applied in 75 stacks, so it reduces incoming damage by 37.5%.
The system appears to work perfectly fine and performance should not be a problem, since the triggers only fire for an actual attribute change.
Hey.
I wanted to overhaul my armor system in my map. I adjusted all enemy damage effects to be reduced by 1% per armor point, so 1 armor equals 1% damage reduction.
Obviously, I need to somehow prevent people from reaching 100 armor (which could eventually be possible, when taking into account passive or buff spells, auras, items etc). So I thought, I do not use armor directly, but I use a new, hidden attribute behavior, which gives 1 bonus armor for every point and has a maximum stack value of 75; so damage reduction will be hard-capped at 75%.
However, this does not work as expected. If I have for example 70 armor already, and I equip an item, which gives 15 armor, I am at 75. So far so good, but if I unequip the item again, I am not at 70 again, but only at 60. So it takes away the whole 15 attribute points, even though, it was only able to add 5.
This is fixed, when removing all armor bonuses; however in the case of passive armor spells, this is not possibe.
Any suggestions for a solution or an alternative?
@Kueken531: Go
hmm, i would use some kind of formular, that decreases the armor gain after x points of armor that you get... something like mod = 75/(Armor^2 + 75) however you then should use a % gain per point of 6,2% * mod that would give you at 75 armor a reduction of 75,11% if you can get any more armor, well lets say if you manage to get 208 armor your dmg reduction would only be 79,01% if you need the exel/open office file, send me a PM
Sounds great in theory, do you happen to have an actual realization of this ingame, which does not use a million of behaviors? ;)
Seems your problem is that you are deducting armor based on the number of stacks of the %dr buff. Try making it that the %dr buff is constantly updated using an apply/remove behavior system where the stack amount is controlled using the Unit Compare Field Validator to count armor. The logic would be if %dr buff is less than armor and less than 75 stacks apply the %dr buff while if armor is less than 75 remove %dr buffs till they are equal.
If you want armor just to be an indicator of %dr then you probably need to give the items a hidden counting behavior that stacks adnausium so that you can have over 75 counting behavior stacks given by items yet only 75 %dr stacks. You could then use requirements for an apply/remove the %dr buff system. For this have a buff that periodically (1/16 sec) applies the %dr behavior with a disabling requirement of %dr buff count is greater than counter buff count and the %dr buff count is greater than 74. Have a second buff that periodically (1/16 sec) removes the %dr behavior with a disabling requirement of the counter buff count is greater than the %dr buff count.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Okay.. let me clarify, what I got so far:
Currently, I do NOT use any %dmgred behavior. At all. I just use the usual armor.
Also, right now, the solution is data-only, no trigger system involved (does not mean I won't use triggers at all)
Currently, all I did was modifying ALL damage effects in my map, so their damage gets reduced by 1% per point of armor (every damage effect has the armor reduction field, which determines, how much damage is reduced per point of armor. I just set all damage effects manually to reduce the incoming damage by 1 % - so if a unit causes 10 damage, I set the armor reduction to 0.1, if it causes 50, reduction is 0.5 and so on)
To prevent hitting 100 armor, this preventing any damage of those effects, I used an attribute buff called armor, maximum stack count of 75, which provides 1 point of armor per stack. I modified all spells, items etc to not add plain armor, but a bonus to this attribute.
Because of this, the armor value and thus the damage reduction never surpasses 75, which works just fine.
However, the attributes behave unexpected, once they hit max. Thats my current problem. Once the attribute surpasses 75, it does not increase anymore. But as soon as points are removed, it decreases instantly, even, if the sum of attribute points present on this unit is still more than 75.
I could try your approach, though. Just to get armor, I would need a behavior, which applies a behavior, which applies an attribute (aka behavior) :p. Crazy.
I still say my system would work just swap the %dr buff with your attribute then though using a buff probably would be simpler for the %dr than having to modify every damage effect since you would just need the damage reduced per point of armor to be a flat 0 since you can add the points of armor and the damage reduction in the same buff.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
hmm, what about adding a second hidden buff without a stack limit but no effect. items spells etc. increase or decrease that buff however your armor buff scales with that new one only that your armor buff is capped at 75. so you get something like 10/10 50/50 75/75 100/75 76/75
Read above I already said that.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
why are you guys telling him to change his damage reduction buff when he has said he doesnt use one???
This is how I would do it much like you aready are....
Requires small ammount of triggering
That should solve your problem
for example
the true armor value would be 85
your trigger would be hard coded not to apply more then 75 stacks of the actuall armor attribute behavior
then when the item is remove your trigger would calculate true armor at 70 stacks and apply 70 stacks of the armor attribute behavior
This sounds like something I may do on my own map. That is adjusting the armor/ damage reduction property on all the damage effects manually.
Using damage reduction behaviors out right causes issues considering the behaviors reduce the damage after the damage has already been dealt or something along those lines.... Ive read about quite a few people having issues with it.
This is the first time Ive read that you can actually edit the damage effects themselvs to handle armor as a percentage.
so thanx
So basicly you are using a trigger to adjust the %dr whatever where I said to use two behaviors and two requirements connected to two effects. End result would be the same but yours would probably be more laggy since data tends to cause less issues than triggers if there are alot of units. On the other hand your method does allow for more flexibility like diminishing returns, so it is a personal preference.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
After fiddling around a lot more, I overhauled the whole System.
Since I would need special attention for the attributes anyway (either by using additional behaviors and periodic checks or by triggers), I figured I could trigger the system completely.
Also the 1% reduce for each effect did not work out so well, because any damage bonus/malus buff would screw the reduction completely, or would somehow require to adjust the damage reduction per armor as well, which should not be THAT easy.
Tested, does not seem to be true. Damage is reduced, before it is dealt. You can prevent death for units, even if you damage them with more damage than their maximum health.
Even though, this is somewhat true for similar tasks, you cannot say that in general.
If you perform the exact same tasks in data or using triggers, your statement is most likely true, and data will be superior performance-wise.
But if you compare these 2 completely different approaches, you cannot just say that. Your data method involves periodic behavior changes, requirement or validator checks. Using triggers would react to the UnitAttributeChanged event, which would make it a one time event.
Whatever, my current method works like this:
So now I have an attribute called armor, which, for example, says 10. The Reduction % field (formerly known as Armor) shows 37.5 in this case, the damage reduction behavior is applied in 75 stacks, so it reduces incoming damage by 37.5%.
The system appears to work perfectly fine and performance should not be a problem, since the triggers only fire for an actual attribute change.
How well would the trigger cope in multiplayer when there can be alot of armors being picked up/dropped potentially at once?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg