How id-software/wolf3d works
Wolfenstein 3D is a single-player, ray-cast action game whose user-facing loop is navigating levels, fighting enemies, collecting items, and reaching level completion. The source separates player control, actor behavior, level/game flow, rendering, and shared engine services for assets, input, video, and sound. The excerpts show selected calls and shared-header dependencies; several gameplay and rendering links are therefore represented as unverified rather than asserted as confirmed call chains.
Main entry points: WL_GAME.C Game and level flow · WL_MAIN.C Startup and game setup · ID_CA.C Asset caching · WL_DEF.H Shared game declarations
Components 22
Gameplay
- Player control
WOLFSRC/WL_AGENT.C - Enemy behavior
WOLFSRC/WL_ACT2.C - Actor state and movement
WOLFSRC/WL_STATE.C - Game and level flow
WOLFSRC/WL_GAME.C - Startup and game setup
WOLFSRC/WL_MAIN.C - Shared game declarations
WOLFSRC/WL_DEF.H
World and rendering
- Level object placement
WOLFSRC/WL_GAME.C - Ray-cast rendering
WOLFSRC/WL_DRAW.C - Wall scaling
WOLFSRC/WL_SCALE.C - Legacy scaling
WOLFSRC/OLDSCALE.C
User interface
- Menus and settings
WOLFSRC/WL_MENU.C - Intermission and scores
WOLFSRC/WL_INTER.C - Game text
WOLFSRC/WL_TEXT.C
Engine services
- Input manager
WOLFSRC/ID_IN.C - Video manager
WOLFSRC/ID_VL.C - Sound manager
WOLFSRC/ID_SD.C - Asset caching
WOLFSRC/ID_CA.C - Page manager
WOLFSRC/ID_PM.C - Memory manager
WOLFSRC/ID_MM.C - Shared engine declarations
WOLFSRC/ID_HEADS.H
Other components
- Player
- Released game data
Connections 24
- Player → Startup and game setup: starts game
- Startup and game setup → Menus and settings: opens menu
- Menus and settings → Game and level flow: starts level
- Game and level flow → Level object placement: scans map
WOLFSRC/WL_GAME.C - Level object placement → Enemy behavior: spawns enemies
- Player control → Actor state and movement: moves player
- Enemy behavior → Actor state and movement: updates actors
- Game and level flow → Intermission and scores: shows results
- Ray-cast rendering → Wall scaling: scales walls
- Ray-cast rendering → Video manager: draws screen
- Startup and game setup → Video manager: sets view
WOLFSRC/WL_MAIN.C - Game and level flow → Asset caching: loads sounds
WOLFSRC/WL_GAME.C - Asset caching → Sound manager: loads sound data
- Intermission and scores → Sound manager: plays sounds
WOLFSRC/WL_INTER.C - Actor state and movement → Sound manager: plays sounds
WOLFSRC/WL_STATE.C - Menus and settings → Input manager: reads controls
- Asset caching → Page manager: uses pages
- Page manager → Memory manager: allocates pages
- Released game data → Asset caching: supplies assets
- Startup and game setup → Shared engine declarations: includes declarations
- Game and level flow → Shared game declarations: includes declarations
WOLFSRC/WL_GAME.C - Enemy behavior → Shared game declarations: includes declarations
WOLFSRC/WL_ACT2.C - Ray-cast rendering → Shared game declarations: includes declarations
WOLFSRC/WL_DRAW.C - Shared game declarations → Shared engine declarations: includes declarations
WOLFSRC/WL_DEF.H