World files are those were changes to a world by a player are saved when the world unloads.
All of these files are written un the MessagePack serialization format and then compressed. Their extension is ‘.mpk.gz’
A world is saved at ‘$XDG_DATA_HOME/voxelgarden/saves/WORLD/’.
Stores specific data about the whole world that is loaded once when the world starts, and saved when the world closes.
[
Mob player;
]
See below for mob data format.
Store data relative to the world heightmap for a 16x16 column of cells; X and Z are the coordinates of any of the columns in the chunk divided by 16 (rounded down).
[
int x = X,
int y = Y,
array(256) data = [
[ int height, int light ]...
]
]
Store the full cell map for a chunk of 16x16x16 cells; X, Y, Z are the coordinates of any of the cells in the chunk divided by 16 (rounded down).
[
array indices = [ string... ],
array(4096) cells = [ int... ],
bits(4096) light = [ byte... ],
map data = { int pos: Cell_data data }
]
The dictionary is merely a list of the names of the cell types that appear in the chunk; the list of cells uses indices from this list to determine the actual cell type by cross-referencing this list and the internal cell type database.
Store the full mob list for a chunk of 16x16x16 cells; X, Y, Z are the coordinates of any of the cells in the chunk divided by 16 (rounded down).
[ Mob... ]
See below for mob data format.
Each mob is stored as an array with the following values:
[
string id
array(3) pos = [ float, float, float ]
array(3) vel = [ float, float, float ]
array(3) rot = [ float, float, float ]
array(2) size = [ float, float ]
array items = [ Item... ]
]
Each item contains the following values
[
string id,
int count
]
Unlike cells and mobs, item stacks can have empty id strings, representing an empty stack of items.
At this point, additional data for cells contains only an optional inventory
[
array items = [ Item... ]
]