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

Pip Distortion Bug

From ModEnc
Jump to navigation Jump to search

The Pip Distortion Bug is triggered when you alter any infantry from an INI like an MP Mode file or a map without (re-)stating the pip settings for the unit in question. Its effect is that, if the unit enters any other object that displays a pip, the pip will get distorted (hence the name).

Example

Let's take the GI as an example. We are going to edit the GI in a game mode INI or map as follows:

[E1]
Strength=200

When we play in-game we will find that both the colour and shape of the GI's pip (when inside a transport or occupying a building) have been changed or 'messed up'. The same applies to any infantry unit you modify.

To fix this problem, you must restate Pip and OccupyPip for every infantry type section in the game mode INI or map file like this:

[E1]
Strength=200
Pip=white
OccupyPip=PersonBlue

Reasons

The bug only affects Red Alert 2 and Yuri's Revenge. It occurs because Westwood removed the empty item from the internal list that maps string values to frame indexes. Because the pip frame index defined in the previous loaded INI is used as the default for reading the next INI value (as an index into the mapping list), the default value is now off-by-one and the wrong default value is used. If the Pip or OccupyPip tag is not defined, the wrong default value is converted to its corresponding frame index.

In Yuri's Revenge, the mapping list was amended by the person pips, which leave out frame index 6 (which would be "personempty"). Thus, the frame index actually becomes off-by-two for the person pips each time they are read.

Because the pip frame index can be larger than the number of items in the mapping list, the game overflows into the following PipScales mapping list, using ammo (and in YR also tiberium) as default, which cannot be mapped back to a valid pip frame index. The game resets the value to green in this case.