Skip to content
M45-SoftwarePublic

Repository files navigation

GD-DOOM

Go CI Go Vulncheck (main) GitHub Release License

A Doom engine and source port written in Go, for desktop and browser. GPU shaders preserve Doom's software-rendered appearance while accelerating pixel drawing in both Faithful and Source Port modes. Play with classic presentation or smooth modern rendering, choose FM, SoundFont, or PC speaker audio, and share live sessions with spectators.

Play in your browser · Desktop releases: Linux · Windows · macOS Intel · macOS Apple Silicon

Gallery

Captured with the current GPU renderer. The matching E1M1 views compare Faithful mode's classic 320×200 rendering, 256-color palette, and 4:3 presentation with Modern (Source Port) mode's full-color lighting and crisp texture detail at 1920×1080. Click a screenshot to open the full-size image.

Faithful E1M1 with the classic 320 by 200 framebuffer, Doom palette, and 4:3 status bar
Faithful · classic presentation
The same E1M1 view in Modern Source Port mode at 1920 by 1080
Modern · 1080p detail
Modern E1M1 automap with textured floors and the full level revealed
Modern · textured automap
Modern E1M1 encounter with zombiemen, blue wall panels, and detailed stair edges
Modern · combat
Modern E1M8 marble hall with red torches, bright ceiling lights, and dark alcoves
Modern · sector lighting
Modern E2M2 storage room with detailed wall textures, ceiling panels, and stacked crates
Modern · interior textures
Doom 1 title screen melting away to reveal E1M1 when starting a new game in Modern mode
Modern · New Game melt
Modern E1M5 close-up with a fuzzy spectre beside a sharp zombieman sprite
Modern · spectre fuzz
Modern E1M1 courtyard with crisp metal walls, a slime pool, and mountain sky
Modern · outdoor detail

Videos: SoundFont demo · OPL/AdLib gameplay · Software renderer in slow motion · PC speaker simulation. Music playlists: SGM MIDI · OPL/AdLib FM.

Software-rendered appearance, GPU drawing

For reproducible classic/CPU/GPU screenshots, overlays, and coordinate-audit findings, see the visual comparison harness.

GD-DOOM's shaders keep Doom's crisp texture pixels, column-and-span geometry, sprite cutouts, clipping, and lighting. The CPU makes the same visibility and projection decisions as the software renderer; the GPU draws the resulting columns, spans, and sprite rectangles from indexed texture atlases. This keeps the familiar software-rendered appearance on desktop and in the browser.

Faithful mode keeps the classic Doom presentation and 256-color palette, using the WAD's COLORMAP lookup tables for lighting and the selected gamma palette for color. Sky coordinates match the CPU renderer, and classic low detail still doubles each framebuffer column. Simulation and visual updates stay at 35 Hz, with no motion interpolation or game-speed controls, including in multiplayer. Source Port mode adds high-resolution output, interpolated camera, monster and weapon motion, full-color rendering, and optional CRT effects.

Repeated columns and sprite rows share compact draw commands, and nearby sprites reuse horizontal visibility spans until clipping changes. These reduce CPU raster preparation and the geometry sent to the GPU, including the work that previously caused stalls when standing close to enemies.

GPU drawing is enabled by default in both modes, with automatic CPU fallback for unsupported texture banks. Use -gpu-renderer=false to select the software renderer. Framebuffer comparisons cover Doom and Doom II, close-up sprites, gamma, invulnerability, and faithful high/low detail. Small texture-boundary rounding differences remain. Spectre fuzz keeps its 320×200 grain at every resolution, using classic column order, neighbor feedback, and COLORMAP row six. Spectres draw between sprites and masked textures in depth order, so nearer enemies stay sharp. Feedback interrupted by clipping remains approximate. See the visual checks and measured performance for results and reproduction.

# Faithful palette and classic presentation, drawn by GPU shaders.
go run . -wad DOOM1.WAD -sourceport-mode=false

# Compare the same scene with the CPU software renderer.
go run . -wad DOOM1.WAD -sourceport-mode=false -gpu-renderer=false

Gameplay and features

  • Mouse look, configurable bindings, improved automap, and browser touch controls.
  • Saves, quicksave, classic demo playback/recording, and per-tic trace export.
  • Base game WADs and layered add-ons; local WAD loading and browser saves.
  • Live broadcast/watch sessions, spectator chat, and optional voice.

