Modules
The source tree grouped by what each part is responsible for (as of 2026-11-10).
The code has about 66 000 lines: 178 source files under src/ and 31 headers under
include/. It is layered: an engine-independent world model at the bottom, the game
and the editor above it, and a thin CNA application host on top
(Architecture). The groups below are a reading aid, not
separate libraries. Most of them live in the same directory, src/GalaxyEggbert/Game/
(namespace GalaxyEggbert::Game).
| Module | Where | Depends on CNA? |
|---|---|---|
| World data model | include/GalaxyEggbert/, src/GalaxyEggbert/Worlds/, src/GalaxyEggbert/*.cpp | No (enforced) |
| Game simulation | src/GalaxyEggbert/Game/ | Mostly no |
| Rendering | src/GalaxyEggbert/Game/ | Yes (pure helpers excepted) |
| 3D effects | src/GalaxyEggbert/Game/ | Yes (the *Logic.hpp parts no) |
| UI, input and audio | src/GalaxyEggbert/Game/ | Yes |
| Persistence and replay | src/GalaxyEggbert/Game/ | Mostly no |
| Editor | src/GalaxyEggbert/Editor/ | Partly |
| Application host | src/GalaxyEggbertCNA/ | Yes |
| Tools and tests | tools/, tests/ | Some Verify* tools link the game |
World data model
The voxel world and the original's data, with no CNA or cna-engine include, so it can be unit-tested
without a window. Namespaces GalaxyEggbert::Worlds and GalaxyEggbert.
| Part | Files | What it holds |
|---|---|---|
| Voxel container | Worlds/World, Chunk, Block, BlockMetadata, VoxelConfig, BitPacking, BinaryIO, GridRaycast.hpp |
A 100×100×100 grid in 10×10×10 chunks with palettes, bit packing, sparse metadata and a change journal; .vwr load and save. See World. |
| The original's enums | Def/*.hpp (ObjectType, BlupiAction, SoundChannel, SpriteChannel, GamePhase, GameSpeed, …) |
Numbers that are stored in world files and must never change. |
| Block facts | BlockTypes.hpp, BlockDefinitionRegistry, UnverifiedRenderMapping.hpp |
One definition per block icon 0-440: render mode, collision, animation, role flags. See BlockDefinitionRegistry. |
| Records | MoveObjectRecord, BigDecorRecord, HintZoneRecord, PlayerStart.hpp |
Codecs for the sparse metadata stored in a world. See MoveObjectRecord. |
| Hubs | HubDoors | Mission doors, gold doors, world signs and arrivals. See HubDoors. |
| Constants | GameConstants.hpp | Grid size, the original's 640×480 logical screen, sprite cell size. |
Game simulation
The rules of play. These parts run on the fixed 1/60 s tick, are deterministic, and mostly see only
the World and plain numbers, which is what lets the Verify* tools drive them
headless.
| Part | Files |
|---|---|
| Blupi's movement and collision | BlupiController, SolidBox.hpp, CratePush.hpp, BarRows.hpp |
| Objects, enemies, hazards, pickups | InteractionSystem, EnemyBlupi.hpp, TankShot.hpp, ReusablePickup.hpp, FanGeometry.hpp, LavaHeight.hpp, LavaSurfaceData.hpp, DecorQuartTable.hpp |
| World state at run time | WorldRuntime, LegacySawFloors.hpp, PlateRotationMetadata, ObjectVerticalPlacement.hpp |
| Object facts and pictures | ObjectDefinitionRegistry, ObjectIcons (GetObjIcon) |
| Hints | TrainingHints (the original's training hints), ObjectiveHint.hpp (the compass aid) |
| Camera | ChaseCameraYaw, CameraShake |
Rendering
The host reads the simulation into a SceneFrame draw list, and
WorldRenderer draws it. Details:
Rendering.
| Part | Files |
|---|---|
| Frame and draw list | SceneFrame.hpp, WorldRenderer |
| Terrain | TerrainRenderer, TileAtlas, TileCoverage.hpp, TerrainLighting.hpp, TerrainModelCells.hpp, TerrainAnimDivisor, TerrainOcclusion.hpp (face culling), BrickEdges.hpp, MeshParts.hpp, SwatchUv |
| Block render modes | DirectionalCubeTiles, InnerPillarBoxTiles, ThinBarTiles, InnerFlatPlateTiles, BlockModels.hpp, LiftVisual.hpp |
| Terrain relief | TerrainRelief (the Ray Dream relief of each tile near the camera) |
| Models | ObjectModelTable, ModelSubdivision.hpp, ProceduralMaterial.hpp, CharredBlupi.hpp, BoltMesh.hpp, BoltPaths.hpp, GlueStrands.hpp |
| Surfaces | WaterSurface.hpp, WaterWaves.hpp, LavaSurface.hpp |
| Textures and sprites | TextureScale (1x/2x sheets), TexturedMesh.hpp, QuadBatch |
3D effects
The Setup's effect levels Off, Low, Medium, High and Ultra. They change presentation only, and the simulation is identical at every level (3D Effects & Graphics).
| Part | Files |
|---|---|
| Fog, soft shadows, particles | WorldEffects.cpp, EffectParticles, SceneEffectsLogic.hpp |
| Shaders and shadow maps | SceneShaders, SurfaceShaders (water, lava) |
| Post-processing | PostProcess (the glow and the finish) |
| Ultra | UltraFinish (HDR, tonemapping, TAA, depth of field, motion blur), UltraLogic.hpp, UltraAssets.hpp, TerrainGi.hpp (voxel GI), TerrainMaps.hpp |
UI, input and audio
| Part | Files |
|---|---|
| HUD | Hud, TextMetrics.hpp, DebugOverlay.hpp |
| Menus, on-screen pad, typed cheats | InputPad, CheatConfig.hpp |
| Devices | ControlInput.hpp, GamepadInput.hpp |
| Sound | Sound |
Persistence and replay
| Part | Files |
|---|---|
| Settings and progress | SaveData, UserFolder |
| Resuming an interrupted mission | ResumeLog |
| Demos and recordings | DemoReplay, FreeFileName.hpp |
| Scripted playthroughs (QA) | Autoplay |
See Save Data & Resume.
Editor
The in-game 3D world editor, namespace GalaxyEggbert::Editor
(3D World Editor).
| Part | Files |
|---|---|
| Editing session | WorldEditor (WorldEditor.cpp, WorldEditorUpdate.cpp), EditCommandStack, Clipboard, BoxRegion, VoxelRaycast, AutoTile.hpp, EditorVariants.hpp, ObjectPlacement.hpp, PlayerStartColor.hpp, EditorCommandKeys.hpp |
| Palette | EditorPalette, EditorPaletteInput, EditorPaletteLayout, EditorPaletteRenderer, PaletteCategories |
| Drawing aids | EditorHighlightRenderer, ObjectPathRenderer, ObjectPathMarkers.hpp |
| Touch and gamepad | EditorDeviceControls |
| Screens and storage | EditorBrowserScreen (world slots), GalaxyBrowserScreen (the player's galaxy), CustomWorldStorage, PlatformFiles |
Application host
src/GalaxyEggbertCNA/ holds the XNA Game subclass
GalaxyEggbertGame and everything
platform-specific. It is split by concern:
| File | Concern |
|---|---|
main.cpp | Command-line flags, the user folder, Run() |
GalaxyEggbertGame.cpp | Construction, input capture, music and vehicle sounds, voyages, cheats, full screen, focus loss and exit |
GalaxyEggbertGameLoad.cpp | LoadContent() and building a world's presentation (terrain, models, reliefs) |
GalaxyEggbertGameUpdate.cpp | Update() and the simulation tick UpdateTick() |
GalaxyEggbertGameMissions.cpp | Autoplay steps, loading worlds (campaign, editor, galaxy, title scene), hub doors and phases |
GalaxyEggbertGameScene.cpp | Reading the simulation into the SceneFrame |
GalaxyEggbertGameDraw.cpp | The frame: world, HUD, menus, editor, captures |
GalaxyEggbertGameDemo.cpp | The resume log, the main-menu demos and the player's recordings |
GameHelpers.hpp, GameInternal.hpp | Helpers shared by the files above |
AndroidAssets.cpp | Copying the assets to internal storage on Android |
Tools and tests
tests/GalaxyEggbert/: GoogleTest unit tests of the world model and records.tools/Verify*.cpp: headless verification executables run byctest.tools/worlds/: one Python generator per campaign world plus shared kits.tools/autoplay/: scripted playthroughs;tools/*.sh: QA scripts.tools/rd4_to_gltf/,tools/terrain_relief/,tools/music/and others: asset converters.
See Testing & QA and Assets & Tools.