Levels & Worlds

World file formats, loading pipeline, tile types, and object placement.

World Configuration

PropertyValue
World dimensions100 × 100 × 100 blocks
Chunk size10 × 10 × 10 blocks
Chunks per axis10
Total chunks1000
Tile grid (gameplay)100 × 100 tiles (MAXCELX × MAXCELY)
World center offsetkWCX=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.

2. Mobile-Eggbert Text Format (.txt)

A plain-text format from the original mobile-eggbert reference port. Files are stored in worlds/world001.txtworlds/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

FieldMeaning
blupiPos=X;YBlupi's spawn position in pixel coordinates (1 tile = 64 px)
region=NSky dome background index (maps to backgrounds/decorNNN.png)
posDecor=X;YCamera/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

FieldMeaning
type=NObjectType (must match ObjectType enum)
stepAdvance=NSpeed: speed = max(0.5, stepAdvance/3.0)
posStart=X;YStart position in pixels
posEnd=X;YEnd 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:

NameIcon IDDescription
Air0Empty / no block
Ground10Grass/ground tile
StoneA18Light stone
StoneB25Dark stone
Wall183Brick wall
Platform200Floating platform tile
Lava68Hazard: kills Blupi
Spike373Hazard: kills Blupi
Crusher317Hazard: kills Blupi
Marker309Marker tile (purpose: Needs verification)
Sp0–Sp7158–165Special tile variants
All other IDs (1–440)icon IDRendered 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

WorldThemeSource File
1Grasslandworlds/world001.txt
2Forestworlds/world002.txt
3Ice Cavesworlds/world003.txt
4Lava Fieldsworlds/world004.txt
5Space Stationworlds/world005.txt
More Detail For the full binary .vwr file format specification, see VWR Format. For the world loading internals, see World Loading.