Demo

From DoomWiki.org

For information about the free promotional releases with limited content, see Shareware.

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.

Built-in demos[edit]

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's attract mode.

The majority of demos are recorded on the Ultra Violence skill level, and most end with the player's death.

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).

Doom[edit]

Each new version of Doom changed the engine in ways which made the existing demos desync, and so they had to be re-recorded (see issues below). The map choice, game-mode and approach to each demo shows a progression in the recorder's thinking about the purpose of the demos and how much of the game should be revealed.

All demos in Doom and Doom II were recorded by John Romero.[1]

Shareware[edit]

The shareware releases of Doom necessarily limited the demo loop to maps from Knee-Deep in the Dead. The earliest recorded demos are single player run-throughs and occasionally they show the complete level. Later recordings demonstrate other game modes and the play-style is more "tense": the player takes a lot of damage early on and limps on with very low health. By version 1.6, the players always die before completing the levels.

Version DEMO1 DEMO2 DEMO3
0.99 E1M2: Nuclear Plant
Duration 1:00[1]
E1M5: Phobos Lab
Duration 5:34[2]
E1M7: Computer Station
Duration 1:23[3]
1.1 E1M2: Nuclear Plant
Duration 2:42, completes level[4]
E1M5: Phobos Lab
Duration 6:39[5]
E1M7: Computer Station
Duration 6:29[6]
1.2 E1M2: Nuclear Plant
Duration 4:13, completes level[7]
E1M5: Phobos Lab
Duration 1:19[8]
E1M7: Computer Station
Duration 7:11, completes level[9]
1.4 beta E1M3: Toxin Refinery
Duration 2:56[10]
E1M5: Phobos Lab
Duration 5:08, 2 player cooperative[11]
E1M9: Military Base
Duration 0:53[12]
1.5 beta E1M3: Toxin Refinery
Duration 3:44, completes level[13]
E1M5: Phobos Lab
Duration 4:29, 2 player cooperative[14]
E1M7: Computer Station
Duration 2:25[15]
1.6 beta E1M3: Toxin Refinery
Duration 3:00[16]
E1M5: Phobos Lab
Duration 1:43, 2 player cooperative, turns into DM[17]
E1M7: Computer Station
Duration 3:20[18]
1.666 As above As above As above
1.8 E1M5: Phobos Lab
Duration 2:24, Hurt Me Plenty[19]
E1M3: Toxin Refinery
Duration 1:50, Hurt Me Plenty[20]
E1M7: Computer Station
Duration 1:01, Hurt Me Plenty[21]
1.9 As above As above As above

Registered and Commercial[edit]

The earlier versions of demos from the registered games exclusively demonstrate levels from The Shores of Hell and Inferno, perhaps to show the game owner new content, as they will have already seen Knee-Deep in the Dead prior to registering. As later releases of Doom were sold commercially as well as via registering the shareware, Episode 1 demos are brought back into the mix. By version 1.666 there is one demo per episode.

The Ultimate Doom introduced a fourth demo, DEMO4.

Version DEMO1 DEMO2 DEMO3 DEMO4
Registered 1.1 E2M4: Deimos Lab
Duration 2:19[22]
E3M3: Pandemonium
Duration 3:49[23]
E3M6: Mt. Erebus
Duration 3:30[24]
-
Registered 1.2 E2M4: Deimos Lab
Duration 5:29, Hurt Me Plenty[25]
E3M6: Mt. Erebus
Duration 2:21[26]
E2M2: Containment Area
Duration 4:44[27]
-
Registered 1.666 E1M5: Phobos Lab
Duration: 0:49[28]
E2M2: Containment Area
Duration: 1:08[29]
E3M5: Unholy Cathedral
Duration: 1:50[30]
-
1.9 As above As above As above -
Ultimate Doom As above As above As above E4M2: Perfect Hatred
Duration: 0:23[31]

Commercial ports[edit]

Version DEMO1 DEMO2 DEMO3
Doom Classic (iOS) E1M5: Phobos Lab E2M2: Containment Area E3M5: Unholy Cathedral
Doom Classic E1M5: Phobos Lab E2M2: Containment Area E3M5: Unholy Cathedral

