Keys
DOOM's ten keys from default.cfg, two to each: click one and press the new key
(Esc leaves it as it was, Backspace leaves it empty). A key does one thing, so taking it
here takes it from wherever it was. Remembered in this browser.
Play over the network — co-op or deathmatch, up to four players, peer to peer
Everyone loads the same WAD. The host presses Invite a player and sends the code to a friend (chat, e-mail…); the friend presses Join, pastes it and sends back the reply; the host pastes the reply and presses Connect. Invite up to three, pick the game, then Start: the host's map and skill. Only each player's keys cross the wire, and every browser's Firebird plays the same game from them (lockstep, as DOOM did over IPX). With a Relay, the invite is a six-letter room code, there's no reply to send back, and its TURN servers connect players whose networks won't let them meet.
Click the view to capture the mouse · WASD / arrows move · Ctrl or click fire · right button held strafes, middle button walks, a double click on either uses · Space/E use · Shift run · 1–7 weapons (1 again: chainsaw, 3 again: super shotgun) · Esc menu · Tab map (IDDT on it reveals all) · type IDDQD, IDKFA, IDFA, IDCLIP, IDCHOPPERS, IDBEHOLDx, IDMYPOS, IDMUSxy or IDCLEVxy to cheat · P pause (in a netgame, for everyone) · T chat in a netgame (G/I/B/R to one player, Alt+0–9 the macros) · M audio on/off · a gamepad is DOOM's joystick (stick or d-pad; A fire, B strafe, X run, Y use). On touch screens the left half moves, the right half turns, and a tap fires.
SQL console — the live game database
How it works
- The WAD becomes tables.
VERTEXES,LINEDEFS,SIDEDEFS,SECTORS,SEGS,SSECTORS,NODESandTHINGSare copied in as rows. Sprite frames and texture sizes become tables too. - The game is PSQL.
DOOM_TICruns at 35 Hz: player movement with wall sliding (CHECK_POSITION), doors and lifts (MOVERS), monster AI with line-of-sight (CHECK_SIGHT), hitscan weapons, rockets, plasma and the BFG (with splash damage and the 40-ray BFG spray), pickups, secrets, light effects, the boss-death specials, Commander Keen and the Icon of Sin. - The BSP is a recursive CTE.
INIT_MAPfinds every thing's sector by walkingNODESfor all things at once withWITH RECURSIVE. - The renderer is a query.
FRAME_WALLSwalks the BSP front to back like DOOM'sR_RenderBSPNode. It skips subtrees whose bounding boxes are already hidden, and trackssolidsegsas one character per screen column. For each visible seg it intersects every column's ray, then carries DOOM'sceilingclip/floorclipwindow down each column. Switch Renderer to brute force to project every linedef instead (about 3× slower, same picture).FRAME_WALLS_WINDOWEDstates the clipping withMAX() OVER (PARTITION BY col ORDER BY depth). Each slice also reports the ceiling and floor rows it uncovers. The browser files those into visplanes and draws them as horizontal spans, like DOOM'sR_MakeSpans;FRAME_VISPLANESlists them.FRAME_SPRITESpicks the rotation frame for each monster. - Sound is a table too. Procedures insert rows into
SOUND_EVENTSfor gunfire, doors, lifts, switches, pickups, pain, deaths and monster sightings. The browser plays the WAD's DMX sound lumps, attenuated and panned from where the sound happened. Music is the WAD's MIDI/MUS lumps played by a small FM synthesiser that uses the WAD's ownGENMIDIOPL2 instrument bank, as DOOM's Adlib driver did. Audio starts after your first click or key press. - JavaScript only paints. It looks up texels and colormaps for the rows Firebird returns.
Inspired by CedarDB's SQL DOOM and
DOOMQL, and by
DuckDB-DOOM. The engine is
Electric Firebird (firebird-wasm).
The game data is Freedoom. DOOM is a trademark of id Software.