How alegemaate/forager works
Forager is a 3D voxel-terrain game. Its runtime starts the Game scene, where the user plays by moving through and viewing a generated world; the README also documents world regeneration. The source tree separates world data and registries from chunk meshing, rendering, input, and GUI. The graph preserves those product areas, but several internals are unsampled, so their relationships are omitted rather than inferred. Edges cite the main entry point, sampled files, or README where the relationship is visible.
Main entry points: game.cpp Game scene · chunk_map.cpp Chunk map · controls.cpp Input bindings · Player.cpp Player movement
Components 20
Game runtime
- Application entry
src/main.cpp - Game scene
src/state/game.cpp - Player movement
src/game/Player.cpp - Camera
src/core/Camera.h
Voxel world
- World simulation
src/world/world.cpp - Chunk map
src/world/chunk/chunk_map.cpp - Chunk data
src/world/chunk/chunk.cpp - Biome registry
src/world/biome/biome_registry.cpp - Block registry
src/block/block_registry.cpp - Block types
src/block/block_type.h - Terrain noise
src/core/SimplexNoise.cpp
Rendering
- Chunk meshing
src/render/chunk_mesh.cpp - Cube faces
src/render/cube_faces.cpp - Shader programs
src/render/gpu_program_manager.h - Skybox
src/render/skybox.cpp - Asset loaders
src/utils/loaders.cpp
Input and interface
- Input bindings
src/game/controls.cpp - Toolbar
src/gui/toolbar.h - Screenshot capture
src/utils/screenshot.cpp
Other components
- Player
Connections 18
- Player → Input bindings: provides actions
README.md - Application entry → Game scene: registers scene
src/main.cpp - Game scene → Input bindings: uses actions
src/state/game.cpp - Game scene → Toolbar: uses interface
src/state/game.cpp - Game scene → Screenshot capture: captures screenshot
src/state/game.cpp - Player movement → Camera: updates position
src/game/Player.cpp - Player movement → Chunk map: checks collisions
src/game/Player.cpp - Player movement → Input bindings: reads actions
src/game/Player.cpp - World simulation → Input bindings: reads actions
src/world/world.cpp - Chunk map → Chunk data: stores chunks
- Chunk map → Block registry: uses block registry
- Chunk map → Biome registry: uses biome registry
- Chunk data → Block registry: looks up blocks
src/world/chunk/chunk.cpp - Block registry → Block types: stores types
- Chunk meshing → World simulation: reads world
src/render/chunk_mesh.cpp - Chunk meshing → Asset loaders: loads assets
src/render/chunk_mesh.cpp - Chunk meshing → Cube faces: uses face geometry
- Skybox → Shader programs: uses shader programs