Data Formats
Mobile Eggbert uses two custom file formats: a binary save data file and text-based world (level) files.
Save Data Format
Managed by GameData. A flat 640-byte binary array written to the platform's persistent storage (IndexedDB on web, file system on desktop/Android).
Binary Layout
| Offset | Size | Content |
|---|---|---|
| 0–9 | 10 bytes | Header: version, selected gamer index, global settings (sound on/off, jump mode, zoom level, accelerometer on/off) |
| 10–219 | 210 bytes | Gamer slot A: lives remaining, last world reached, 200-byte door state array |
| 220–429 | 210 bytes | Gamer slot B (same structure) |
| 430–639 | 210 bytes | Gamer slot C (same structure) |
Gamer Slot Layout (210 bytes)
| Offset within slot | Size | Content |
|---|---|---|
| 0 | 1 byte | Number of lives remaining |
| 1 | 1 byte | Last world number reached |
| 2–201 | 200 bytes | Door state array — one byte per door, 0=locked, 1=opened |
| 202–209 | 8 bytes | Padding / reserved |
Serialization
Written and read via Worlds::ReadGameData() / Worlds::WriteGameData(). Key accessors:
getSelectedGamerProperty()/setSelectedGamerProperty(int)getNbViesProperty()/setNbViesProperty(int)getLastWorldProperty()/setLastWorldProperty(int)
World File Format
Levels are stored as line-delimited text files in worlds/worldNNN.txt. Each file describes a 100×100 tile grid plus metadata.
File Structure
# Line 1: metadata (DescFile fields as name=value pairs)
posDecor=x;y dimDecor=w;h world=N music=M region=R blupiPos=x;y blupiDir=d name=LevelName
# Following lines: Decor section (base tile layer)
# 100 lines, each with 100 comma-separated icon indices
icon0,icon1,...,icon99
...
# BigDecor section (secondary decorative layer)
# Same format as Decor section
# Doors section (door state array)
# Only non-default (non-1) values are written; format is compact
Field Value Formats
| Type | Format | Example |
|---|---|---|
| int | Plain integer | world=5 |
| double | Trailing .0 | time=30.0 |
| bool | True or False | rain=False |
| TinyPoint | x;y | blupiPos=3;7 |
| array | comma-separated | 1,2,3,4,… |
Level Numbering Scheme
| File range | Content |
|---|---|
world001.txt | Tutorial level |
world010–world019 | Chapter 1 (levels 0–9) |
world020–world029 | Chapter 2 |
world030–world039 | Chapter 3 |
| … (pattern continues) … | Chapters 4–9 |
world090–world099 | Chapter 9 |
world100–world199 | Chapters 10–19 |
world199.txt | Final bonus level |
DescFile Metadata Fields
The metadata line on line 1 of each world file uses the following named fields:
| Field | Type | Description |
|---|---|---|
posDecor | TinyPoint | Initial scroll position (tile coords) |
dimDecor | TinyPoint | Dimensions of the active world area (tiles) |
world | int | World/level number |
music | int | Background music track index |
region | int | Region/chapter number |
blupiPos | TinyPoint | Player starting position (tile coords) |
blupiDir | int | Player starting direction (1=Left, 2=Right) |
name | string | Level display name (used in ranking screen) |
Doors Section Compression
The Doors section in world files uses a sparse format: only non-default values are written.
The default door state is 1 (open/traversable), so a completely untouched door array would produce
an empty Doors section. This keeps level files compact.