ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Damage calculation over area: Difference between revisions

From ModEnc
Jump to navigation Jump to search
m Meh
Crimsonum (talk | contribs)
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The damage fades in linear regression from the center to the edge of the impact area, in cell-sized steps. So decreasing <tt>[[PercentAtMax]]</tt> creates an almost constant damage level over the area, meaning the targets at the edge receive almost as much damage as the ones in the center. The higher you set <tt>[[PercentAtMax]]=</tt>, the steeper the damage difference.
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-{{ra2}} titles and [[CellSpread]] introduced in {{ra2}}.


(If you graph the damage from center to edge, (Axis X = distance from edge, in cells, Y = % of original damage) then the derivative of that line will be equal to <tt>[[PercentAtMax]]</tt>/<tt>[[CellSpread]]</tt> .)
__TOC__
 
==In {{td}} and {{ra}}==
 
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 {{f|Spread|link}} flag in the warhead settings.
 
==In {{ts}} and {{fs}}==
 
The [[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|cell spots]], creating a roughly circular area. [[File:ts_warhead_spread_map.png|thumb|frame|This illustration shows all damage falloff patterns in {{ts}}. On each step from the epicenter, damage is decreased by 50% from the previous step. Note the maximum area of effect and the four corner [[Cell Spots]] which are excluded from it.]]
 
 
===Examples===
 
Below is a demonstration of damage falloff. In the left example, a warhead with {{f|Spread|52}} was 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 {{f|Spread|56}}. 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.
 
[[File:Ts_warhead_spread_52_demo.png]] [[File:Ts_warhead_spread_56_demo.png]]
 
==In {{ra2}} and {{yr}}==
Damage fades in linear regression from the center to the edge of the impact area, [[CellSpread|in cell-sized steps]]. {{f|PercentAtMax|link}} determines the percentage of damage left at the very edge of the affected area.


=== Example: ===
=== Example: ===
Line 11: Line 29:
  CellSpread=10
  CellSpread=10


Target A receives 100% original damage, Target B receives 1%, and Target C receives ~50%.
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:
If a different warhead is detonated, with stats:
Line 18: Line 36:
  CellSpread=10
  CellSpread=10


, Targets A and C receive 2% of the original damage, and Target B receives 1%. (This is used on the Nuke, to render all the affected area almost identically.)
Target A receives 100% of the original damage, Target B receives 2%, and Target C receives 51% (linear average = (100 + 2) / 2).
 
==Workarounds==
 
A common workaround to overcome the rather small area restriction in {{ts}} is to use invisible, [[Bouncer|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 {{ra2}} and {{yr}}, should [[CellSpread]] be insufficient.
 
Another method is to use [[cluster]] or [[splits]] projectiles, but they are hardcoded to a slow [[speed]] (approximately {{f|Speed|20}}).
 
A third method is to use [[ParticleSystems|particle systems]]. For example, a [[BehavesLike#BehavesLike.3DSmoke|smoke]] particle system can spawn [[BehavesLike#BehavesLike.3DGas|gas]] particles in a [[SpawnRadius|radius]], which in turn can deal damage. The downside of using gas particles is that they are hardcoded to [[TiberiumDeathToVisceroid|turn killed objects into Visceroids]]. Other particle types that can deal damage, like [[BehavesLike#BehavesLike.3DFire|fire]], have their own limitations.


[[Category: General Editing Information]]
[[Category: General Editing Information]]

Latest revision as of 07:40, 26 July 2022

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 Spread flag in the warhead settings.

In Tiberian Sun and Firestorm

The 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.

This illustration shows all damage falloff patterns in Tiberian Sun. On each step from the epicenter, damage is decreased by 50% from the previous step. Note the maximum area of effect and the four corner Cell Spots which are excluded from it.


Examples

Below is a demonstration of damage falloff. In the left example, a warhead with Spread=52 was 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 Spread=56. 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. PercentAtMax determines the percentage of damage left at the very edge of the affected area.

Example:

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:

PercentAtMax=1.0
CellSpread=10

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:

PercentAtMax=0.02
CellSpread=10

Target A receives 100% of the original damage, Target B receives 2%, and Target C receives 51% (linear average = (100 + 2) / 2).

Workarounds

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.

Another method is to use cluster or splits projectiles, but they are hardcoded to a slow speed (approximately Speed=20).

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.