Levels & Worlds
World file formats, loading pipeline, tile types, and object placement.
World Configuration
| Property | Value |
|---|---|
| World dimensions | 100 × 100 × 100 blocks |
| Chunk size | 10 × 10 × 10 blocks |
| Chunks per axis | 10 |
| Total chunks | 1000 |
| Tile grid (gameplay) | 100 × 100 tiles (MAXCELX × MAXCELY) |
| World center offset | kWCX=50, kWCZ=50 (Blupi origin mapped to block 50,0,50) |
The original game uses a 2D 100×100 tile grid. In Galaxy Eggbert, each tile maps to one row of blocks in the XZ plane. The Y axis adds 3D height; levels currently use Y=0 for the ground layer with walls and platforms above.
World File Formats
Galaxy Eggbert loads worlds from two file formats, tried in order:
1. Native Binary Format (.vwr)
A custom palette-compressed voxel format. See VWR Format for the complete specification.
- File magic:
VWR1 - Chunk payload magic:
VCH1 - Palette-compressed per chunk; empty chunks skipped
- Files are stored in
worlds/world001.vwr…worlds/world005.vwr - Generated from .txt on first run and cached for subsequent loads
2. Mobile-Eggbert Text Format (.txt)
A plain-text format from the original mobile-eggbert reference port.
Files are stored in worlds/world001.txt … worlds/world005.txt.
blupiPos=3200;3392 region=0 posDecor=1344;2048 …
Decor:
10,10,10,0,10,10,183,183,183, … ← 100 rows × 100 columns, tile IDs
…
MoveObject: type=2 stepAdvance=2 … posStart=640;640 posEnd=1280;640
MoveObject: type=5 stepAdvance=1 … posStart=1920;1280 posEnd=1920;1280
…
Header fields
| Field | Meaning |
|---|---|
blupiPos=X;Y | Blupi's spawn position in pixel coordinates (1 tile = 64 px) |
region=N | Sky dome background index (maps to backgrounds/decorNNN.png) |
posDecor=X;Y | Camera/scroll offset (not the grid origin; parsed but not used by Galaxy Eggbert) |
Decor section
100 comma-separated rows of tile IDs. Row index = world Z coordinate. Column index = world X coordinate.
Tile ID 0 = air. Tile ID → block type mapping: BlockTypes::fromMobileIconId(id).
Passable (decorative) tiles become Air; solid tiles keep their icon ID as block type.
MoveObject entries
| Field | Meaning |
|---|---|
type=N | ObjectType (must match ObjectType enum) |
stepAdvance=N | Speed: speed = max(0.5, stepAdvance/3.0) |
posStart=X;Y | Start position in pixels |
posEnd=X;Y | End position in pixels |
Supported object types from .txt files: 1, 2, 3, 4, 5, 6, 7, 12, 13, 16, 17, 20, 25, 30, 33, 49, 50, 51.
3. Demo World (fallback)
If neither .vwr nor .txt is found, a procedural demo world is generated
by GalaxyEggbertGame::BuildDemoWorld() and saved as .vwr for future runs.
The demo world includes: a 30×30 ground platform, perimeter walls, height-varied platforms,
a lava strip, a spike tile, patrol enemies, collectibles, and a level exit.
World Loading Pipeline
GalaxyEggbertGame::LoadWorld(worldNum):
1. Clear terrain nodes and material cache
2. Try to load worlds/worldNNN.vwr (binary)
3. If not found, try worlds/worldNNN.txt (text)
→ LoadMobileEggbertTerrain() parses header + Decor section + MoveObjects
4. If still no world, generate demo world, save as .vwr
5. SpawnTerrainNodes() → iterate all chunks, create one Node+StaticModel per non-air block
6. ApplyWorldSky(scene, worldNum) → set Zone ambient + fog
7. UpdateSkyDome(skyRegion_) → load sky sphere texture
Block Types
Block type = icon index into object-m.png. Named constants:
| Name | Icon ID | Description |
|---|---|---|
Air | 0 | Empty / no block |
Ground | 10 | Grass/ground tile |
StoneA | 18 | Light stone |
StoneB | 25 | Dark stone |
Wall | 183 | Brick wall |
Platform | 200 | Floating platform tile |
Lava | 68 | Hazard: kills Blupi |
Spike | 373 | Hazard: kills Blupi |
Crusher | 317 | Hazard: kills Blupi |
Marker | 309 | Marker tile (purpose: Needs verification) |
Sp0–Sp7 | 158–165 | Special tile variants |
| All other IDs (1–440) | icon ID | Rendered from object-m.png; no special gameplay |
Tile Passability
203 tile IDs are decorative (passable) and become Air when loaded from .txt files.
This is determined by the BlockTypes::isMobileTransparent(icon) lookup table,
derived from the original table_decor_quart data in mobile-eggbert.
Icons 68 (Lava) and 317 (Crusher) are excluded from the passable list even though
the original table marks them as decorative — they are kept solid for the hazard system.
The 5 Worlds
| World | Theme | Source File |
|---|---|---|
| 1 | Grassland | worlds/world001.txt |
| 2 | Forest | worlds/world002.txt |
| 3 | Ice Caves | worlds/world003.txt |
| 4 | Lava Fields | worlds/world004.txt |
| 5 | Space Station | worlds/world005.txt |