Doom II[edit]

Version DEMO1 DEMO2 DEMO3
1.666 MAP11: Circle of Death
Duration: 2:03[32]
MAP05: The Waste Tunnels
Duration: 0:57[33]
MAP26: The Abandoned Mines
Duration: 2:08[34]
1.7, 1.7a, 1.8 As above As above As above
1.9 MAP11: Circle of Death
Duration 0:34[35]
As above As above

Commercial ports[edit]

There was no demo loop in Doom for Game Boy Advance.

Version DEMO1 DEMO2 DEMO3
Doom Classic MAP11: Circle of Death MAP05: The Waste Tunnels MAP26: The Abandoned Mines

Final Doom[edit]

The Final Doom engine was based on Ultimate Doom, which loops through four demos. However, only three demo lumps are provided, so the game crashes after playing DEMO3. This was fixed in the Id Anthology version of Final Doom.[36]

Game DEMO1 DEMO2 DEMO3
TNT: Evilution MAP01: System Control
Duration 2:09[37]
MAP12: Crater
Duration: 1:44[38]
MAP13: Nukage Processing
Duration: 1:38[39]
The Plutonia Experiment MAP17: Compound
Duration: 3:31[40]
MAP10: Onslaught
Duration: 1:39[41]
MAP12: Speed
Duration: 2:42[42]

Heretic[edit]

Following the pattern set by shareware Doom, the shareware demos are necessarily restricted to the first episode, and the registered version ignores the first episode and focuses only on registered material.

The demos were not re-recorded for the 1.2 update of Heretic and consequently two of the three in the registered version desynchronise. Despite adding two episodes, no further work was done on demos for Shadow of the Serpent Riders, the two new episodes are unrepresented and the two desynchronised demos remain.

Version DEMO1 DEMO2 DEMO3
Wide-area beta E1M1: The Docks
Duration: 0:58
E1M2: The Dungeons
Duration: 1:18
E1M3: The Gatehouse
Duration: 1:53
Shareware 1.0 E1M3: The Gatehouse
Duration: 1:18
E1M6: The Cathedral
Duration: 1:41
E1M9: The Graveyard
Duration: 0:37
Shareware 1.2 E1M3: The Gatehouse
Duration: 1:18[43]
E1M6: The Cathedral
Duration: 1:41[44]
E1M9: The Graveyard
Duration: 0:37[45]
Registered 1.0 E2M9: The Glacier
Duration: 0:57
E2M5: The Catacombs
Duration: 1:32
E3M2: The Cesspool
Duration: 1:00
Registered 1.2 As above, desyncs[46] As above[47] As above, desyncs[48]
Shadow of the Serpent Riders As above[49] As above[50] As above[51]

Hexen[edit]

Version DEMO1 DEMO2 DEMO3
Demo beta Hub 1: Winnowing Hall (Cleric)
Duration: 1:47
Hub 1: Guardian of Fire (Mage)
Duration: 2:11
Hub 1: Guardian of Ice (Fighter)
Duration: 1:06
Demo version 1.0 Hub 1: Guardian of Ice (Fighter)
Duration: 0:54
Hub 1: Winnowing Hall (Cleric)
Duration: 1:24
Hub 1: Guardian of Fire (Mage)
Duration: 1:26
Full version 1.0 Hub 1: Guardian of Ice (Fighter)
Duration: 0:28[52]
Hub 4: Gibbet (Cleric)
Duration: 1:15[53]
Hub 4: Effluvium (Mage)
Duration: 1:09[54]
Full version 1.1 Hub 1: Winnowing Hall (Fighter)
Duration: 1:21[55]
Hub 1: Guardian of Fire (Mage)
Duration: 1:18[56]
Hub 4: Effluvium (Cleric)
Duration: 1:01[57]
Deathkings of the Dark Citadel Hub 1: Ruined Village (Fighter)
Duration: 1:53[58]
Hub 2: Market Place (Mage)
Duration: 1:23[59]
Hub 3: Chantry (Cleric)
Duration: 1:24[60]

Strife[edit]

