Difference between revisions of "Sky never changes in Doom II"

From DoomWiki.org

[unchecked revision][unchecked revision]
(Bug is displayed when warping, not from the menu)
(Added -playdemo case)
Line 1: Line 1:
 
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.
 
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 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.  For example, if a player were to "warp" to level 1 and play play through all 32 levels of Doom II, the sky would never change from the brown cloudy sky (SKY1) found on MAP01. However, the sky is reset per section when the game is started from the menu, making the bug less obvious to more casual players.
+
Because of a bug in the way the sky image is set, the sky will never change when the IDCLEV level warp cheat is used, when the game is reloaded from a saved game, or when the game is started from the command line with the '-warp' or the '-playdemo' command line parameters.  For example, if a player were to "warp" to level 1 and play play through all 32 levels of Doom II, the sky would never change from the brown cloudy sky (SKY1) found on MAP01. However, the sky is reset per section when the game is started from the menu, making the bug less obvious to more casual players.
  
 
== Technical ==
 
== Technical ==

Revision as of 01:50, 23 February 2008

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 when the IDCLEV level warp cheat is used, when the game is reloaded from a saved game, or when the game is started from the command line with the '-warp' or the '-playdemo' command line parameters. For example, if a player were to "warp" to level 1 and play play through all 32 levels of Doom II, the sky would never change from the brown cloudy sky (SKY1) found on MAP01. However, the sky is reset per section when the game is started from the menu, making the bug less obvious to more casual players.

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, in the released Doom source code, extra code was added into G_LoadLevel to set the sky. Because of this, most source ports will also not exhibit the bug.