Kill percentage flag used for -nomonsters and respawning

From DoomWiki.org

In the Doom source, the MF_COUNTKILL flag (used to calculate how many monsters are in a level, for the kill percentage) is also used to determine which monsters are hidden with the -nomonsters command line argument, and which monsters will respawn on Nightmare!. This has some unexpected consequences.

Lost souls[edit]

The lost soul monster had this flag removed for all engine versions beginning with Doom II's initial release. Likely, it was done to prevent the new pain elemental monster from skewing the kill percentage, or even making 100% impossible by ejecting lost souls through walls.

As a consequence to this, lost souls do not respawn. However, they are hidden with -nomonsters, due to a specific hack in p_mobj.c :

   // don't spawn any monsters if -nomonsters
   if (nomonsters
       && ( i == MT_SKULL
            || (mobjinfo[i].flags & MF_COUNTKILL)) )
   {
       return;
   }

Commander Keen[edit]

The Commander Keen object, which only appears in vanilla Doom on MAP32: Grosse (Doom II), is tagged with MF_COUNTKILL. Deathmatching with the -nomonsters causes Keen not to appear. Because killing the four Keens is needed to expose the end to the level (via tag 666), the level cannot be exited when using -nomonsters, unless one is also using the -timer command.

Other special actions[edit]

MAP07: Dead Simple has monsters that must be killed to access the exit, but has another exit reachable via a deathmatch spawnspot, and so can be exited in that mode even with -nomonsters. With some difficulty, the normal exit can also be accessed by rocket jumping or by zero press.