Version DEMO1
Demo MAP32: Sanctuary
Duration: 3:28
Registered MAP02: Town
Duration: 1:04

Strife: Veteran Edition does not play back a demo during its attract sequence. Instead, a special text screen is displayed which reiterates the back story given in the game's instruction manual.

Custom demos[edit]

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. You can also add the -warp <map number> command to start recording from a specific map. 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.

Technical information[edit]

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.

Doom[edit]

The file starts with a header that specifies the map, skill level, and number of players. Versions after 1.2 extend the 7-byte header to 13 (0xD) bytes to also include information about the game version the demo was recorded with, what multiplayer mode was used, whether the -respawn, -fast, and -nomonsters parameters were used, and which player's point of view should be used.

byte purpose
up to 1.2 post-1.2 1.11
N/A 0 0 game version: 109 for version 1.9
0 1 1 skill level: Values 0 through 4 indicate "I'm too young to die" through "Nightmare!", respectively.
1 2 2 episode: always 1 for Doom 2
N/A N/A 3 Doom Classic mission "pack":
Value Pack
0 Ultimate Doom
1 Doom II
2 TNT: Evilution
3 The Plutonia Experiment
4 Master Levels
5 Nerve levels
2 3 4 map
N/A 4 5 multi-player mode: 1 means deathmatch, 2 altdeath, 0 is used for single-player or cooperative multi-player
N/A 5 6 non-zero value implies use of -respawn
N/A 6 7 non-zero value implies use of -fast
N/A 7 8 non-zero value implies use of -nomonsters
N/A 8 9 which player's point of view to use, zero-indexed (0 means player 1)
3 9 A set to 1 if player 1 present
4 A B set to 1 if player 2 present
5 B C set to 1 if player 3 present
6 C D set to 1 if player 4 present
N/A N/A E Doom Classic player states: 84 bytes (21 ints of 32-bits) for each player present, storing their health, armor, weapons and ammo

Immediately after this header is a series of player actions for each tic encoded in 4 bytes. There are 35 tics in a second. The first 3 bytes encode movement including speed, strafing and turning. The last byte encodes other actions such as using/opening, shooting, and changing weapon in a special format.

For this last byte, game events - namely, saving the game and pausing - are signaled when the highest bit, bit 7, is set to 1. If so, the lowest two bits are then checked. If the value is 01, the game issues a pause or unpause command. If the value is 10, the game saves to the slot encoded in bits 2, 3, and 4, which is treated as a three-bit value from 000 to 101. If there is a game event, the game does not check for any other button presses.

If the highest bit is not set, the game next looks to see if bit 2 is set. If so, the game executes a weapon change, using the values in bits 3, 4, and 5, treating the value like a 3-bit number, from 000 to 111, and activating a change to the weapon number key corresponding to one greater than the value, namely, from 1 to 8.

Finally, the game checks for a use command on bit 1, and a fire command on bit 0.

This structure is repeated for every player in the game.

byte purpose
0 forward/backward movement: Positive values indicate forward movement, negative backward. 50 is normally the highest achievable speed if running. 24 is the walking speed. Any number from -50 to 50 can be achieved with a mouse.
1 strafing: Positive values indicate rightward movement, negative leftward. 40 is the running speed, 24 without running. 50 is also achievable in a somewhat complicated way.
2 turning: Positive values are left turns, negative right.
3 This byte encodes multiple actions in different bits. Indexing is from the least significant bit:
bit purpose
0 If set, the weapon is fired; or in special mode pause is toggled
1 opens a door or flips a switch; or in special mode the game to saved to the slot specified by the next three bits: 1xx0001x is slot 1, 1xx1011x is slot 6
2 changes to the weapon slot specified by the next three bits: xx0001xx is slot 1, xx1101xx is slot 7
6 unused
7 sets special mode, changing the meaning of the first two bits

Following the series is a 0x80 byte at the end of the lump.

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. The size of an uncompressed single-player demo lump is 140 bytes per second (or 4 bytes per tic) plus a few (8 or 14) bytes of overhead. 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).

Heretic[edit]

The structure in Heretic is similar to Doom, but features additional information as Heretic features three additional types of commands:

  • Looking up and down
  • Flying up and down
  • Using inventory items

