Hello guys, I'm currently trying to develop a damage reduction buff for my map. What I need it to do is: stack 99 times and reduce all damage taken by 1% for each stack up to a maximum of 99% reduced damage. Problem is combat: damage response - modify fraction isn't additive, but multiplies itself for each behavior stack. Is there any other way I could achieve this with data or with triggers ?
I know I can use catalog triggers to directly change the modify fraction amount, but this isn't an option because I need it to have different values for different units of the same player (for example: one unit has 75% reduced damage, while another has 80% reduced damage).
I know in theory I could make a behavior for each unit in my map and control it with catalog triggers, but I'm wondering if there is any other easier way to this.
If overkill isn't an issue you could try the "vital gain from damage taken" mechanic, which essentially equals to % damage reduction. You'll need to account for shields seperately, and in-combat shield regen or differing shield and life armor values will cause slight differences to "true" damage reduction.
Also the unit will most likely die if it takes more than 100% of its hp in a single, unreduced hit...
If the damage reduction is generic, you can implement it by scaling both like and life regen (and for shield) appropriately. This generally is preferred in most cases as it makes it easier for the user to understand (no fractional mathematics to work out the EHP). If this damage reduction is specific to only certain sorts of attack then obviously this does not apply.
One solution would be to declare 100 different buffs for each of the different percentage reduction. A JAVA or Python script could be written to generate all of them in a predictable name format in 1-2 minutes which you then paste into XML view. Another could be to use stacking buffs and approximate a percentage reduction using the multiplicative behaviour (possibly with several different buffs of different reduction amounts for more precision).
Knowing the context of why you need this damage reduction might be useful.
To answer your question on the context: I'm trying to do an RPG map where the player and the mobs have 99 unique levels. I scaled all my stats and ability effect damages through triggers, because I wanted to make an unified system where everything depends on just a couple of variables and some for loops, and that pretty much worked - I keep the damage in a formula and every time a player levels up, a trigger fires and the spells scale accordingly through catalog field set function.
But lately I ran into an issue with the fact that attacking a much higher enemy than yourself isn't really dangerous and with some maneuvering and timing you can easily down enemies which shouldn't be touched until the player has at least a level close to theirs.
First I thought of something similar to Wow with a hit/miss chance, but I couldn't come up with a method that would work on what I already had implemented. Then I looked into simply increasing enemy HP to huge numbers, but I quickly realised that 100k is the max in sc2, so I thought of a different approach with damage reduction, that scales by level, so in essence a x level higher mob than you will take reduced damage by x%, where x is the difference between you and the mob.
so I thought of a different approach with damage reduction, that scales by level, so in essence a x level higher mob than you will take reduced damage by x%, where x is the difference between you and the mob.
Except in the end this will only make downing them take longer and not they become more dangerous. You have to remember that damage reduction is inversely proportional as such a level 1 hero will to practically no damage to a level 99 unit however a level 50 unit will still deal half damage and by the time you get to a level 80 you are doing most of your damage. I am not sure if this is a good approach for what you are after doing since it sounds like it will ultimately make little difference (if level 50s could fight level 99s now they could still after this as the reduction is only 50%). Of course you could make it more than 1% per level difference up to a maximum of 100% which could work however ultimately that defines a minimum level to fight the monsters.
Some RPG I have seen get around this by having level restrictions on high level areas so you cannot fight the high level mobs until you are at least a high-ish level yourself. I agree that most implementations of this are not very polished (teleport you back with stupid message) however if you build it into the story (quests) or if you make a reason to now be allowed (roleplay) then it can work. For example a guard at a gate stops you entering because he thinks it is too dangerous for you or that a way is blocked and you need to help needing a certain level to be strong enough to unblock it etc.
Another approach you could do is the "unfair" approach where by if a monster is X levels above you then they instantly (or have a chance to instantly) kill you or deal a lot of damage. This would be far easier to implement as a generic damage response event could be used which based on the proportion of health lost (so dot effects do not become rigged) works out a chance for dealing the penalty damage. It would also make the monsters feel more powerful and has RP credit since it could be that your pathetic low level hero was simply crushed under the foot of the powerful unit.
You could also have various damage reduction checkpoints (the opposite of the damage bonus idea above) where by if you are below the minimum level for the area then the monsters get near 100% damage reduction flat out from your attacks (does not mater about the difference, just that you fail to meet the required level). The RP behind this would be that your attacks are so pathetic that they bounce off the monster with practically no effect.
Anyway back to your problem. As mentioned before you can use the multiplicative stacking of damage reduction to approximate a certain damage reduction percentage. It would not be exact however if you get it within 1% I doubt anyone would notice the difference. You could get exact percentages by making 100 such reduction buffs (recommend a script for speed and effort saving). If you name such buffs in an order way (DamageReduction# where # is 1 to 100) you can easily trigger a system to apply the right behaviour (convert percentage to string and append as suffix to ability prefix and then convert to behaviour type).
You can have every Hero have several Behaviors on it with a Periodic Effect looking to apply a Buff to Monsters.
You can have one of these for several "tiers" of level differences - for instance 1 (barely harder), 3 (little harder), 6, 10, 20, 35, 50 (impossible)
Each one of them uses a Unit Compare Veterancy (you can try using another Unit Compare) validator to compare the difference in levels between the target (Monster) and source (Hero). Pretty sure this works if you set the Other Unit fields. And make sure you set it to Greater Than or Equal To or Less Than or Equal To (not sure which it'd be)
If the Monster is that many levels higher than the Player, it'll apply the buff which increases the Monster's attack speed or even health or armor by an amount you want for a short period, maybe 1 second. You can either stack the effects (so he'll be hit by multiple Buffs) or use a Switch to only apply one of them.
You set the debuffs to how you feel they should be - maybe a Monster 50 levels higher will gain 500 armor and do 1000% damage?
Won't be that much work if you only have a couple of tiers, but setting one of them up for every level difference would be a pain.
If you need to have multiple Heros of different levels, you can switch it and have a DEBUFF applied to the Hero so a stronger Hero can beat up a dragon while a level 1 peasant smokes a pipe nearby.
If the player only has 1 unit with damage reduction - you could give the unit a dummy behavior which would reduce the damage and then have another buff with no actual effect with the stacks, then you have a trigger which count the stacks, and set the damage redcution of the dummy behavior with a Catalog Set Field Value action.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello guys, I'm currently trying to develop a damage reduction buff for my map. What I need it to do is: stack 99 times and reduce all damage taken by 1% for each stack up to a maximum of 99% reduced damage. Problem is combat: damage response - modify fraction isn't additive, but multiplies itself for each behavior stack. Is there any other way I could achieve this with data or with triggers ?
I know I can use catalog triggers to directly change the modify fraction amount, but this isn't an option because I need it to have different values for different units of the same player (for example: one unit has 75% reduced damage, while another has 80% reduced damage).
I know in theory I could make a behavior for each unit in my map and control it with catalog triggers, but I'm wondering if there is any other easier way to this.
If overkill isn't an issue you could try the "vital gain from damage taken" mechanic, which essentially equals to % damage reduction. You'll need to account for shields seperately, and in-combat shield regen or differing shield and life armor values will cause slight differences to "true" damage reduction.
Also the unit will most likely die if it takes more than 100% of its hp in a single, unreduced hit...
If the damage reduction is generic, you can implement it by scaling both like and life regen (and for shield) appropriately. This generally is preferred in most cases as it makes it easier for the user to understand (no fractional mathematics to work out the EHP). If this damage reduction is specific to only certain sorts of attack then obviously this does not apply.
One solution would be to declare 100 different buffs for each of the different percentage reduction. A JAVA or Python script could be written to generate all of them in a predictable name format in 1-2 minutes which you then paste into XML view. Another could be to use stacking buffs and approximate a percentage reduction using the multiplicative behaviour (possibly with several different buffs of different reduction amounts for more precision).
Knowing the context of why you need this damage reduction might be useful.
Thanks for all the ideas guys.
To answer your question on the context: I'm trying to do an RPG map where the player and the mobs have 99 unique levels. I scaled all my stats and ability effect damages through triggers, because I wanted to make an unified system where everything depends on just a couple of variables and some for loops, and that pretty much worked - I keep the damage in a formula and every time a player levels up, a trigger fires and the spells scale accordingly through catalog field set function.
But lately I ran into an issue with the fact that attacking a much higher enemy than yourself isn't really dangerous and with some maneuvering and timing you can easily down enemies which shouldn't be touched until the player has at least a level close to theirs. First I thought of something similar to Wow with a hit/miss chance, but I couldn't come up with a method that would work on what I already had implemented. Then I looked into simply increasing enemy HP to huge numbers, but I quickly realised that 100k is the max in sc2, so I thought of a different approach with damage reduction, that scales by level, so in essence a x level higher mob than you will take reduced damage by x%, where x is the difference between you and the mob.
Except in the end this will only make downing them take longer and not they become more dangerous. You have to remember that damage reduction is inversely proportional as such a level 1 hero will to practically no damage to a level 99 unit however a level 50 unit will still deal half damage and by the time you get to a level 80 you are doing most of your damage. I am not sure if this is a good approach for what you are after doing since it sounds like it will ultimately make little difference (if level 50s could fight level 99s now they could still after this as the reduction is only 50%). Of course you could make it more than 1% per level difference up to a maximum of 100% which could work however ultimately that defines a minimum level to fight the monsters.
Some RPG I have seen get around this by having level restrictions on high level areas so you cannot fight the high level mobs until you are at least a high-ish level yourself. I agree that most implementations of this are not very polished (teleport you back with stupid message) however if you build it into the story (quests) or if you make a reason to now be allowed (roleplay) then it can work. For example a guard at a gate stops you entering because he thinks it is too dangerous for you or that a way is blocked and you need to help needing a certain level to be strong enough to unblock it etc.
Another approach you could do is the "unfair" approach where by if a monster is X levels above you then they instantly (or have a chance to instantly) kill you or deal a lot of damage. This would be far easier to implement as a generic damage response event could be used which based on the proportion of health lost (so dot effects do not become rigged) works out a chance for dealing the penalty damage. It would also make the monsters feel more powerful and has RP credit since it could be that your pathetic low level hero was simply crushed under the foot of the powerful unit.
You could also have various damage reduction checkpoints (the opposite of the damage bonus idea above) where by if you are below the minimum level for the area then the monsters get near 100% damage reduction flat out from your attacks (does not mater about the difference, just that you fail to meet the required level). The RP behind this would be that your attacks are so pathetic that they bounce off the monster with practically no effect.
Anyway back to your problem. As mentioned before you can use the multiplicative stacking of damage reduction to approximate a certain damage reduction percentage. It would not be exact however if you get it within 1% I doubt anyone would notice the difference. You could get exact percentages by making 100 such reduction buffs (recommend a script for speed and effort saving). If you name such buffs in an order way (DamageReduction# where # is 1 to 100) you can easily trigger a system to apply the right behaviour (convert percentage to string and append as suffix to ability prefix and then convert to behaviour type).
You can have every Hero have several Behaviors on it with a Periodic Effect looking to apply a Buff to Monsters. You can have one of these for several "tiers" of level differences - for instance 1 (barely harder), 3 (little harder), 6, 10, 20, 35, 50 (impossible)
Each one of them uses a Unit Compare Veterancy (you can try using another Unit Compare) validator to compare the difference in levels between the target (Monster) and source (Hero). Pretty sure this works if you set the Other Unit fields. And make sure you set it to Greater Than or Equal To or Less Than or Equal To (not sure which it'd be)
If the Monster is that many levels higher than the Player, it'll apply the buff which increases the Monster's attack speed or even health or armor by an amount you want for a short period, maybe 1 second. You can either stack the effects (so he'll be hit by multiple Buffs) or use a Switch to only apply one of them.
You set the debuffs to how you feel they should be - maybe a Monster 50 levels higher will gain 500 armor and do 1000% damage?
Won't be that much work if you only have a couple of tiers, but setting one of them up for every level difference would be a pain.
If you need to have multiple Heros of different levels, you can switch it and have a DEBUFF applied to the Hero so a stronger Hero can beat up a dragon while a level 1 peasant smokes a pipe nearby.
If the player only has 1 unit with damage reduction - you could give the unit a dummy behavior which would reduce the damage and then have another buff with no actual effect with the stacks, then you have a trigger which count the stacks, and set the damage redcution of the dummy behavior with a Catalog Set Field Value action.