How abdooowd/ex-void works
Purpose and Runtime
Ex-Void is a native C space-exploration game built on raylib. The executable begins at src/main.c; game lifecycle and top-level orchestration are centered in src/code/game.c with public contracts in include/game.h.
Application Lifecycle
src/main.c initializes and runs the game through the game module rather than embedding gameplay directly. src/code/game.c likely owns the main loop, frame progression, and shutdown boundary; include/config.h provides project-wide compile-time game settings.
State-Based Game Flow
Game modes are separated into state modules. Setup/initialization behavior is implemented in src/code/states/setup_state.c and gameplay behavior in src/code/states/play_state.c, with interfaces in include/states/setup_state.h and include/states/play_state.h. The state transition/dispatch layer is represented by include/tables/gamestate_table.h, making state selection a central control-flow boundary.
Actor System
World entities use an actor abstraction defined by include/actor.h and implemented in src/code/actor.c. Actor behavior can be supplied through overlays/interfaces in include/actor_ovl.h and src/code/actor_ovl.c, separating generic actor lifecycle/storage from actor-specific logic. Registered actor types are indexed through include/tables/actor_table.h.
Concrete Content Modules
Individual game content lives under src/actors/. The current concrete actor is src/actors/actor_test/actor_test.c, with its local declaration in src/actors/actor_test/actor_test.h. New actor implementations are expected to integrate with the generic actor and actor-table layers rather than the game loop directly.
Shared Platform and Diagnostics Boundary
Common primitive types, utility APIs, and error handling are isolated under include/lib/types.h, include/lib/utils.h, and src/lib/errors.c. Debug facilities are separately exposed by include/debug.h and implemented in src/code/debug.c, providing a diagnostic boundary outside game-state and actor logic.
Generation and Build Infrastructure
The repository includes scaffolding tools for extending its two principal abstractions: tools/new_actor/new_actor.py generates actor modules, while tools/new_state/new_state.py generates state modules. Makefile is the build entry point; raylib is the material external runtime dependency.
Main entry points: game.c Game lifecycle · actor.c Actor core · actor_test.c Test actor · gamestate_table.h State dispatch
Components 18
Runtime
- raylib · External graphics and game runtime dependency.
- Program entry
src/main.c - Game lifecycle · Owns the main loop, frame progression, and shutdown.
src/code/game.c - Game contract
include/game.h - Game settings
include/config.h - Debug facilities
src/code/debug.c - Error handling
src/lib/errors.c
Game flow
- State dispatch · Central state selection and transition boundary.
include/tables/gamestate_table.h - Setup state
src/code/states/setup_state.c - Play state
src/code/states/play_state.c
Actor system
- Actor core · Generic actor lifecycle and storage.
src/code/actor.c - Actor contract
include/actor.h - Actor overlays · Separates actor-specific behavior from actor storage.
src/code/actor_ovl.c - Actor registry
include/tables/actor_table.h - Test actor
src/actors/actor_test/actor_test.c
Build & scaffolding
- Make build
Makefile - Actor generator
tools/new_actor/new_actor.py - State generator
tools/new_state/new_state.py
Connections 19
- Make build → Program entry: builds
- Make build → raylib: links
- Program entry → Game lifecycle: starts
- Game lifecycle → Game contract: implements
- Game lifecycle → Game settings: uses
- Game lifecycle → raylib: runs on
- Game lifecycle → State dispatch: dispatches through
- State dispatch → Setup state: selects
- State dispatch → Play state: selects
- Play state → Actor core: updates actors
- Actor core → Actor contract: implements
- Actor core → Actor overlays: delegates behavior
- Actor registry → Test actor: registers
- Test actor → Actor core: integrates with
- Test actor → Actor overlays: supplies behavior
- Game lifecycle → Debug facilities: emits diagnostics
- Debug facilities → Error handling: reports failures
- Actor generator → Test actor: scaffolds modules like
- State generator → Setup state: scaffolds modules like