To store them in tic commands, there are two additional bytes, one for looking and flying, and the other for artifact use.

The header is similar to 1.2 header, and does not store game version or other parameters.

byte purpose
0 skill level: values 0 through 4 indicate "thou needeth a wet-nurse" through "black plague possesses thee", respectively.
1 episode
2 map
3 set to 1 if player 1 present
4 set to 1 if player 2 present
5 set to 1 if player 3 present
6 set to 1 if player 4 present

The tic commands take six bytes:

byte purpose
0 forward/backward movement: Positive values indicate forward movement, negative backward. 50 is normally the highest achievable speed if running. 24 is the walking speed. Any number from -50 to 50 can be achieved with a mouse.
1 strafing: Positive values indicate rightward movement, negative leftward. 40 is the running speed, 24 without running. 50 is also achievable in a somewhat complicated way.
2 turning: Positive values are left turns, negative right.
3 This byte encodes multiple actions in different bits. Indexing is from the least significant bit:
bit purpose
0 If set, the weapon is fired; or in special mode pause is toggled
1 opens a door or flips a switch; or in special mode the game to saved to the slot specified by the next three bits: 1xx0001x is slot 1, 1xx1011x is slot 6
2 changes to the weapon slot specified by the next three bits: xx0001xx is slot 1, xx1101xx is slot 7
6 unused
7 sets special mode, changing the meaning of the first two bits
4 looking and flying: looking uses the lower four bits, and flying the upper four bits, forming two values between 0 and 15. They are translated as such:
Value Look Fly
Between 0 and 7 Looking up Flying up
8 Centering view Pausing flight and dropping to the ground
Between 8 and 15 Looking down Flying down
For looking and flying down, the value is made negative by subtracting 16 from it, obtaining a value between -1 and -7.
5 artifact use, value indicates which artifact is being used:
  1. Ring of Invincibility
  2. Shadowsphere
  3. Quartz flask
  4. Mystic urn
  5. Tome of Power
  6. Torch
  7. Time Bomb of the Ancients
  8. Morph Ovum
  9. Wings of Wrath
  10. Chaos Device

The special value 255 indicates an unsuccessful attempt at using an artifact.

Following the series is a 0x80 byte at the end of the lump.

Hexen[edit]

The header is similar to 1.2 and Heretic header, and does not store game version or other parameters. It does store an episode value, even though it is irrelevant. However, Hexen supports up to eight players instead of being limited to four.

byte purpose
0 skill level: values 0 through 4 indicate "thou needeth a wet-nurse" through "black plague possesses thee", respectively.
1 episode (always 1)
2 map
3 set to 1 if player 1 present
4 player 1's class : values 0 through 2
5 set to 1 if player 2 present
6 player 2's class : values 0 through 2
7 set to 1 if player 3 present
8 player 3's class : values 0 through 2
9 set to 1 if player 4 present
10 player 4's class : values 0 through 2

The tic commands take six bytes, as in Heretic. They did not change the structure of the command byte, with only four weapon slots, Hexen needed only two bits to encode the weapon change, which effectively makes bits 5 and 6 unused. However, they added two additional actions, jumping and suicide, which could have fit there but which they instead placed on the upper bits of the artifact byte. Puzzle items are lumped with artifacts.

