Sky never changes in Doom II

From DoomWiki.org

Revision as of 17:38, 17 April 2006 by Fraggle (talk | contribs) (weird one)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In Doom II, there are three background images used to display the sky in different sections of the game. The first sky (SKY1) is used for levels 1-11, the second (SKY2) for levels 12-20, and the third (SKY3) for levels 21-32.

Because of a bug in the way the sky image is set, the sky will never change. For example, if a player were to play through all 32 levels of Doom II without reloading from a saved game, the sky would never change from the brown cloudy sky (SKY1) found on MAP01.

However, the sky is reset when the IDCLEV level warp cheat is used, the game is reloaded from a saved game or the game is started from the command line with the '-warp' command line parameter. Because it is unusual for anyone to play through the entire game in one sitting, the effect is not normally noticed.

Technical

The code which sets the sky is found in g_game.c, in the function G_InitNew. This is called when a new game is started: eg. when using the IDCLEV cheat, the "new game" option from the menu or when loading from a saved game. However, this function is not called at the start of every level, only at the initial start of the game.

The problem arises because the code is an extension to the code used to set the sky for Doom 1. In Doom 1, this was not a problem, as each episode had a separate sky background, and players do not progress between episodes without starting a new game.

However, the Final Doom executable (the version of doom2.exe shipped with Final Doom) does not suffer from the problem, as extra code was added into G_LoadLevel to set the sky. Because the Doom source release was derived from the Final Doom source, most source ports will also not exhibit the bug.