Series
Doom
16 games, 1993–2025.
Games
Interactive: timeline (needs JavaScript)
The series by yearMechanics
A marked cell changed from the game before. “Uses” means the game has the mechanic, with no variant recorded yet.
Every claim, by mechanic and game
| Concept | Doom 1993 |
|---|
| Autoaim | |
| Damage formula | - Each bullet from Doom's pistol, chaingun, or shotgun deals
5*(P_Random()%3+1), so 5, 10, or 15; the shotgun fires 7 such pellets. Over one pass of the table the multipliers 1, 2, and 3 come up 75, 88, and 93 times. Code - Doom's fist deals
(P_Random()%10+1)<<1, 2 to 20, multiplied by 10 while the player has the berserk strength power; the chainsaw deals 2 to 20. Code - A Doom projectile that hits a shootable thing, other than a monster of its shooter's species, deals
((P_Random()%8)+1) times its type's damage value: a rocket's 20 gives 20 to 160, a plasma ball's 5 gives 5 to 40, a BFG ball's 100 gives 100 to 800, and an imp's fireball's 3 gives 3 to 24. Code - A Doom rocket's explosion deals 128 minus the distance to each shootable thing in sight of the blast, measured as the larger of the x and y gaps less the thing's radius, and the Cyberdemon and Spider Mastermind take none. Code
- When a Doom BFG ball's explosion reaches its third frame, 40 traces fan across 90° around the ball's heading, each starting from the player who fired it and reaching 1,024 units, and each trace that finds a target deals the sum of 15 rolls of 1 to 8, so 15 to 120. Code
- Doom's monster attacks use the same multiple-of-a-base form: a zombieman's bullet deals
((P_Random()%5)+1)*3, 3 to 15; an imp's claw (P_Random()%8+1)*3, 3 to 24; a demon's bite ((P_Random()%10)+1)*4, 4 to 40; and a Baron of Hell's claw (P_Random()%8+1)*10, 10 to 80, an attack function (A_BruisAttack) the code shares with Doom II's Hell Knight (MT_KNIGHT). Code - Damage to a Doom player is halved on the easiest skill (
sk_baby), and then armor takes a share: a third with the armor pickup (type 1) and half with the MegaArmor (type 2), until its points run out; monsters have no armor or defense value. Code
|
| Demo playback | - In the Linux 1.10 source, a Doom demo starts with a 13-byte header: the version (110), skill, episode, map, the deathmatch, respawn, fast, and no-monsters options, the recording player's number, and one in-game flag for each of the 4 players. Then, for every tic and every player in the game, come 4 bytes: forward move, side move, the high byte of the turn, and the buttons. A byte of
0x80 ends it. A one-player demo takes 140 bytes a second at 35 tics a second (computed). Code - Playback goes through the same path as play. Each tic,
G_Ticker copies every player's command (ticcmd_t) from the network buffer, then, during a demo, overwrites its move, turn, and buttons from the demo; the player code then acts on that command as on a live one. Code - A demo keeps only the turn's high byte, rounded, so a recorded turn moves in steps of 1/256 of a full circle, about 1.4 degrees (computed). While recording, the game writes the command and reads it straight back ("make SURE it is exactly the same"), so the recording player also plays with the rounded turn and the recording matches what the player saw. Code
- Playing a demo restores the recorded skill, episode, map, and options from its header and starts the level through
G_InitNew, which resets both random indices to 0, as a recording started from the command line also does. A demo whose version byte isn't 110 is refused with "Demo is from a different game version!". Code - Playback ends at the
0x80 byte. A demo given with -playdemo then quits the game, and one given with -timedemo reports the tics and the real time taken. Otherwise the attract loop moves on: the title picture, demo1, the credits, demo2, a third page, demo3, and, in the retail Ultimate Doom only, demo4. During an attract demo, a key press that the menu doesn't take first, or a mouse or joystick button, opens the menu, and the demo keeps running behind it. Code - Recording (
-record) ends when the player presses Q, when the buffer, 128 KiB unless -maxdemo sets another size in KiB, is within 16 bytes of full, when a player leaves a net game, or when the game stops on an error (I_Error); the game then writes the 0x80 byte and the file <name>.lmp, and exits with "Demo <name>.lmp recorded". Code
|
| Difficulty level | uses |
| Hitscan | - Doom's bullets and melee are hitscan:
P_LineAttack traces a line in the same tic, out to 2,048 units for guns and 64 for melee, and damages the first shootable thing whose height spans the shot's slope; rockets, plasma, and BFG balls are objects spawned by P_SpawnPlayerMissile that move each tic at their type's speed (20, 25, and 25 units per tic). Code - Doom's shotgun turns each of its 7 pellets by
(P_Random()-P_Random())<<18, up to about 5.6° either side, at one shared vertical slope; the pistol and chaingun turn their shots the same way except while player->refire is 0, which covers the pistol's first shot and the chaingun's first two in a burst of held fire, and those fly straight. Code
|
| Monster infighting | |
| Pain chance | - A Doom monster that survives a hit enters its pain state when
P_Random() is below its pain chance, out of 256, unless it is a lost soul in mid-charge; the table gives the zombieman and imp 200, the demon 180, the shotgun guy 170, the cacodemon 128, the Baron of Hell 50, the Spider Mastermind 40, and the Cyberdemon 20, and the lost soul's 256 always succeeds. The pain sets MF_JUSTHIT, so the monster's next missile-range check passes at once if it can see its target. Code
|
| Random number generator | - Doom's random numbers come from
rndtable, a fixed table of 256 bytes, walked by two indices: each call to P_Random or M_Random adds 1 to its own index, wraps it at 256, and returns that table entry. Code - Doom's play code (weapon damage, aim spread, pain) rolls
P_Random, and M_Random serves the rest: the screen wipe, sound pitch, intermission animations, and the status bar. Code G_InitNew resets both of Doom's random indices to 0, and it runs when a new game starts, when a saved game loads, when a demo starts playing, and when the command line starts a game directly (a warp or autostart, or a net game). Code- Doom's
rndtable is not a permutation: its 256 entries hold 166 distinct values, 101 of them once, 45 twice, 16 three times, 3 four times, and 1 five times; the value 145 appears 5 times and the value 0 twice. Code
|
| Reaction delay | |
| Running | - Doom's game logic runs in tics of 1/35 second (
TICRATE 35). Code - Each tic a Doom player stands on the floor,
P_MovePlayer adds a thrust of the command's forward and side moves times 2,048 (1/32 unit per tic for each step of move), the side thrust at 90° to the facing; a keyboard sets the forward move to 25 walking or 50 running and the side move to 24 or 40, and the player gets no thrust in the air. Code - After a Doom thing moves on the floor, its momentum is multiplied by
FRICTION (0xe800, 0.90625) each tic, and set to 0 once both axes are under STOPSPEED (1/16 unit per tic) with no move commanded; friction skips missiles, a charging lost soul, anything in the air, and a corpse halfway off a step still moving faster than 1/4 unit per tic on an axis, and the no-momentum cheat stops a player outright. Each axis of momentum is capped at 30 units per tic. Code - Computed from the thrust and friction, not measured: with a thrust of
a each tic and friction 0.90625, a Doom player on the floor settles at the speed v where a = 0.09375·v, about 16.7 units per tic (583 units/s) running forward and 8.3 walking; neither comes near the 30-unit cap. Code
|
| Strafe-running | |