Environmental Damage Falloff on Cone Attacks

Post Reply
faket15
Posts: 111
Joined: Fri Jun 30, 2017 6:41 pm

Environmental Damage Falloff on Cone Attacks

Post by faket15 »

One thing I decided to check recently was how environmental damage falloff affects Shredder Guns and Shredstorm Cannons and I noticed one thing I don't remember anyone talking about: they have damage falloff based on the distance to the center of the cone's base. This means that, when using one of them, getting closer to the target actually brings your damage down.

For Shredder Guns the effect is less noticeable. You need to be more than 12 tiles away from the target to maximize the environmental damage, but 8 tiles is already enough to always destroy weak (5 HP) cover and even if you are at max range your chance to destroy 10 HP cover is still only around 20%, the same as the center of a grenade without Sapper. Less than 8 tiles will almost always fail to destroy even 5 HP cover and will give you a small amount of damage falloff.

Shredstorm Cannons, on the other hand, are a much more interesting case. You need at least 7 tiles to even have a chance to destroy 5 HP cover and at this range you will only destroy it around half of the time while a Shredder Gun will do it all the time. At 13+ tiles the Shredstorm Cannon destroys 5 HP cover easily, but almost always fails to destroy 10 HP cover. A Shredstorm Cannon can destroy 10 HP cover around 90% of the time if you are far enough, but in this case we are talking really far, beyond visual range, more than 20 tiles in fact.
Psieye
Posts: 829
Joined: Thu Apr 06, 2017 12:27 am

Re: Environmental Damage Falloff on Cone Attacks

Post by Psieye »

Good to know I can EXO punch through a wall at melee range and (just about?) guarantee the wall won't break.
My three 8-man GOp squad Commander campaigns:
1st
2nd
3rd
faket15
Posts: 111
Joined: Fri Jun 30, 2017 6:41 pm

Re: Environmental Damage Falloff on Cone Attacks

Post by faket15 »

Psieye wrote:Good to know I can EXO punch through a wall at melee range and (just about?) guarantee the wall won't break.
Yes, you can guarantee it. Shredder Guns shot from up to 3 tiles away do 1-2 environmental damage, only enough to destroy very fragile 1 HP objects. They do 3-5 at 4-7 tiles away, 5-7 at 8-12 tiles and 7-10 at 13-15.

Shredstorm Cannons do 2-3 up to 6 tiles away, 4-7 at 7-12, 6-10 at 13-20 and 9-14 at the optimal range of 21-25 tiles.
Swiftless
Posts: 59
Joined: Wed Apr 26, 2017 4:31 pm

Re: Environmental Damage Falloff on Cone Attacks

Post by Swiftless »

Seems highly counter intuitive that environmental damage increases at range. Are those damage numbers pulled from an .ini file?
faket15
Posts: 111
Joined: Fri Jun 30, 2017 6:41 pm

Re: Environmental Damage Falloff on Cone Attacks

Post by faket15 »

Swiftless wrote:Seems highly counter intuitive that environmental damage increases at range. Are those damage numbers pulled from an .ini file?
Yes, it is very counterintuitive. Not only that, but AFAIK it isn't documented anywhere in the game files. I only understood it by making tests and checking what exactly happened in each test using the log files.

The numbers don't come directly from the ini files but I calculated them from other numbers that do. If you are interested in how I reached these numbers I will explain a few things about the way environmental damage works.

First you start with the weapon's base environmental damage (9 for the Shredder, 12 for the Shredstorm) then you add a random amount between -20% and +20% of the base and after that you round it down (9 becomes 7-10, not 7.2-10.8). Unlike unit damage this roll is done only once for the entire attack, not repeated for every single object. This is the environmental damage in the center of the explosion.

After the environmental damage is calculated you apply the falloff. The way the falloff works for environmental damage is that you check the ratio between the distance to the center and the radius of the explosion and compare with a table that gives you a multiplier (1.0 if the ratio is lower than 0.2, 0.75 if the ratio is between 0.2 and 0.5, 0.5 if it's between 0.5 and 0.75 and finally 0.25 if the ratio is greater or equal to 0.75). After you apply the multiplier you round down again.
The13Inquisitor
Posts: 32
Joined: Fri Dec 01, 2017 12:10 pm

Re: Environmental Damage Falloff on Cone Attacks

Post by The13Inquisitor »

Is there any way to reverse the values, given that the Shredder Gun\storm cannon is basically an upscale shotgun it ought to work the other way around?
faket15
Posts: 111
Joined: Fri Jun 30, 2017 6:41 pm

Re: Environmental Damage Falloff on Cone Attacks

Post by faket15 »

The13Inquisitor wrote:Is there any way to reverse the values, given that the Shredder Gun\storm cannon is basically an upscale shotgun it ought to work the other way around?
I believe you could do this by changing the ApplyEffectToWorld function in X2EffectApplyExplosiveFalloffDamage to check whether or not the attack is a cone before calling FilterTilesByStep and then, if it is a cone, pass SourceUnitLocation instead of DamageEvent.HitLocation. You also need to do a similar change to CalculateDamageAmount to correct the falloff for unit damage and probably while you are there correct the typo in GetUnitDamageRatio that makes unit damage falloff less severe than intended (DistanceRatio >= Step.DistanceRatio should actually be DistanceRatio < Step.DistanceRatio)

Doing this will be a huge nerf to these weapons so you probably want to bring their environmental damage back to 1.2 levels. Note that the last change I recomended also affects grenades and rockets and makes the Tandem Warheads perk more attractive.
Post Reply