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

CraterLevel

From ModEnc
Jump to navigation Jump to search
Tiberian Dawn The Covert Operations Red Alert Counterstrike Aftermath Tiberian Sun Firestorm HyperPatch Red Alert 2 Yuri's Revenge Ares Generals Zero Hour Tiberium Wars Kane's Wrath
Flag: CraterLevel
File(s): rules(md).ini
Values: Signed integers: All whole numbers from -2147483648 to 2147483647; in rare cases, only from -32768 to 32767.
Default: 4
Applicable to: General

Logic related to CraterLevel, as a whole or in part, is obsolete in Red Alert 2 and/or Yuri's Revenge.



The size of the crater created when a shape or voxel debris with IsMeteor=yes lands.

Notes

Reverse-Engineered Content
The following page/section possibly contradicts several ideas accepted by the community. However, it contains information reverse-engineered from the game's executable code, not observations or theories, and as such should be considered more likely to be correct.

The craters here do not create SmudgeTypes of Crater=yes on the ground, but instead use the proprietary terrain destruction function of Tiberian Sun to depress downward a crater-like terrain that truly exists in logical space.

Available values Effect overview
<=0
(Otherwise)
Whenever processing is performed, attempt to create a crater at the center.
Attempt to create a crater once at the landing point;
0 Processing is only performed if CraterLevel is non-zero.
Do not create craters.
1
(Otherwise)
Whenever processing is performed, attempt to create a crater at the center.
Attempt to create a crater once at the landing point;
If CraterLevel > 1, enumerate the 8 direction indices [0,7], and attempt to create a crater in the adjacent cell in the direction of the index value if the index value % 2 || CraterLevel > 2.
2 If 1 < CraterLevel <= 2, then attempt only when the indices are 1, 3, 4, 7 in these directions.
Attempt to create a crater once at the landing point and at each of the 4 adjacent cells in the intercardinal directions;
3 If CraterLevel > 2, then attempt in the adjacent cells of all 8 directions.
Attempt to create a crater once at the landing point and at each of the 8 adjacent cells;
>=4 If CraterLevel > 3, additionally attempt to create a crater at the center once more.
Attempt to create a crater once at the landing point and at each of the 8 adjacent cells, and then additionally attempt to create a crater once more at the landing point.

Each attempt to create a crater will randomly sink down one cell among the cell (X,Y) itself and its three adjacent cells in the southeast direction[1], which are (X+1,Y), (X,Y+1), and (X+1,Y+1).

From this, the theoretical[2] maximum number of subsidence times for each cell is as follows:

0 1 2 3 4
-1 0 1 2
-1 0 0 0 0
0 0 0 0 0
1 0 0 0 0
2 0 0 0 0
-1 0 1 2
-1 0 0 0 0
0 0 1 1 0
1 0 1 1 0
2 0 0 0 0
-1 0 1 2
-1 1 1 1 1
0 1 2 2 1
1 1 2 2 1
2 1 1 1 1
-1 0 1 2
-1 1 2 2 1
0 2 4 4 2
1 2 4 4 2
2 1 2 2 1
-1 0 1 2
-1 1 2 2 1
0 2 5 5 2
1 2 5 5 2
2 1 2 2 1

Footnotes

  1. Logically the due southeast direction corresponds to directly downward on the screen.
  2. Not considering failures due to being at the map boundary or other reasons.

See Also