How lepetitdhomme/room_base_procedural works
This is an SDL dungeon-exploration game. A seeded run initializes a level, maps it to a grid, then repeatedly handles input, moves the player, and renders the scene, entities, shadows, and optional map. The architecture also includes procedural room-and-connection generation, graph/door construction, collision and lighting systems. Some generation and rendering relationships are supported only by module references in the source index, so those links are dashed rather than presented as verified calls.
Main entry points: main.c SDL game loop · player.c Player movement · level.c Level generation · type.c Tile and type rules
Components 18
Game runtime
- SDL game loop
src/main.c - Input handling
src/inputs.c
Dungeon generation
- Level generation
src/level.c - Room placement
src/room.c - Room connections
src/kruskal.c - Connection helpers
src/connections.c - Dungeon graph
src/graph.c
World and movement
- Doors
src/door.c - World grid
src/grid.c - Player movement
src/player.c - Collision checks
src/collisions.c
Rendering and light
- Scene drawing
src/draw.c - Texture loading
src/textures.c - Shadow casting
src/shadow_casting.c - Room light maps
src/light_map.c
Shared utilities
- Tile and type rules
src/type.c - Geometry utilities
src/tools.c
Other components
- Player
Connections 22
- Player → Input handling: provides controls
- SDL game loop → Level generation: initializes level
src/main.c - SDL game loop → World grid: maps level
src/main.c - SDL game loop → Input handling: handles events
src/main.c - SDL game loop → Player movement: updates movement
src/main.c - SDL game loop → Scene drawing: draws scene
src/main.c - SDL game loop → Shadow casting: casts shadows
src/main.c - Level generation → Room placement: uses room placement
- Level generation → Room connections: builds connections
- Level generation → Dungeon graph: builds graph
- Room connections → Connection helpers: uses helpers
- Dungeon graph → Doors: constructs doors
- Player movement → Collision checks: checks destination
src/player.c - Player movement → Doors: opens doors
src/player.c - Player movement → World grid: refreshes grid
src/player.c - Player movement → Room light maps: resets room light
src/player.c - Player movement → Tile and type rules: tests tile types
src/player.c - Scene drawing → Texture loading: uses textures
- Scene drawing → Tile and type rules: uses tile rules
- Shadow casting → Geometry utilities: uses geometry helpers
- Shadow casting → Tile and type rules: uses tile rules
- Room light maps → Tile and type rules: uses tile rules