Door

[[Image:E1M7 start.png|thumb|A characteristic [[Knee-Deep in the Dead|E1]] door in E1M7

Surfaces: BIGDOOR4 Doorjambs: DOORTRAK Ceiling flat: FLAT20 Type: Unlocked, stays open]] Doors in Doom, Heretic and Strife only go up and down. This is because the NODES tree is prebuilt and not modified at runtime, and thus all linedefs must stay in the same place (when the level is viewed from above). However, Hexen introduces more flexible doors that can be made using polyobjects.

Doors can be activated by pressing USE key in range lower than 48 units, just like switches are.

A closed door is constructed as a sector whose ceiling and floor are both at the same height as the neighboring sectors' floors. When the door is opened, its ceiling moves up at a controlled rate to four units below the lowest adjacent ceiling.

The doorjambs (or doortracks) are the walls exposed at the sides as the door opens. They are usually specified with the lower unpegged bit, which causes them to be drawn from the floor up rather than from the ceiling down as usual. When this bit is not used, the doorjambs move up and down with the door.

There are many textures designed specifically for doorjambs, a common one being DOORTRAK. Some door textures also have a special cosmetic purpose: EXITDOOR indicates the final door of the map and DOOR3 is the main texture for an entrance "door", a wall that is only textured to look like a door. These two types of door are used in Doom and (less frequently) in Doom II. Most of these textures are 16 units wide, and thus most IWAD doors are of this thickness as well.

The precise behavior of a door is dictated by the type field of the linedef that activates it. Doors themselves can be given a variety of types that determine, for instance, whether the doors stay open or close four seconds after reaching their destination heights. For unlocked closing doors, one can also choose if the player is able to activate them again while they are in motion or in their up position. Some of the linedef types require a key, and the corresponding door is thus locked. Generally, locked doors are bordered with a distinctive frame or have an alternative sign in the appropriate color.

Doom II presents fast doors that move in a higher speed in comparison with the original ones and have their own sound effects. It also adds a group of linedef types that allow door switches to be "locked". When the player has the correct key, a switch can be activated to open a fast door permanently. The feature is only used in Ultimate Doom and Final Doom.

A door does no damage to the player or monsters if it closes upon their head. However, in Doom or Hexen a closing door will crush corpses into a pool of blood. This applies to many monster types but not all. Items dropped by monsters and trapped beneath a closing door vanish and are removed from play.

Sliding doors
Linedef type 124 can be used to create a type of sliding door in the v1.4 and v1.5 betas. The code for these doors is restricted to Doom II, likely because of their reliance of hardcoded texture definitions loaded at runtime, which are not present in the Doom IWAD and will cause the game to error out on startup.

These doors work by animating the front side of a two-sided, impassible linedef through the textures GDOORF1-4 when the door is activated, while the back side animates GDOORB1-4. After opening, the door texture is removed entirely and the linedef's impassible flag is unset, allowing players and monsters to pass through. After being open for a time, the process is reversed, with the door cycling the textures in the opposite order and setting the impassible flag when closed.

These doors, being created with two-sided linedefs, do not block hitscan or projectile attacks and do not block line of sight. They were long speculated to have been created for the secret Wolfenstein 3D levels due to them being restricted to Doom II, however patches depicting four frames of animation for a large gate opening were included in the graphical resources released by John Romero in 2015; these appear to have been the intended textures, and explain why the doors don't block sight or attacks. Interestingly, however, earlier resources seem to have been created for solid doors similar to Hexen's polyobjects.

While sliding doors were abandoned before the final version of Doom II was released, the code was used by Rogue Entertainment as the basis for the special sliding and portal-style animated doors used in Strife. Remnants of their code is still present in the Doom source code, where it has been commented out. The feature can be reenabled via additional code or by applying patches. A patch for Chocolate Doom is available here. A video demonstration is also available at YouTube.

EDGE has native sliding door code, between linetypes 442-453 via Lines.DDF. Those line types are also used with EDGE's BSP conversion of Wolfenstein 3D's map format.

Trivia

 * Two sector types, 10 and 14, offer door behavior that is independent of linedef types. The former makes its host sector close when thirty seconds have elapsed from the level startup. The latter commands its sector to open when the player has been in the level for five minutes. An example of a type 10 sector is found in MAP27: Monster Condo where a secret compartment in the northern hall (with the super shotgun) becomes blocked for good after half a minute.
 * E2M3: Refinery is a special map in usage of door textures. It is the only stock level to have EXITDOOR texture depicting an entrance door. The locked blue door also has skull frames although the key itself is a card, not a skull. A similar oddity can be met in MAP24: The Chasm. Both may be meant as signs of Hell's influence warping the locations.