How evanrinehart/doom works
Purpose and Build Targets
This repository preserves Doom 1.10-era C source across three execution targets: the Linux game port, DOS IPX networking utilities, and DOS serial-link utilities. The primary playable build is linuxdoom-1.10/, built through linuxdoom-1.10/Makefile; process startup is linuxdoom-1.10/i_main.c, which transfers control to game initialization in linuxdoom-1.10/d_main.c.
Engine Orchestration and Game States
d_main.c owns high-level startup, game loop, demo/title sequencing, and subsystem coordination. g_game.c implements game-state transitions, player commands, level progression, demos, and save/load integration. Shared global runtime state and core type definitions form a broad boundary in linuxdoom-1.10/doomstat.h, linuxdoom-1.10/doomdef.h, and linuxdoom-1.10/doomdata.h.
Fixed-Tick Simulation
The simulation advances through Doom “tics,” collecting commands and executing thinkers deterministically. Network/game tick handling is centered on linuxdoom-1.10/d_net.c; thinker scheduling is in linuxdoom-1.10/p_tick.c; player movement, interaction, enemies, and world specials are distributed through linuxdoom-1.10/p_user.c, linuxdoom-1.10/p_enemy.c, and linuxdoom-1.10/p_spec.c. This separates simulation state from rendering and platform I/O.
Level, WAD, and Memory Data Boundary
Game content is loaded from WAD archives by linuxdoom-1.10/w_wad.c. linuxdoom-1.10/p_setup.c turns map lumps into runtime geometry, things, sectors, and line structures; linuxdoom-1.10/r_data.c loads renderer-facing textures, flats, sprites, and colormaps. The custom zone allocator in linuxdoom-1.10/z_zone.c manages tagged allocations and enables level/resource lifecycle cleanup.
Software Rendering Pipeline
The renderer traverses BSP world geometry, projects visible walls/planes/sprites, and rasterizes into a software framebuffer. Primary stages are linuxdoom-1.10/r_main.c (frame orchestration), linuxdoom-1.10/r_bsp.c (visibility traversal), linuxdoom-1.10/r_segs.c and linuxdoom-1.10/r_plane.c (walls/floors/ceilings), and linuxdoom-1.10/r_things.c (sprites). linuxdoom-1.10/i_video.c is the platform video boundary; linuxdoom-1.10/v_video.c provides engine-level screen drawing.
Presentation and Audio
HUD, status bar, menus, intermission, finale, and automap are presentation layers over game state: linuxdoom-1.10/hu_stuff.c, linuxdoom-1.10/st_stuff.c, and linuxdoom-1.10/m_menu.c. Sound effect/music policy is in linuxdoom-1.10/s_sound.c; hardware/platform audio is isolated in linuxdoom-1.10/i_sound.c. Input, timing, errors, and process services similarly terminate at linuxdoom-1.10/i_system.c.
Multiplayer Transports
The engine-facing network abstraction is linuxdoom-1.10/i_net.c and linuxdoom-1.10/i_net.h, feeding the tic command/network layer. Legacy DOS IPX transport and setup tooling live separately in ipx/IPXNET.C, ipx/DOOMNET.C, and ipx/IPXSETUP.C. Serial multiplayer has parallel utilities in sersrc/PORT.C, sersrc/DOOMNET.C, and sersrc/SERSETUP.C; these are distinct transport implementations rather than services used by the Linux runtime.
Main entry points: d_main.c Game director · p_setup.c Level setup · r_main.c Frame renderer · g_game.c Game state
Components 22
Linux Doom Runtime
Primary playable build and engine runtime.
- Linux build
linuxdoom-1.10/Makefile - Process startup
linuxdoom-1.10/i_main.c - Game director · Startup, main loop, demos, and title sequencing.
linuxdoom-1.10/d_main.c - Game state · Transitions, commands, levels, demos, and saves.
linuxdoom-1.10/g_game.c - Core runtime state · Global state and core game data types.
linuxdoom-1.10/doomstat.h - Tic networking · Collects commands and advances game tics.
linuxdoom-1.10/d_net.c - Thinker simulation · Schedules player, enemy, and special world behavior.
linuxdoom-1.10/p_tick.c - Linux network I/O
linuxdoom-1.10/i_net.c - HUD and menus · HUD, status bar, and menu layers over game state.
linuxdoom-1.10/hu_stuff.c - Sound policy
linuxdoom-1.10/s_sound.c - System services · Input, timing, errors, and process services.
linuxdoom-1.10/i_system.c
Content and Rendering
WAD-backed level setup and software rendering.
- WAD archive loader
linuxdoom-1.10/w_wad.c - Zone allocator · Controls resource and level allocation lifecycles.
linuxdoom-1.10/z_zone.c - Level setup · Builds runtime geometry, things, sectors, and lines.
linuxdoom-1.10/p_setup.c - Render resources · Loads textures, flats, sprites, and colormaps.
linuxdoom-1.10/r_data.c - Frame renderer · Coordinates BSP visibility and world rasterization.
linuxdoom-1.10/r_main.c - BSP traversal
linuxdoom-1.10/r_bsp.c - Video output · Presents the software framebuffer.
linuxdoom-1.10/i_video.c
DOS IPX Utilities
Standalone IPX multiplayer transport and setup tools.
- IPX transport · Standalone DOS IPX networking implementation.
ipx/IPXNET.C - IPX setup
ipx/IPXSETUP.C
DOS Serial Utilities
Standalone serial-link transport and setup tools.
- Serial transport · Standalone DOS serial-link implementation.
sersrc/PORT.C - Serial setup
sersrc/SERSETUP.C
Connections 23
- Linux build → Process startup: builds
- Process startup → Game director: starts
- Game director → Game state: coordinates
- Game director → Tic networking: runs
- Game director → Frame renderer: draws frames through
- Game director → HUD and menus: updates
- Game state → Core runtime state: reads and updates
- Game state → Level setup: loads levels
- Tic networking → Linux network I/O: exchanges commands via
- Tic networking → Thinker simulation: advances
- Thinker simulation → Core runtime state: updates
- HUD and menus → Core runtime state: reads
- Sound policy → System services: uses platform services
- WAD archive loader → Level setup: supplies map lumps
- WAD archive loader → Render resources: supplies art lumps
- Zone allocator → Level setup: owns level allocations
- Zone allocator → Render resources: owns resource allocations
- Level setup → Frame renderer: provides world geometry
- Render resources → Frame renderer: provides render assets
- Frame renderer → BSP traversal: traverses visible world
- BSP traversal → Video output: rasterizes framebuffer for
- IPX setup → IPX transport: configures
- Serial setup → Serial transport: configures