Music and sound

Choose music and sound effects separately in the frontend, or use launch flags.

Music choice Sound and selection
OPL / AdLib FM Default classic AdLib/Sound Blaster-era music, using an OPL2-style synth and the WAD's GENMIDI instruments. -music-backend=impsynth
General MIDI Sample-based music through MeltySynth; general-midi.sf2 is included in desktop releases and embedded in the browser build.
SC55-HQ Alternative SoundFont for an SC-55-style MIDI presentation; available on demand from the frontend.
SGM Ultra HQ Richer SoundFont option, shown as SGM-ULTRA-HQ in the frontend and downloaded on demand as SGM-HQ.sf2.
PC speaker music An extra beeper arrangement of Doom's music, beyond the original game's sound-effects-only PC speaker option. -music-backend=pcspeaker

For SoundFont music, use -music-backend=meltysynth -soundfont=PATH.sf2. You can also supply your own compatible .sf2 file; browser SoundFonts are cached after loading.

Sound effects: choose the original digital Sound Blaster-style effects or -pc-speaker for Doom's PC speaker effects. The default paper-speaker model uses a physical speaker simulation: original PIT tone timing drives a model of cone motion, mass, spring response, damping, acoustic filtering, and steel-case resonance/reverberation for a faithful old-PC sound. A resonant small-buzzer model and direct passthrough beeps are also available. PC speaker music and effects can share the same simulated speaker through time interleaving.

# PC speaker effects and music through the physical paper-speaker model.
go run . -wad DOOM1.WAD -pc-speaker -music-backend=pcspeaker \
  -pc-speaker-variant=paper-speaker

# SoundFont music with the usual digital effects.
go run . -wad DOOM1.WAD -music-backend=meltysynth \
  -soundfont=soundfonts/general-midi.sf2

On Linux, -pc-speaker-output=linux can drive a real PC speaker through the pcspkr evdev device, with write permission to that device. Music and effects have separate volume controls. Use -dump-music for FM/SoundFont WAV exports or cmd/musicwav for FM/PC speaker renders; see the usage guide.

Original Doom demo compatibility

The completed COMPET-N sweep covers 4,646 single-player Ultimate Doom and Doom II recordings across all 68 starting maps. Verified 2026-10-02 against the gameplay source shipped in v0.1.1:

Outcome Recordings
Strict state and gameplay RNG match 4,621
Semantic state and gameplay RNG match only 7
Documented exclusions 18
Pending or unexplained failures 0

99.61% pass; 99.46% match strictly. Every pass includes an independent per-tic gameplay RNG audit through original termination or first player death, including the death tic. The opt-in semantic policy ignores only an unused field on downward lowerAndCrush ceilings and retains raw strict mismatches. The eighteen exclusions count in the denominator and comprise seventeen original-reference crashes and one door using uninitialized memory.

Compatibility guide · Per-recording results · Exclusions · Desync investigation

Quick start

Desktop releases include the shareware DOOM1.WAD and a General MIDI SoundFont. Supply your own commercial WAD for the full games. From a source checkout:

go run . -wad DOOM1.WAD
go run . -wad DOOM2.WAD -sourceport-mode
go run . -wad DOOM2.WAD -file mods/nerve.wad,mods/examplepatch.wad

The WAD can also be the first positional argument. Without -wad, the in-game picker offers installed games plus Freedoom Phase 1, Freedoom Phase 2, and FreeDM. These standalone games need no other base WAD and download only when selected, with size and SHA-256 verification. Graphics, sound, and music setup still runs before play. Doom Shareware remains bundled for offline use. FreeDM supplies deathmatch arenas; the two Freedoom phases supply campaigns. See free games, licenses, and server installation. For demos and live sessions, use matching base WADs and add-ons on every instance.

Source builds require Go 1.27.4 or newer and a Doom WAD. Linux also needs the usual X11, OpenGL, and audio development dependencies. On Debian/Ubuntu:

sudo apt install -y build-essential pkg-config libasound2-dev libpulse-dev \
  libx11-dev libxcursor-dev libxinerama-dev libxrandr-dev libxi-dev \
  libgl1-mesa-dev libxxf86vm-dev

