Difference between revisions of "Demo"
From DoomWiki.org
[checked revision] | [checked revision] |
(→Heretic: +SOTSR) |
Eris Falling (talk | contribs) m (→Strife: redirect the rest of the redlinks) |
||
(32 intermediate revisions by 9 users not shown) | |||
Line 54: | Line 54: | ||
| [[Versions of Doom and Doom II#v1.6|1.6 beta]] | | [[Versions of Doom and Doom II#v1.6|1.6 beta]] | ||
| [[E1M3: Toxin Refinery]]<br />Duration 3:02[https://www.youtube.com/watch?v=Hb9nlGxopJA&index=22&list=PL2938B188ABB3B33F] | | [[E1M3: Toxin Refinery]]<br />Duration 3:02[https://www.youtube.com/watch?v=Hb9nlGxopJA&index=22&list=PL2938B188ABB3B33F] | ||
− | | [[E1M5: Phobos Lab]]<br />Duration 1:42, 2 player [[cooperative]], turns into DM[ | + | | [[E1M5: Phobos Lab]]<br />Duration 1:42, 2 player [[cooperative]], turns into DM[https://www.youtube.com/watch?v=t7Ag_bUL-qw&list=PL2938B188ABB3B33F&index=23] |
| [[E1M7: Computer Station]]<br />Duration 3:20[https://www.youtube.com/watch?v=H1li773RbkI&list=PL2938B188ABB3B33F&index=24] | | [[E1M7: Computer Station]]<br />Duration 3:20[https://www.youtube.com/watch?v=H1li773RbkI&list=PL2938B188ABB3B33F&index=24] | ||
|- | |- | ||
Line 110: | Line 110: | ||
| As above | | As above | ||
| [[E4M2: Perfect Hatred]]<br />Duration: 0:29[https://www.youtube.com/watch?v=pzI_8je7dD8&index=35&list=PL2938B188ABB3B33F] | | [[E4M2: Perfect Hatred]]<br />Duration: 0:29[https://www.youtube.com/watch?v=pzI_8je7dD8&index=35&list=PL2938B188ABB3B33F] | ||
+ | |} | ||
+ | |||
+ | ==== [[:Category:Commercial ports|Commercial ports]]==== | ||
+ | |||
+ | {| {{prettytable}} | ||
+ | ! 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]] | ||
|} | |} | ||
Line 134: | Line 153: | ||
| As above | | As above | ||
| As above | | As above | ||
+ | |} | ||
+ | |||
+ | ==== [[:Category:Commercial ports|Commercial ports]]==== | ||
+ | |||
+ | There was no demo loop in [[Doom for Game Boy Advance]]. | ||
+ | |||
+ | {| {{prettytable}} | ||
+ | ! Version | ||
+ | ! DEMO1 | ||
+ | ! DEMO2 | ||
+ | ! DEMO3 | ||
+ | |- | ||
+ | | [[Doom Classic]] | ||
+ | | [[MAP11: Circle of Death]] | ||
+ | | [[MAP05: The Waste Tunnels]] | ||
+ | | [[MAP26: The Abandoned Mines]] | ||
|} | |} | ||
Line 160: | Line 195: | ||
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. | 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.<!-- jdowland note: I've just confirmed this myself locally. There is a video claiming to be 1.2 registered demo loop on YT where the videos don't desync so I think they're mistaken and it's 1.0. I may upload videos from the correct versions and link them at some point. I'd like to re-check the SW 1.2 videos to see whether they re-recorded them after 1.0, but I doubt it. --> | ||
{| {{prettytable}} | {| {{prettytable}} | ||
Line 182: | Line 219: | ||
| [[E1M9: The Graveyard]]<br />Duration: 0:37[https://www.youtube.com/watch?v=7PbzroYvov8?t=3m22s] | | [[E1M9: The Graveyard]]<br />Duration: 0:37[https://www.youtube.com/watch?v=7PbzroYvov8?t=3m22s] | ||
|- | |- | ||
− | | Registered | + | | Registered 1.0 |
| [[E2M9: The Glacier]] | | [[E2M9: The Glacier]] | ||
| [[E2M5: The Catacombs]] | | [[E2M5: The Catacombs]] | ||
| [[E3M2: The Cesspool]] | | [[E3M2: The Cesspool]] | ||
+ | |- | ||
+ | | Registered 1.2 | ||
+ | | As above, desyncs[https://www.youtube.com/watch?v=PU84bTCeeY4] | ||
+ | | As above | ||
+ | | As above, desyncs[https://www.youtube.com/watch?v=FqZ-2niKm4c] | ||
|- | |- | ||
| Shadow of the Serpent Riders | | Shadow of the Serpent Riders | ||
− | | [ | + | | As above[https://www.youtube.com/watch?v=_Y1x8AdTjpY] |
− | | [ | + | | As above[https://youtube.com/watch?v=/_Y1x8AdTjpY?t=41s] |
− | | [ | + | | As above[https://youtube.com/watch?v=/_Y1x8AdTjpY?t=2m18s] |
|} | |} | ||
Line 207: | Line 249: | ||
|- | |- | ||
| version 1.0 | | version 1.0 | ||
− | | [[Hub 1: Guardian of Ice]] | + | | [[Hub 1: Guardian of Ice]][https://www.youtube.com/watch?v=1HZhmX74EEM] |
| [[Hub 4: Gibbet]] | | [[Hub 4: Gibbet]] | ||
| [[Hub 4: Effluvium]] | | [[Hub 4: Effluvium]] | ||
|- | |- | ||
| version 1.1 | | version 1.1 | ||
− | | [[Hub 1: Winnowing Hall]] | + | | [[Hub 1: Winnowing Hall]][https://www.youtube.com/watch?v=90BtSuUZR58] |
| [[Hub 1: Guardian of Fire]] | | [[Hub 1: Guardian of Fire]] | ||
| [[Hub 4: Effluvium]] | | [[Hub 4: Effluvium]] | ||
+ | |- | ||
+ | | [[Deathkings of the Dark Citadel]] | ||
+ | | [[Hub 1: Ruined Village]][https://www.youtube.com/watch?v=q_rdXFUmEhY] | ||
+ | | [[Hub 2: Market Place]] | ||
+ | | [[Hub 3: Chantry]] | ||
|} | |} | ||
=== [[Strife]] === | === [[Strife]] === | ||
− | |||
− | |||
{| {{prettytable}} | {| {{prettytable}} | ||
Line 231: | Line 276: | ||
| [[MAP02: Town]] | | [[MAP02: Town]] | ||
|} | |} | ||
+ | |||
+ | [[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 == | == Custom demos == | ||
− | Players can record demos of their own game sessions. This is done using the <tt>-record <name></tt> command line argument, which places the recording in a file named <tt><name>.lmp</tt> in the Doom program directory. A recording can subsequently be played back using the <tt>-playdemo <name></tt> command line argument, where <tt><name>.lmp</tt> is the name of the recorded demo. Unlike in the built-in demo sequence and when using <tt>-timedemo</tt> (see below), it's possible to toggle the [[Automap|automap mode]] while using <tt>-playdemo</tt>, because the feature that brings up the [[menu]] when pressing input keys or buttons is disabled. | + | Players can record demos of their own game sessions. This is done using the <tt>-record <name></tt> command line argument, which places the recording in a file named <tt><name>.lmp</tt> in the Doom program directory. You can also add the <tt>-warp <map number></tt> command to start recording from a specific map. A recording can subsequently be played back using the <tt>-playdemo <name></tt> command line argument, where <tt><name>.lmp</tt> is the name of the recorded demo. Unlike in the built-in demo sequence and when using <tt>-timedemo</tt> (see below), it's possible to toggle the [[Automap|automap mode]] while using <tt>-playdemo</tt>, because the feature that brings up the [[menu]] when pressing input keys or buttons is disabled. |
These demo files can then be uploaded to [[Wikipedia:Web_site|websites]] and [[Wikipedia:File Transfer Protocol|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. | These demo files can then be uploaded to [[Wikipedia:Web_site|websites]] and [[Wikipedia:File Transfer Protocol|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. | ||
Line 242: | Line 289: | ||
== Technical information == | == Technical information == | ||
{{Cleanup|<br/>'''Issue:''' deeply nested tables are bad style and are bad for mobile and accessibility.}} | {{Cleanup|<br/>'''Issue:''' deeply nested tables are bad style and are bad for mobile and accessibility.}} | ||
− | |||
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 [[Controls|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. | 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 [[Controls|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. | ||
− | 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 | + | === Doom === |
+ | 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 {{c|-respawn}}, {{c|-fast}}, and {{c|-nomonsters}} [[parameter]]s were used, and which player's point of view should be used. | ||
{| {{prettytable}} | {| {{prettytable}} | ||
Line 253: | Line 300: | ||
! up to 1.2 !! post-1.2 | ! up to 1.2 !! post-1.2 | ||
|- | |- | ||
− | | N/A || 0 || [[Versions of Doom and Doom II|game version]]: | + | | N/A || 0 || [[Versions of Doom and Doom II|game version]]: {{c|109}} for version 1.9 |
|- | |- | ||
− | | 0 || 1 || [[skill level]]:Values | + | | 0 || 1 || [[skill level]]:Values {{c|0}} through {{c|4}} indicate "I'm too young to die" through "Nightmare!", respectively. |
|- | |- | ||
− | | 1 || 2 || episode: always | + | | 1 || 2 || episode: always {{c|1}} for Doom 2 |
|- | |- | ||
| 2 || 3 || map | | 2 || 3 || map | ||
|- | |- | ||
− | | N/A || 4 || [[multiplayer|multi-player mode]]: | + | | N/A || 4 || [[multiplayer|multi-player mode]]: {{c|1}} means deathmatch, {{c|2}} altdeath, {{c|0}} is used for single-player or cooperative multi-player |
|- | |- | ||
− | | N/A || 5 || non-zero value implies use of | + | | N/A || 5 || non-zero value implies use of {{c|-respawn}} |
|- | |- | ||
− | | N/A || 6 || non-zero value implies use of | + | | N/A || 6 || non-zero value implies use of {{c|-fast}} |
|- | |- | ||
− | | N/A || 7 || non-zero value implies use of | + | | N/A || 7 || non-zero value implies use of {{c|-nomonsters}} |
|- | |- | ||
− | | N/A || 8 || which player's point of view to use, zero-indexed ( | + | | N/A || 8 || which player's point of view to use, zero-indexed ({{c|0}} means player 1) |
|- | |- | ||
− | | 3 || 9 || set to | + | | 3 || 9 || set to {{c|1}} if player 1 present |
|- | |- | ||
− | | 4 || A || set to | + | | 4 || A || set to {{c|1}} if player 2 present |
|- | |- | ||
− | | 5 || B || set to | + | | 5 || B || set to {{c|1}} if player 3 present |
|- | |- | ||
− | | 6 || C || set to | + | | 6 || C || set to {{c|1}} if player 4 present |
|} | |} | ||
− | 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. This structure is repeated for every player in the game. | + | 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 {{c|1}}. If so, the lowest two bits are then checked. If the value is {{c|01}}, the game issues a pause or unpause command. If the value is {{c|10}}, the game saves to the slot encoded in bits 2, 3, and 4, which is treated as a three-bit value from {{c|000}} to {{c|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 {{c|000}} to {{c|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. | ||
{| {{prettytable}} | {| {{prettytable}} | ||
! byte !! purpose | ! byte !! purpose | ||
|- | |- | ||
− | | 0 || forward/backward movement: Positive values indicate forward movement, negative backward. | + | | 0 || forward/backward movement: Positive values indicate forward movement, negative backward. {{c|50}} is normally the highest achievable speed if running. {{c|24}} is the walking speed. Any number from {{c|-50}} to {{c|50}} can be achieved with a mouse. |
|- | |- | ||
− | | 1 || [[strafing]]: Positive values indicate rightward movement, negative leftward. | + | | 1 || [[strafing]]: Positive values indicate rightward movement, negative leftward. {{c|40}} is the running speed, {{c|24}} without running. {{c|[[straferunning|50]]}} is also achievable in a somewhat complicated way. |
|- | |- | ||
| 2 || turning: Positive values are left turns, negative right. | | 2 || turning: Positive values are left turns, negative right. | ||
Line 295: | Line 350: | ||
! bit !! purpose | ! bit !! purpose | ||
|- | |- | ||
− | | 0 || If set, the weapon is fired | + | | 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 {{c|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 [[Wikipedia:Binary file#Viewing binary files|hex editing]] of demos (see [[Speedrun#Tool-assisted demos|TAS]]). | ||
+ | |||
+ | === Heretic === | ||
+ | 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. | ||
{| {{prettytable}} | {| {{prettytable}} | ||
− | + | ! byte !! purpose | |
|- | |- | ||
− | | | + | | 0 || [[skill level]]: values {{c|0}} through {{c|4}} indicate "thou needeth a wet-nurse" through "black plague possesses thee", respectively. |
|- | |- | ||
− | | | + | | 1 || episode |
|- | |- | ||
− | | | + | | 2 || map |
|- | |- | ||
− | | | + | | 3 || set to {{c|1}} if player 1 present |
|- | |- | ||
− | | | + | | 4 || set to {{c|1}} if player 2 present |
|- | |- | ||
− | | | + | | 5 || set to {{c|1}} if player 3 present |
|- | |- | ||
− | | | + | | 6 || set to {{c|1}} if player 4 present |
|} | |} | ||
+ | |||
+ | The tic commands take six bytes: | ||
+ | |||
+ | {| {{prettytable}} | ||
+ | ! byte !! purpose | ||
+ | |- | ||
+ | | 0 || forward/backward movement: Positive values indicate forward movement, negative backward. {{c|50}} is normally the highest achievable speed if running. {{c|24}} is the walking speed. Any number from {{c|-50}} to {{c|50}} can be achieved with a mouse. | ||
+ | |- | ||
+ | | 1 || [[strafing]]: Positive values indicate rightward movement, negative leftward. {{c|40}} is the running speed, {{c|24}} without running. {{c|[[straferunning|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. | ||
+ | {| {{prettytable}} | ||
+ | ! 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 | | 6 || unused | ||
|- | |- | ||
− | | 7 || | + | | 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: | ||
{| {{prettytable}} | {| {{prettytable}} | ||
− | + | ! 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: | ||
+ | # [[Ring of Invulnerability]] | ||
+ | # [[Shadowsphere]] | ||
+ | # [[Quartz Flask]] | ||
+ | # [[Mystic Urn]] | ||
+ | # [[Tome of Power]] | ||
+ | # [[Torch]] | ||
+ | # [[Timebomb of the Ancients]] | ||
+ | # [[Morph Ovum]] | ||
+ | # [[Wings of Wrath]] | ||
+ | # [[Chaos Device]] | ||
+ | The special value 255 indicates an unsuccessful attempt at using an artifact. | ||
|} | |} | ||
+ | |||
+ | Following the series is a {{c|0x80}} byte at the end of the lump. | ||
+ | |||
+ | === Hexen === | ||
+ | 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. | ||
+ | {| {{prettytable}} | ||
+ | ! byte !! purpose | ||
+ | |- | ||
+ | | 0 || [[skill level]]: values {{c|0}} through {{c|4}} indicate "thou needeth a wet-nurse" through "black plague possesses thee", respectively. | ||
+ | |- | ||
+ | | 1 || episode (always 1) | ||
+ | |- | ||
+ | | 2 || map | ||
+ | |- | ||
+ | | 3 || set to {{c|1}} if player 1 present | ||
+ | |- | ||
+ | | 4 || player 1's class : values {{c|0}} through {{c|2}} | ||
+ | |- | ||
+ | | 5 || set to {{c|1}} if player 2 present | ||
+ | |- | ||
+ | | 6 || player 2's class : values {{c|0}} through {{c|2}} | ||
+ | |- | ||
+ | | 7 || set to {{c|1}} if player 3 present | ||
+ | |- | ||
+ | | 8 || player 3's class : values {{c|0}} through {{c|2}} | ||
+ | |- | ||
+ | | 9 || set to {{c|1}} if player 4 present | ||
+ | |- | ||
+ | | 10 || player 4's class : values {{c|0}} through {{c|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. | |
− | + | {| {{prettytable}} | |
+ | ! byte !! purpose | ||
+ | |- | ||
+ | | 0 || forward/backward movement: Positive values indicate forward movement, negative backward. {{c|50}} is normally the highest achievable speed if running. {{c|24}} is the walking speed. Any number from {{c|-50}} to {{c|50}} can be achieved with a mouse. | ||
+ | |- | ||
+ | | 1 || [[strafing]]: Positive values indicate rightward movement, negative leftward. {{c|40}} is the running speed, {{c|24}} without running. {{c|[[straferunning|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. | ||
+ | {| {{prettytable}} | ||
+ | ! 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: | ||
+ | {| {{prettytable}} | ||
+ | ! 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: | ||
+ | # [[Icon of the Defender]] | ||
+ | # [[Quartz Flask]] | ||
+ | # [[Mystic Urn]] | ||
+ | # [[Mystic Ambit Incant]] | ||
+ | # [[Dark Servant]] | ||
+ | # [[Torch]] | ||
+ | # [[Porkelator]] | ||
+ | # [[Wings of Wrath]] | ||
+ | # [[Disc of Repulsion]] | ||
+ | # [[Flechette]] | ||
+ | # [[Banishment Device]] | ||
+ | # [[Boots of Speed]] | ||
+ | # [[Krater of Might]] | ||
+ | # [[Dragonskin Bracers]] | ||
+ | # [[Chaos Device]] | ||
+ | # [[Yorick's Skull]] | ||
+ | # [[Heart of D'Sparil]] | ||
+ | # [[Ruby Planet]] | ||
+ | # [[Emerald Planet]] 1 | ||
+ | # [[Emerald Planet]] 2 | ||
+ | # [[Sapphire Planet]] 1 | ||
+ | # [[Sapphire Planet]] 2 | ||
+ | # [[Daemon Codex]] | ||
+ | # [[Liber Oscura]] | ||
+ | # [[Flame Mask]] | ||
+ | # [[Glaive Seal]] | ||
+ | # [[Holy Relic]] | ||
+ | # [[Sigil of the Magus]] | ||
+ | # [[Clock Gear]] 1 | ||
+ | # [[Clock Gear]] 2 | ||
+ | # [[Clock Gear]] 3 | ||
+ | # [[Clock Gear]] 4 | ||
+ | # All artifacts simultaneously | ||
+ | |} | ||
+ | |||
+ | Following the series is a {{c|0x80}} byte at the end of the lump. | ||
+ | |||
+ | === Strife === | ||
+ | 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. | ||
+ | |||
+ | {| {{prettytable}} | ||
+ | ! byte !! purpose | ||
+ | |- | ||
+ | | 0 || version (101) | ||
+ | |- | ||
+ | | 1 || [[skill level]]:Values {{c|0}} through {{c|4}} indicate "Training" through "Bloodbath", respectively. | ||
+ | |- | ||
+ | | 2 || map | ||
+ | |- | ||
+ | | 3 || [[multiplayer|multi-player mode]]: {{c|1}} means deathmatch, {{c|2}} altdeath, {{c|0}} is used for single-player or cooperative multi-player | ||
+ | |- | ||
+ | | 4 || non-zero value implies use of {{c|-respawn}} | ||
+ | |- | ||
+ | | 5 || non-zero value implies use of {{c|-fast}} | ||
+ | |- | ||
+ | | 6 || non-zero value implies use of {{c|-nomonsters}} | ||
+ | |- | ||
+ | | 7 || which player's point of view to use, zero-indexed ({{c|0}} means player 1) | ||
+ | |- | ||
+ | | 8 || set to {{c|1}} if player 1 present | ||
+ | |- | ||
+ | | 9 || set to {{c|1}} if player 2 present | ||
+ | |- | ||
+ | | 10 || set to {{c|1}} if player 3 present | ||
+ | |- | ||
+ | | 11 || set to {{c|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. | ||
+ | |||
+ | {| {{prettytable}} | ||
+ | ! byte !! purpose | ||
+ | |- | ||
+ | | 0 || forward/backward movement: Positive values indicate forward movement, negative backward. {{c|50}} is normally the highest achievable speed if running. {{c|24}} is the walking speed. Any number from {{c|-50}} to {{c|50}} can be achieved with a mouse. | ||
+ | |- | ||
+ | | 1 || [[strafing]]: Positive values indicate rightward movement, negative leftward. {{c|40}} is the running speed, {{c|24}} without running. {{c|[[straferunning|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. | ||
+ | {| {{prettytable}} | ||
+ | ! 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. | ||
+ | {| {{prettytable}} | ||
+ | ! 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. | ||
+ | *33: [[Strife quest items#Degnin ore|degnin ore]] | ||
+ | *108: [[targeter]] | ||
+ | *109: [[Strife quest items#Ring|Beldin's ring]] | ||
+ | *110: [[Derwin]]'s [[Strife quest items#Ear|ear]] | ||
+ | *120: [[Strife quest items#Broken power coupling|broken power coupling]] | ||
+ | *130: [[surgery kit]] | ||
+ | *135: [[teleporter beacon]] | ||
+ | *136: [[metal armor]] | ||
+ | *137: [[leather armor]] | ||
+ | *180: [[med patch]] | ||
+ | *181: [[medical kit]] | ||
+ | *182: [[Gold|coin]] | ||
+ | *186: [[shadow armor]] | ||
+ | *187: [[environmental suit]] | ||
+ | *188: [[Strife quest items#Guard uniform|guard uniform]] | ||
+ | *189: [[Strife quest items#Officer uniform|officer's uniform]] | ||
+ | *191: [[scanner]] | ||
+ | *203: [[offering chalice]] | ||
+ | *206: [[Strife quest items#flamethrower parts|flamethrower parts]] | ||
+ | |} | ||
− | + | Following the series is a {{c|0x80}} byte at the end of the lump. | |
== Demo issues == | == Demo issues == | ||
Line 339: | Line 662: | ||
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. | 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. | + | Display commands not affecting gameplay, such as chat text and the IDDT [[Doom cheat codes|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 [[PWAD]]s. | 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 [[PWAD]]s. | ||
Line 352: | Line 675: | ||
== Source == | == Source == | ||
− | * ''This article uses material from the [http://doom.wikia.com/wiki/Demo "Demo"] article on the [http://doom.wikia.com Doom wiki] at [[wikipedia:Wikia|Wikia]] and is licensed under the [ | + | * ''This article uses material from the [http://doom.wikia.com/wiki/Demo "Demo"] article on the [http://doom.wikia.com Doom wiki] at [[wikipedia:Wikia|Wikia]] and is licensed under the [https://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-Share Alike License].'' |
== External links == | == External links == |
Revision as of 18:49, 17 June 2018
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.
Contents
Built-in demos
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 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
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.
It's widely believed that the main player recording all demos in Doom and Doom II is John Romero.
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.
Registered and Commercial
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.
Ultimate Doom introduced a fourth demo, DEMO4.
Version | DEMO1 | DEMO2 | DEMO3 | DEMO4 |
---|---|---|---|---|
Registered 1.1 | E2M4: Deimos Lab Duration 2:29[22] |
E3M3: Pandemonium Duration 3:52[23] |
E3M6: Mt. Erebus Duration 3:30[24] |
- |
Registered 1.2 | E2M4: Deimos Lab Duration 5:30, Hurt Me Plenty[25] |
E3M6: Mt. Erebus Duration 2:20[26] |
E2M2: Containment Area Duration 4:44[27] |
- |
Registered 1.666 | E1M5: Phobos Lab Duration: 0:55[28] |
E2M2: Containment Area Duration: 1:09[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:29[31] |
Commercial ports
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
Version | DEMO1 | DEMO2 | DEMO3 |
---|---|---|---|
1.666 | MAP11: Circle of Death Duration: 2:07[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:36[35] |
As above | As above |
Commercial ports
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
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:12[37] |
MAP12: Crater Duration: 1:44[38] |
MAP13: Nukage Processing Duration: 1:38[39] |
The Plutonia Experiment | MAP17: Compound Duration: 3:34[40] |
MAP10: Onslaught Duration: 1:39[41] |
MAP12: Speed Duration: 2:41[42] |
Heretic
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 | E1M2: The Dungeons | E1M3: The Gatehouse |
Shareware 1.0 | E1M3: The Gatehouse | E1M6: The Cathedral | E1M9: The Graveyard |
Shareware 1.2 | E1M3: The Gatehouse Duration: 1:18[43] |
E1M6: The Cathedral Duration: 1:58[44] |
E1M9: The Graveyard Duration: 0:37[45] |
Registered 1.0 | E2M9: The Glacier | E2M5: The Catacombs | E3M2: The Cesspool |
Registered 1.2 | As above, desyncs[46] | As above | As above, desyncs[47] |
Shadow of the Serpent Riders | As above[48] | As above[49] | As above[50] |
Hexen
Version | DEMO1 | DEMO2 | DEMO3 |
---|---|---|---|
Demo version | Hub 1: Guardian of Ice | Hub 1: Winnowing Hall | Hub 1: Guardian of Fire |
version 1.0 | Hub 1: Guardian of Ice[51] | Hub 4: Gibbet | Hub 4: Effluvium |
version 1.1 | Hub 1: Winnowing Hall[52] | Hub 1: Guardian of Fire | Hub 4: Effluvium |
Deathkings of the Dark Citadel | Hub 1: Ruined Village[53] | Hub 2: Market Place | Hub 3: Chantry |
Strife
Version | DEMO1 |
---|---|
Demo | MAP32: Sanctuary |
Registered | MAP02: Town |
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
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
This article or section needs to be cleaned up. Please edit it to conform to a higher standard of article quality. Issue: deeply nested tables are bad style and are bad for mobile and accessibility. |
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
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 | |
N/A | 0 | game version: 109 for version 1.9 |
0 | 1 | skill level:Values 0 through 4 indicate "I'm too young to die" through "Nightmare!", respectively. |
1 | 2 | episode: always 1 for Doom 2 |
2 | 3 | map |
N/A | 4 | multi-player mode: 1 means deathmatch, 2 altdeath, 0 is used for single-player or cooperative multi-player |
N/A | 5 | non-zero value implies use of -respawn |
N/A | 6 | non-zero value implies use of -fast |
N/A | 7 | non-zero value implies use of -nomonsters |
N/A | 8 | which player's point of view to use, zero-indexed (0 means player 1) |
3 | 9 | set to 1 if player 1 present |
4 | A | set to 1 if player 2 present |
5 | B | set to 1 if player 3 present |
6 | C | set to 1 if player 4 present |
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.
|
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
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.
| ||||||||||||
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:
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:
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
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.
| ||||||||||||||
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:
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:
|
Following the series is a 0x80 byte at the end of the lump.
Strife
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.
| ||||||||||||||||||
4 | This byte encodes additional actions in different bits.
| ||||||||||||||||||
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
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:
- Demo desyncing caused by bouncing Lost Souls
- Demo desyncing caused by menu access
- Turning resolution is lowered when recording demos
Source
- This article uses material from the "Demo" article on the Doom wiki at Wikia and is licensed under the Creative Commons Attribution-Share Alike License.
External links
- Unofficial LMP format documentation, by Uwe Girlich (through archive.org)
- LMPC download page at PlanetQuake.com (through archive.org)