Doom II monster exclusion bug
From DoomWiki.org
The Doom II monster exclusion bug is a logic bug in vanilla Doom's P_LoadThings() function which can cause a large number of things on the level to fail to spawn when a level using Doom II thing types is loaded in Doom or The Ultimate Doom.
Background[edit]
When developing Doom II, the id Software team added a number of new monster types. However, only DOOM2.WAD contains the sprites needed for these new monsters; if a developer tried to load a level containing Doom II monsters using DOOM.WAD, the game would have crashed.
To work around this problem, the following code was added to P_LoadThings(), the function in the Doom source code that spawns every item in a level when it is loaded:
spawn = true; // Do not spawn cool, new monsters if !commercial if ( gamemode != commercial) { switch(mt->type) { case 68: // Arachnotron case 64: // Archvile case 88: // Boss Brain case 89: // Boss Shooter case 69: // Hell Knight case 67: // Mancubus case 71: // Pain Elemental case 65: // Former Human Commando case 66: // Revenant case 84: // Wolf SS spawn = false; break; } } if (spawn == false) break;
The bug[edit]
In the above code snippet, the final break; statement should have read continue;. The unintentional effect is that once a Doom II monster type is encountered, no more items will be spawned at all, when the intention was that only that one monster should not be spawned.
Various source ports have different behaviors related to this code, or fix it in different ways:
- Bug is not fixed (the vanilla behavior is preserved) - true for Chocolate Doom
- Bug is fixed and logic is retained (ie. will not spawn Doom II monsters) - true for Boom, MBF
- Special behavior for Doom II monsters is removed entirely - true for ZDoom-based ports, PrBoom, and the Eternity Engine.
One side effect of this bug is that it is not possible for DeHackEd patch authors to reuse the Doom II monster thing types if developing DeHackEd patches for use with Doom, unless the DoomEd numbers of the things are altered.