Use go run . -help for every flag. Common options include -map=MAP01, -demo=FILE.lmp, -record-demo=FILE.lmp, -config=config.toml, and -gpu-renderer=false. Settings and key bindings can be changed in the menus and saved to config.toml.

Controls and live sessions

Move with WASD or arrows, turn with the mouse, fire with Ctrl or left mouse, use with E/Space, run with Shift, and open the automap with Tab. Use Esc for menus, T for chat, and Caps Lock for push to talk. Bindings are configurable.

Run go run ./cmd/gdsfrelay, then start a game with -broadcast. Join from another instance with -watch -watch-session=N, using the session ID printed by the broadcaster. Native Linux microphone capture is available with -mic. See the relay, voice, controls, and cheats reference.

Authoritative co-op/deathmatch is available through cmd/gdserver and the -connect client option, with prediction, reconnects, chat and spectators. In desktop and browser games, open Esc → Multiplayer. Find Game opens the live room list; Create Game starts a room of your own. Player Setup contains your name and player/spectator preference. Servers opens the public GD-DOOM Co-op and GD-DOOM Deathmatch servers and your saved addresses, with a separate Manage Servers page for adding or editing them. Select a game and press Enter or tap Use to join. The list shows map, mode, player counts and whether your loaded WADs match. Saved addresses persist in native config or browser local storage. Back or Esc returns one page. During a match, Multiplayer → Players shows the live player list with names, ping, scores, and connection state; hold F6 for the quick scoreboard. Join, leave, and reconnect notices appear in a readable on-screen feed. A small gameplay indicator shows player count and your ping, with a warning for a stalled connection. In a match, Return to Game resumes play and Leave Match returns to the title menu without restarting the game. For user-created games, run cmd/gdlobby and configure the client with -multiplayer-lobby=https://your-lobby-host. Create Game keeps the name, mode and difficulty together. Game Files selects WADs and the starting level; Rules contains player limits, monsters, friendly fire and match limits. The lobby runs each room in its own authoritative server process. With uploads enabled, Upload Loaded WADs registers the game's current base WAD and overlays. Joining can download missing WADs explicitly approved for redistribution by the host and load the room's exact content, including graphics and audio. Matching local files are reused; private or commercial WADs must already be loaded. Uploads are private by default, and filenames never grant download permission. See lobby hosting and custom WADs. Mouse look turns left/right in multiplayer with your usual sensitivity and inversion settings; click the browser game to capture the pointer. Hold F6 for scores, press T for chat, or F12 to change the spectator view. The default deathmatch room supports four players, no monsters, and an E1M1/E1M2 rotation with a 20-frag or 10-minute limit; map exits can rotate early. After dying, press Use to respawn. New menu labels use a reusable large Doom menu font; Multiplayer matches the original menu lettering. Custom WADs can override it with an M_MULTI patch. See the font source and composition API. The multiplayer design and verification status records launch commands, transport choices, measured bandwidth, and remaining release requirements.

Browser and development

Build and serve the browser version from the repository root:

./scripts/build_wasm.sh
go run ./cmd/wasmserve

The build uses DOOM1.WAD and your Go toolchain's wasm_exec.js; optional wasm-opt optimizes the output. The browser supports local WAD loading, SoundFont caching, touch controls, and persistent saves. Click or tap once to start audio where browser autoplay policies require it. Set MULTIPLAYER_SERVER=https://your-host:6672/netplay when building to prefill the in-game server list. This does not join automatically. Set MULTIPLAYER_LOBBY=https://your-lobby-host to enable the live room browser and Create Game in the WASM build. These defaults are embedded in the game. The browser page only launches the game and selects WAD files. Choose graphics, sound, and music during game setup, then use the in-game Multiplayer menu to join or create a game. Browser URLs cannot join a server or skip game setup. Browser rendering uses VSync by default, with no separate WASM frame throttle. Automatic detail starts at full resolution and reduces quality if performance requires it. Re-enabling AUTO also starts at full resolution; explicit -detail-level overrides and manual detail settings remain available.

go test ./...
scripts/test_integration.sh ./internal/app

More options, configuration examples, export tools, and diagnostics are in Usage and development. See commercial WAD fingerprints, netplay protocol, and vector-rendering visibility notes for technical references.

GD-DOOM is still alpha. It is derived from id Software's Doom source release and distributed under GNU GPL v2; see LICENSE and NOTICE.

Releases

Used by

Contributors

Languages