How id-software/doom works
Purpose and Build Entry Points
This is the Linux DOOM 1.10 engine source release, licensed GPL-2.0, requiring externally supplied commercial DOOM WAD game data. The primary executable is built from linuxdoom-1.10/Makefile; process startup begins at linuxdoom-1.10/i_main.c and transfers into the game driver in linuxdoom-1.10/d_main.c. A separate sound-server executable lives in sndserv/Makefile.
Runtime Orchestration and Game States
linuxdoom-1.10/d_main.c initializes subsystems, selects the game state, drives the main loop, and coordinates display updates. linuxdoom-1.10/g_game.c implements game progression, demo/save behavior, player command handling, and per-tick game dispatch. Shared global engine state and gameplay definitions form a broad coupling boundary in linuxdoom-1.10/doomstat.h, linuxdoom-1.10/doomdef.h, and linuxdoom-1.10/doomdata.h.
Input, Tick, and World Simulation
The engine advances a deterministic tic-based simulation: input events are represented through linuxdoom-1.10/d_event.h, player commands through linuxdoom-1.10/d_ticcmd.h, and scheduling/network-facing tic flow through linuxdoom-1.10/d_net.c. World thinkers and object updates are managed by linuxdoom-1.10/p_tick.c, while player movement, collision interactions, monsters, and map specials span linuxdoom-1.10/p_user.c, linuxdoom-1.10/p_map.c, and linuxdoom-1.10/p_enemy.c.
Level Data, Memory, and Persistence
WAD files are the primary external content boundary. linuxdoom-1.10/w_wad.c loads and looks up named binary lumps; linuxdoom-1.10/p_setup.c converts level lumps into runtime map structures. The custom zone allocator in linuxdoom-1.10/z_zone.c owns tagged game memory. Save/load serialization is handled by linuxdoom-1.10/p_saveg.c; compatibility depends on the game’s binary data layouts.
Software Rendering Pipeline
The renderer consumes BSP-organized level geometry and runtime objects. linuxdoom-1.10/r_main.c controls view rendering; linuxdoom-1.10/r_bsp.c traverses map BSP nodes and subsectors; linuxdoom-1.10/r_segs.c, linuxdoom-1.10/r_plane.c, and linuxdoom-1.10/r_things.c render walls, flats, and sprites. Asset preparation and texture/flat lookup are in linuxdoom-1.10/r_data.c; final framebuffer operations pass through linuxdoom-1.10/v_video.c and platform video code in linuxdoom-1.10/i_video.c.
UI, Audio, and Platform Boundary
Menus, HUD, status bar, intermission, and finale are separate presentation layers: linuxdoom-1.10/m_menu.c, linuxdoom-1.10/hu_stuff.c, and linuxdoom-1.10/st_stuff.c. Gameplay emits sound requests through linuxdoom-1.10/s_sound.c; Linux platform integration is in linuxdoom-1.10/i_sound.c, linuxdoom-1.10/i_system.c, and linuxdoom-1.10/i_net.c. Sound can be delegated to the companion sndserv/soundsrv.c, which reads WAD sound resources via sndserv/wadread.c.
Multiplayer Transports
The engine-level network protocol and tic synchronization are defined by linuxdoom-1.10/d_net.c and linuxdoom-1.10/i_net.c. Legacy peer-to-peer transport implementations are maintained separately: IPX setup/network code under ipx/DOOMNET.C and ipx/IPXNET.C, and serial setup/transport under sersrc/DOOMNET.C and sersrc/PORT.C. These are distinct from the Linux build and represent platform/transport-specific integration boundaries.
Main entry points: d_main.c Game driver · g_game.c Game progression · d_net.c Tic scheduling · w_wad.c WAD lump loader
Components 23
Engine Runtime
- Linux engine build · Builds the primary executable.
linuxdoom-1.10/Makefile - Process startup
linuxdoom-1.10/i_main.c - Game driver · Initializes subsystems and coordinates game states and display.
linuxdoom-1.10/d_main.c - Game progression
linuxdoom-1.10/g_game.c - Shared engine definitions · Global state and binary gameplay definitions.
Simulation & Data
- Tic scheduling
linuxdoom-1.10/d_net.c - Input events & commands
- World simulation · Runs thinker updates, player movement, collisions, enemies, and specials.
- Commercial DOOM WAD · Required external binary game content.
- WAD lump loader
linuxdoom-1.10/w_wad.c - Level setup · Converts level lumps into runtime map structures.
linuxdoom-1.10/p_setup.c - Zone allocator
linuxdoom-1.10/z_zone.c - Save/load serialization
linuxdoom-1.10/p_saveg.c
Rendering & UI
- View renderer
linuxdoom-1.10/r_main.c - BSP traversal
linuxdoom-1.10/r_bsp.c - World drawing
- Render asset data
linuxdoom-1.10/r_data.c - Video output
- HUD and menus
Platform & Transports
- Audio integration
- Sound server · Reads WAD sound resources in a separate process.
- Linux system & network
- Legacy IPX & serial · Separate non-Linux transport implementations.
Connections 27
- Linux engine build → Process startup: builds
- Process startup → Game driver: enters
- Game driver → Game progression: drives
- Game driver → Tic scheduling: runs tics
- Game driver → View renderer: updates display
- Game driver → HUD and menus: updates
- Game progression → World simulation: dispatches tick
- Input events & commands → Tic scheduling: supplies commands
- Tic scheduling → World simulation: schedules
- Shared engine definitions → Game progression: defines state
- Shared engine definitions → World simulation: defines data
- Commercial DOOM WAD → WAD lump loader: binary lumps
- WAD lump loader → Level setup: provides level lumps
- Level setup → World simulation: builds map
- Zone allocator → World simulation: owns game memory
- Game progression → Save/load serialization: saves and loads
- World simulation → View renderer: runtime geometry & objects
- View renderer → BSP traversal: traverses
- BSP traversal → World drawing: visible geometry
- Render asset data → World drawing: textures and flats
- WAD lump loader → Render asset data: assets
- World drawing → Video output: framebuffer
- Game progression → Audio integration: sound requests
- Audio integration → Sound server: delegates sound
- Commercial DOOM WAD → Sound server: sound resources
- Tic scheduling → Linux system & network: network I/O
- Legacy IPX & serial → Tic scheduling: alternate transport