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

Pip Distortion Bug

From ModEnc
Revision as of 16:27, 14 April 2013 by AlexB (talk | contribs) (The mechanics behind the bug.)
Jump to: navigation, 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).

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.

More information at MP Modes#Pip= & OccupyPip=.