Deducing Damage Radius - sh4rkman/SquadCalc GitHub Wiki
⬅️
Previous: Deducing Spread
•
Next: Deducing Time of Flight
➡️
In Unreal Engine, damage falloff is a feature that reduces the damage a weapon or ability deals based on the distance between the source and the target.
In summary:
- Damage Falloff : Defines how damage decreases over distance. The bigger it is, the fastest the explosion stops doing damage.
- Start Distance: The distance at which the damage begins to decrease.
- End Distance: The distance at which the damage reaches its minimum value (often zero).
The damage falloff can be calculated using a formula or a curve. Here, let's use a simplified exponential falloff formula to understand the concept:
Where:
-
MaxDamage
is the initial damage at 0 distance. -
Distance
is the current distance from the damage source. -
Falloff
is the rate at which damage decreases. -
StartRadius
is where the MaxDamage start decreasing -
EndRadius
is where the damage stops
Since we're looking for the distance at which we will take X damage, let's turn the formula around :
Most of these values are coming from SquadSDK, you can find them in the /src/data/weapons.js
file.
Let's try this scary formula with regular mortar :
- explosion Damage: 350
- explosion Start Radius : 0m
- explosion End Radius : 40m
- damage falloff : 7
We want to find the distance from impact where the enemy will take 100hp (aka the killzone) :
The mortar will deal 100 damage to anyone in a 6,55 meter radius from the impact !
We can do the same for let's say 25 damage :
We're almost here, but if we want to be perfectly accurate about the damage radius, we should take into account the fact that the explosive part of Unreal Engine Explosions are often set to explode above ground to avoid taking no damage when the ground isn't perfectly flat. It means the radius is not exactly on the ground but sometimes 1, 2 or even 10 meters in the air in the case of M121 airburst rounds.
That means that now that we know the radius of the explosion that will remove 100hp, we need to find the flat 2d distance on the ground where this radius will catch a character size of 180cm.
Drawing the problem, we see a classic square triangle where we know two sides, Pythagoras help us !
Lets switch to the M121 airburst rounds for a practical example : they have a 10m kill radius but they also explode at 10m altitude :
Huge difference : drawing a 2d map, the kill radius is not 10m anymore now that we take explosion height into account, but 5.7m. For the other rounds the difference is less noticable because they explode closer to the ground but by implementing this quick formula we're now very precise and ingame accurate.
⬅️
Previous: Deducing Spread
•
Next: Deducing Time of Flight
➡️