A demo (also called LMP, from the lump file extension) is any recording of a game session that can be played back using the game engine. Internally, it is a sequence of tic commands, keeping track of just the input control states during each frame. Thus, a demo is much more compact than a video capture, or even than a recording of the states of all objects in the level.
If no game or demo is begun immediately when launching vanilla Doom (either from the in-game menus or by using command line arguments), three built-in demos soon begin to play repeatedly, evoking an arcade game. The demo levels in Doom are:
Final Doom contains the following built-in demos:
|Demo||TNT: Evilution||The Plutonia Experiment|
|DEMO1||MAP01: System Control||MAP17: Compound|
|DEMO2||MAP12: Crater||MAP10: Onslaught|
|DEMO3||MAP13: Nukage Processing||MAP12: Speed|
Demo levels in Heretic
|Demo||Heretic Shareware||Heretic Registered|
|DEMO1||E1M3: The Gatehouse||E2M9: The Glacier|
|DEMO2||E1M6: The Cathedral||E2M5: The Catacombs|
|DEMO3||E1M9: The Graveyard||E3M2: The Cesspool|
Demo levels in Hexen
|Demo||Hexen Demo version||Hexen version 1.0||Hexen version 1.1|
|DEMO1||Hub 1: Guardian of Ice||Hub 1: Guardian of Ice||Hub 1: Winnowing Hall|
|DEMO2||Hub 1: Winnowing Hall||Hub 4: Gibbet||Hub 1: Guardian of Fire|
|DEMO3||Hub 1: Guardian of Fire||Hub 4: Effluvium||Hub 4: Effluvium|
Demo levels in Strife
|Demo||Strife Shareware||Strife Registered|
|DEMO1||MAP32: Sanctuary||MAP02: Town|
When a GUI launcher, such as the Doom95 front end, is used to start the game, the launcher usually warps to a selected level and the built-in demos are bypassed. They can still be viewed, however, by choosing END GAME from the appropriate menu.
The built-in demos are stored in lumps in the IWAD file named DEMO1, DEMO2, and DEMO3. A PWAD can replace a built-in demo by including a lump with the same name, although an engine crash often results if the new demo is incompatible (see below).
Players can record demos of their own game sessions. This is done using the -record <name> command line argument, which places the recording in a file named <name>.lmp in the Doom program directory. A recording can subsequently be played back using the -playdemo <name> command line argument, where <name>.lmp is the name of the recorded demo. Unlike in the built-in demo sequence and when using -timedemo (see below), it's possible to toggle the automap mode while using -playdemo, because the feature that brings up the menu when pressing input keys or buttons is disabled.
These demo files can then be uploaded to websites and FTP servers to aid other players in the completion of the game, show off tricks, reveal secrets, or for competitive purposes (see Speedrun). It is also possible to record multiplayer games.
The -timedemo <name> parameter can be used as an alternative to -playdemo. This will render every frame in a demo as quickly as possible for benchmarking purposes.
A demo lump is a sequence of instructions which tells the game engine what actions the player will perform: when he will take a step forward, turn around, shoot, switch weapons, etc. It is interpreted by the engine as keyboard and mouse input, thereby allowing anyone to watch a recreation of the original recorded actions. While some elements of the game (such as damage done by attacks) are typically randomized, the usage of a pseudorandom number generator ensures they stay the same with every playback. Because the demo format is composed of a series of tic commands rather than a video of recorded gameplay, demo lumps are relatively small and were very practical back when computers were slow and Internet bandwidth was scarce. Back then it would certainly have been nearly impossible to distribute demos as video captures due to their large size.
Over the years, a few utility programs have been written to convert LMPs between the original binary format and other formats. One such program is LMPC, which can also be used for hex editing of demos (see TAS).
With few exceptions, demos can only be played back with the same versions of the Doom IWAD and executable or source port as those used during recording. If a demo is played on a different source port, using a different WAD(s), or even with a different version of the same source port or IWAD, it may refuse to run, or the actions of the player in the demo may become nonsensical, with the Doomguy crashing into walls and shooting apparently at random. This is known as "desynch", and indicates that the demo is not compatible with the playback method being used.
Display commands not affecting gameplay, such as chat text and the IDDT cheat code, are not recorded in a LMP file and may be used freely during playback. However, other cheat codes are not recorded either, and will almost certainly corrupt the demo if used during recording, or cause desynch if entered during playback.
Many of the demos on the Internet are of version 1.9 format, because it marks the final versions of the games. Older versions are rarer, as the engine versions they were recorded with are obsolete and did not have as much exposure to dedicated players over time. The idgames archive, for example, purged a number of older demos at one point, keeping only demos of the latest version. Additionally, this is the format used in Compet-n, the premiere speedrunning site for demos in the original levels of the games. Newer demo sites do include a good number recordings for source ports, however, especially of levels from user-made PWADs.
For some players, it is not practical or even possible to use the original Doom executables to play demos. The original executables were written for DOS, and require DOS or a DOS-like OS environment to function properly. While this has been made easier with the development of the multi-platform DOSBox emulator, there are also alternatives among the source ports, as most, though not all, demos recorded with id Software's DOS executables will play properly in PrBoom, the Eternity Engine, or Chocolate Doom because these ports are specifically designed to emulate vanilla Doom as closely as possible. On the other hand, an assortment of modern source ports, such as Doomsday or ZDoom, do not record demos in Doom's original demo format, because their movement code requires the recording of extra data (such as Y-axis viewpoints and trajectories, jumping, or even flat heights and thing dispositions as in a savegame) even if the associated features are not being utilised.
Other issues that can affect recording or playback:
- Demo desyncing caused by bouncing Lost Souls
- Demo desyncing caused by menu access
- Turning resolution is lowered when recording demos