Levels & Worlds

Level Files

Levels are stored as .blp binary files in gamefiles/DATA/. Each file contains a level header (DescFile) followed by the full world grid data.

Level File Header (DescFile)

The DescFile struct (defined in include/decor.hpp) is the header stored at the beginning of each worldNNN.blp file:

FieldTypeDescription
majRevshortFile format major revision
minRevshortFile format minor revision
posDecorPOINTInitial camera/scroll position
dimDecorPOINTWorld dimensions used in this level
worldshortWorld/chapter number
musicshortBackground music track index (0–9)
regionshortVisual region/theme (selects decor spritesheet)
blupiPos[4]POINT[4]Player start positions (up to 4 players)
blupiDir[4]int[4]Player start facing directions
name[100]char[100]Level name string

World Grid

The world is a 100×100 grid of cells. Each cell holds a Cellule — essentially a 16-bit icon index into the terrain spritesheet for the current region.

typedef struct {
    short icon;  // sprite index into the background/decor sheet
} Cellule;

Two grids are stored in DescSave:

  • decor[100][100] — main terrain grid
  • bigDecor[100][100] — background/decor overlay layer

Chapter Structure

Levels are stored as worldNNN.blp files in gamefiles/DATA/. The numbering scheme groups them into chapters — 74 main-game levels plus bonus, special and secret levels (96 world files total).

World FilesChapterCount
001Tutorial / Intro1
010, 020–025Chapter 17
030–034, 040–046Chapter 212
050–058Chapter 39
060–066Chapter 47
070–075Chapter 56
080–084Chapter 65
090–095Chapter 76
100–107Chapter 88
110–115Chapter 96
120–125Chapter 106
199Special1
201–212Bonus / Extra12
300–309Secret10

Visual Regions

Each level has a region setting that determines which terrain spritesheet (decor000.blpdecor031.blp) is used for rendering. 32 regions are defined, each representing a distinct visual theme.

🔍
Needs Verification
The complete mapping of region numbers to visual themes (e.g., grass, snow, cave, underwater) is not fully documented. This requires analysis of the decor spritesheet files.

Moving Objects in Levels

Each level can contain up to 200 simultaneously active moving objects (MAXMOVEOBJECT). These include:

  • Enemies (fish, birds, wasps, creatures)
  • Bombs (floor, hanging, moving, homing)
  • Vehicles (helicopter, jeep, tank, hovercraft)
  • Interactive objects (crates, lifts, conveyors)
  • Collectibles (treasure, eggs, keys)
  • Visual effects (explosions, splashes, particles)

Each moving object is defined by a MoveObject struct with type, start/end positions, timing, and animation state. See Data Structures → MoveObject.

Level Editor

The game includes a built-in level editor (WM_PHASE_BUILD), implemented in src/decdesign.cpp. The editor allows placing and removing tiles and objects.

⚠️
Editor Incomplete
The level editor (decdesign.cpp) has known missing features and is considered one of the files requiring the most work. Custom level editing and export may not function correctly.

Level editor I/O phases:

  • WM_PHASE_NAMEDESIGN — name a custom level
  • WM_PHASE_WRITEDESIGN — export design to c:\user (legacy path)
  • WM_PHASE_READDESIGN — import design
  • WM_PHASE_CLEARDESIGN — clear the current design
  • WM_PHASE_PLAYTEST — test the current design in-game

Save Game State (DescSave)

The full game state — including the world grid, all moving objects, and player status — is serialized to a DescSave struct (~56KB) when saving. Up to 6 save slots (MAXSAVE=6) are supported.

See Data Structures → DescSave for the complete field list.