Architecture

The Direction Lock, layering, and how CNA, Easy3D, and mobile-eggbert relate.

The Direction Lock

Verbatim intent from CLAUDE.md, the project's binding architectural rule set:

Galaxy Eggbert
  -> CNA directly
  -> Easy3D beside CNA (small helpers only — cameras, texture atlas, billboard/cube batching)
  -> mobile-eggbert used read-only as reference / asset / data source

This supersedes an older direction: Galaxy Eggbert -> Simple3D -> U3D / Urho3D / Nova3D -> (CNA someday).

Rules That Follow From the Lock

High-Level Layering

┌──────────────────────────────────────────────────────────┐
│  mobile-eggbert (read-only reference: assets + behavior)  │
└───────────────────────┬────────────────────────────────────┘
                        │ assets reused by file path / build-time copy
                        │ code/data referenced, never copied without approval
           ┌────────────▼─────────────┐
           │       CNA (game framework)│ ← XNA-compatible, SDL3-based
           └────────────┬─────────────┘
                        │ used directly (not hidden)
           ┌────────────▼─────────────┐        ┌─────────────────────┐
           │        Easy3D              │◄──────┤  cameras, atlas,     │
           │  (small helper library)    │       │  cube/billboard batch│
           └────────────┬─────────────┘        └─────────────────────┘
                        │
           ┌────────────▼─────────────┐
           │     GalaxyEggbertCNA        │  ← long-term target (this doc's focus)
           │  GalaxyEggbertCnaGame        │
           │  GEWorldRuntime, GETerrainRenderer,
           │  GETileAtlas, GEBlupiController
           └────────────┬─────────────┘
                        │ uses (engine-agnostic, shared)
           ┌────────────▼─────────────┐
           │   GalaxyEggbert::Worlds     │
           │   World / Chunk / Block /   │
           │   BlockMetadata / VoxelConfig│
           └──────────────────────────┘

  (Separately, GalaxyEggbertSimple3D — built on Simple3D/U3D — remains the
   only fully playable target and stays as reference until CNA reaches parity.)

GalaxyEggbertCNA Components

Entry point — main.cpp

Constructs a GalaxyEggbertCnaGame, calls Run(), deletes it.

Game — GalaxyEggbertCnaGame

Subclasses Microsoft::Xna::Framework::Game (CNA's game base class), overriding LoadContent(), Update(GameTime&), Draw(const GameTime&). Owns the world runtime, terrain renderer, Blupi controller, and camera. See class reference.

World runtime — GEWorldRuntime

Wraps a Worlds::World; loads .vwr or (secondary path) mobile-eggbert .txt; drives the 6 fps tile-animation phase. See class reference.

Terrain renderer — GETerrainRenderer

Builds a static + an animated Easy3D::CubeMeshRenderer from the world's non-air blocks. See class reference.

Tile atlas — GETileAtlas

Maps block type IDs to UV rects in object-m.png via Easy3D::TextureAtlas. See class reference.

Player controller — GEBlupiController

Invisible, collision-only movement placeholder: grid collision, step-up traversal, gravity, jump. See class reference.

World data model — GalaxyEggbert::Worlds

Engine-agnostic. No CNA or Easy3D dependency. Shared verbatim by GalaxyEggbertSimple3D and GalaxyEggbertCNA. See World, Chunk, Block.

Dependency Map

ComponentDepends on
GalaxyEggbertCnaGameCNA (Game, GameTime, Texture2D, BasicEffect, Keyboard), Easy3D (Camera3D), GEWorldRuntime, GETerrainRenderer, GEBlupiController
GEWorldRuntimeGalaxyEggbert::Worlds::World only
GETerrainRendererEasy3D (CubeBatch, CubeMesh, CubeMeshRenderer), GETileAtlas, Worlds::World, BlockTypes
GETileAtlasEasy3D (TextureAtlas)
GEBlupiControllerGalaxyEggbert::Worlds only — no CNA/Easy3D dependency, scriptable headlessly
Worlds::World / Chunk / BlockC++ stdlib only