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

Crater

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: Crater
File(s): rules(md).ini for SmudgeTypes, art(md).ini for Animations
Values: Boolean values: yes or no, true or false, 1 or 0
Default: no
Applicable to: SmudgeTypes, Animations


On SmudgeTypes

Specifies whether or not this smudge is a crater, i.e. produced by animations with Crater=yes as described below.

On Animations

Specifies if this animation should leave behind a crater smudge. Which smudge type to place is decided according to the formula below.

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.

Formula

When an Animation has a spatial height below 30 leptons, it checks for the presence of Scorch=yes:

  • If Scorch=yes, then check the value of Crater=:
    • If Crater=yes, there is a probability of 1073741824 / 2147483647 ≈ 0.5000000002328306 to attempt to create SmudgeTypes with Crater=yes, using the following rules:
      • Before creation, remove 6 layers of Tiberium OverlayTypes (if any) in the cell[1].
      • Then randomly create a Crater, first checking the state of the target cell:
        1. The cell is within the currently visible area of the map (In Radar).
        2. The terrain in the cell is not a slope.
        3. There is no SmudgeType or OverlayType on the cell.
        4. If ForceBigCraters=no, then avoid cells containing BuildingTypes.
        5. The TileSet type used by the cell is Morphable=yes.
      • Then collect all SmudgeTypes with Crater=yes into the first layer list.
        • If ForceBigCraters=no, which SmudgeTypes can enter the second layer list depends on the dimensions of the middle frame[2]. If the width is greater than 60 and the height is greater than 50[3], then all SmudgeTypes can enter. Otherwise, only SmudgeTypes with Width=1 and Height=1 can enter.
          • Since Westwood often lists animations from small to large in [Warhead]AnimList=, corresponding to from low to high [Weapon]Damage= values, this cleverly simulates the correlation that weapons with higher damage leave larger craters.
        • If ForceBigCraters=yes[4], only SmudgeTypes of size 2x2 or larger enter the second layer list.
          • At this point, if there are insufficient empty cells to place SmudgeTypes of size 2x2 or larger, it will fall back to the first layer list for random selection.
    • Meanwhile, there is another probability of 1073741823/2147483647 ≈ 0.4999999997671694 to attempt to create SmudgeTypes with Burn=yes, using rules similar to those for creating SmudgeTypes with Crater=yes, but always avoiding cells containing BuildingTypes.
    • If Crater=no, then 100% to attempt to create SmudgeTypes with Burn=yes, with the rules as above;
  • If Scorch=no, then check the value of Crater=:
    • If Crater=yes, then 100% to attempt to create SmudgeTypes with Crater=yes, with the rules as above;
    • If Crater=no, then end the judgment and do not create any SmudgeTypes.

SmudgeTypes are created when the Shape file plays to the middle frame[5]. In other words, for an Animation with a Loop, it will attempt to create once every time it reaches the corresponding frame in the cycle defined by LoopCount=.

Footnotes

  1. This also means that if the Tiberium is removed to the point of complete destruction, allowing SmudgeTypes to be created, the created one must be a Crater rather than a Burn Marker, because only the branch for creating the former has the operation of removing Tiberium before creation.
  2. For Shape files with an even total frame count, it is the frame that is later in the middle, e.g., for a shape file with a total length of 12 frames, it is the 7th frame (1-based).
  3. For Tiberian Sun and Firestorm, it requires width greater than 48 and height greater than 40.
  4. The part related to ForceBigCraters=yes is only valid in Red Alert 2 and Yuri's Revenge.
  5. For shape files with an even total frame count, it is at the end of the frame just before the middle; for example, for a shape file with a total length of 12 frames, it is at the end of the 6th frame and before the 7th frame starts playing (1-based). That is to say, if this Animation has End= restricting the playback sequence, then End= must be at least 6 for SmudgeTypes to be created normally.

See Also