Open Crimsonum opened 3 years ago
I haven't researched the code in Tiberian Sun, but the Red Alert 1 algorithm for damage simply checks the impact cell and its surrounding cells (resulting in a 3x3) for objects to damage, regardless of the Spread
value. I guess the Spread
value is just taken into account later on when actually calculating the damage. https://github.com/electronicarts/CnC_Remastered_Collection/blob/master/REDALERT/COMBAT.CPP#L186
The related function is multiple times bigger and extremely more complex in Tiberian Sun, but from a quick look on things, the related code and limitation appears to still be there. The loop starts at 0x0045F38F
.
In the case of porting over CellSpread from RA2, know that it also by default has issues hitting multiple cells thus doing much more damage to buildings. Ares fixed most of the problems https://ares-developers.github.io/Ares-docs/new/warheads/cellspread.html.
See https://github.com/Ares-Developers/Ares/blob/master/src/Ext/WarheadType/Hooks.CellSpread.cpp
Description:
Damage spread is controlled by the
Spread
key in warheads. However, the effect is limited to an area of 3x3 cells around the impact, sans the corner cell spots (1/4ths of a cell that only infantry can occupy). Damage outside this area is impossible to achieve, except through more or less complex workarounds.Maximum damage spread can be achieved with
Spread=63
. This will deal full damage to the entire spread area. Warheads in the rules.ini have Spread values as high as 512. This may suggest that the intended area of effect was supposed to be much larger, although it could as well be an oversight.For reference,
CellSpread
, the system that replaces Spread in Red Alert 2, allows for a much larger area of effect, with a maximum radius of 11 cells from the impact site.Possible Implementation:
Make the area of effect unlimited, or if it has to capped due to technical reasons, then increase the cap by an order of magnitude.
Additional Files:
This graph shows what the spread area looks like, and what approximate percentages of damage different Spread values result in. The spread shape covers an area of 3x3 cells, with the four unaffected corners being individual cell spots, or 1/4ths of a cell.