Damage calculation over area
Splash damage, or damage over area, is a common feature in video games. In classic C&C games, there are two main systems that enable damage to spread over an area: the Spread mechanic in pre-Red Alert 2 titles and CellSpread introduced in Red Alert 2.
In Tiberian Dawn and Red Alert
When a warhead detonates, damage will fade in ring-shaped steps from the epicenter of the explosion. On each step the damage is decreased by 50%, resulting in an exponential curve where damage drops quickly at first, then slowly fades away the further you get from the epicenter. The radius of these steps is controlled by the flag in the warhead settings.
In Tiberian Sun and FirestormThe Spread system is carried over from RA, with a few minor changes. Damage spread in total is limited to a 3x3 area, minus the corner cell spots, creating a roughly circular area.
Below is a demonstration of damage falloff. In the left example, a warhead withwas detonated at the center of the circle (red spot). The warhead was configured to kill the target Technicians only if damage was dealt in full and no falloff occurred. In the left example, all settings are the same, except the warhead was changed to have . Note that the Technicians standing in the left, bottom and right corners are just outside the maximum area of effect hardcoded to the engine, hence they are left unscratched.
In Red Alert 2 and Yuri's Revenge
Damage fades in linear regression from the center to the edge of the impact area, in cell-sized steps. determines the percentage of damage left at the very edge of the affected area.
Imagine three identical targets, the first one (A) placed at the impact point, the second one (B) at the edge of the impact zone, and the third (C) in the middle of them.
Upon detonation of a warhead with stats:
Target A receives 100% original damage, Target B receives 100%, and Target C receives 100% as well.
If a different warhead is detonated, with stats:
Target A receives 100% of the original damage, Target B receives 2%, and Target C receives 51% (linear average = (100 + 2) / 2).
A common workaround to overcome the rather small area restriction in Tiberian Sun is to use invisible, debris-like animations. Such animations can use any warhead and carry damage over to any distance, but they're susceptible to terrain obstacles, buildings and water, and cannot be used by units to gain rank. This workaround also works in Red Alert 2 and Yuri's Revenge, should CellSpread be insufficient.
A third method is to use particle systems. For example, a smoke particle system can spawn gas particles in a radius, which in turn can deal damage. The downside of using gas particles is that they are hardcoded to turn killed objects into Visceroids. Other particle types that can deal damage, like fire, have their own limitations.