byte purpose
0 forward/backward movement: Positive values indicate forward movement, negative backward. 50 is normally the highest achievable speed if running. 24 is the walking speed. Any number from -50 to 50 can be achieved with a mouse.
1 strafing: Positive values indicate rightward movement, negative leftward. 40 is the running speed, 24 without running. 50 is also achievable in a somewhat complicated way.
2 turning: Positive values are left turns, negative right.
3 This byte encodes multiple actions in different bits. Indexing is from the least significant bit:
bit purpose
0 If set, the weapon is fired; or in special mode pause is toggled
1 opens a door or flips a switch; or in special mode the game to saved to the slot specified by the next three bits: 1xx0001x is slot 1, 1xx1011x is slot 6
2 changes to the weapon slot specified by the next two bits: xxx001xx is slot 1, xxx111xx is slot 4
5 unused
6 unused
7 sets special mode, changing the meaning of the first two bits
4 looking and flying: looking uses the lower four bits, and flying the upper four bits, forming two values between 0 and 15. They are translated as such:
Value Look Fly
Between 0 and 7 Looking up Flying up
8 Centering view Pausing flight and dropping to the ground
Between 8 and 15 Looking down Flying down
For looking and flying down, the value is made negative by subtracting 16 from it, obtaining a value between -1 and -7.
5 artifact use and extra commands. The upper bits are used for flagging commands: Bit 7 (value 128) is used for jumping, bit 6 (value 64) is used for suicide. The rest of the bits form a value which indicates which artifact is being used:
  1. Icon of the Defender
  2. Quartz flask
  3. Mystic urn
  4. Mystic Ambit Incant
  5. Dark Servant
  6. Torch
  7. Porkalator
  8. Wings of Wrath
  9. Disc of Repulsion
  10. Fléchette
  11. Banishment Device
  12. Boots of Speed
  13. Krater of Might
  14. Dragonskin bracers
  15. Chaos Device
  16. Yorick's Skull
  17. Heart of D'Sparil
  18. Ruby Planet
  19. Emerald Planet 1
  20. Emerald Planet 2
  21. Sapphire Planet 1
  22. Sapphire Planet 2
  23. Daemon Codex
  24. Liber Oscura
  25. Flame Mask
  26. Glaive Seal
  27. Holy Relic
  28. Sigil of the Magus
  29. Clock Gear 1
  30. Clock Gear 2
  31. Clock Gear 3
  32. Clock Gear 4
  33. All artifacts simultaneously

Following the series is a 0x80 byte at the end of the lump.

Strife[edit]

The structure in Strife is similar to the post-1.2 version of Doom's demos, but it omits the episode entirely. As a result, Strife demos have odd sizes, while all other demos have even sizes.

byte purpose
0 version (101)
1 skill level: Values 0 through 4 indicate "Training" through "Bloodbath", respectively.
2 map
3 multi-player mode: 1 means deathmatch, 2 altdeath, 0 is used for single-player or cooperative multi-player
4 non-zero value implies use of -respawn
5 non-zero value implies use of -fast
6 non-zero value implies use of -nomonsters
7 which player's point of view to use, zero-indexed (0 means player 1)
8 set to 1 if player 1 present
9 set to 1 if player 2 present
10 set to 1 if player 3 present
11 set to 1 if player 4 present

Like in Heretic and Hexen, the tic commands take six bytes, with a byte used for additional player actions and another used to store inventory actions.

byte purpose
0 forward/backward movement: Positive values indicate forward movement, negative backward. 50 is normally the highest achievable speed if running. 24 is the walking speed. Any number from -50 to 50 can be achieved with a mouse.
1 strafing: Positive values indicate rightward movement, negative leftward. 40 is the running speed, 24 without running. 50 is also achievable in a somewhat complicated way.
2 turning: Positive values are left turns, negative right.
3 This byte encodes multiple actions in different bits. Indexing is from the least significant bit:
bit purpose
0 If set, the weapon is fired; or in special mode pause is toggled
1 opens a door or flips a switch; or in special mode the game to saved to the slot specified by the next three bits: 1xx0001x is slot 1, 1xx1011x is slot 6
2 changes to the weapon slot specified by the next two bits: xxx001xx is slot 1, xxx111xx is slot 4
5 unused
6 unused
7 sets special mode, changing the meaning of the first two bits
4 This byte encodes additional actions in different bits:
bit purpose
0 looking up
1 looking down
2 centering view
3 use selected inventory
4 drop selected inventory
5 jump
6 unused
7 use surgery kit
5 selected inventory: this is the number of the inventory item's sprite in the sprite table.

Following the series is a 0x80 byte at the end of the lump.

Demo issues[edit]

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 a "desync", 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 a desync 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 premier 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:

External links[edit]

References[edit]

  1. Romero, John. "Q&A with John Romero about DOOM (III) Part I." Project DOOM (archived 🏛). Retrieved 19 October 2020.