.cmap format documentation
.cmap format documentation
The built-in map editor is passable but very limited. For this reason, I'd like to play with the .cmap files myself, but obviously I have no idea how to read them. Lewa, do you think you could give me some info about it?
Re: .cmap format documentation
Sure!
The game uses a custom binary format, thus data needs to be read in binary form.
In order to simplify how the structure looks like, i'll shorten the names of data types so that it's easiert to read.
Legend:
So here is the format (sequentially stored in the .cmap file)
I'll use the method of writing the information down as
Datatype (number of times this datatype was sequentially written into the file)
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ CMAP format \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
If something isn't clear enough i'll be more than happy to answer the given question.
The game uses a custom binary format, thus data needs to be read in binary form.
In order to simplify how the structure looks like, i'll shorten the names of data types so that it's easiert to read.
Legend:
- u8 - unsigned byte
- u16 - unsigned short (2 bytes)
- u32 - unsigned int (4 bytes)
- s16 - signed short (2 bytes)
- s32 - signed int (4 bytes)
- f32 - float
- f64 - double
So here is the format (sequentially stored in the .cmap file)
I'll use the method of writing the information down as
Datatype (number of times this datatype was sequentially written into the file)
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ CMAP format \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- u8 (11) > eleven unsigned bytes stored times (storing the identifier "celaria_map" as a string)
- u8 (1) > version number of the format
- u8 (1) > number of characters in the mapname
- u8 (namelength (previous byte) ) > name of the map as string
- u8 (2) > unused bytes (should be 0)
- u8 (1) > number of checkpoints
- u32 (checkpoint count) > platin times (for each checkpoint)
- u32 (checkpoint count) > gold times (for each checkpoint)
- u32 (checkpoint count) > silver times (for each checkpoint)
- u32 (checkpoint count) > bronze times (for each checkpoint)
- f32 (1) > sun rotation on the Z-axis
- f32 (1) > sun angle
- f64 (1) > camera preview x coordinate
- f64 (1) > camera preview y coordinate
- f64 (1) > camera preview z coordinate
- f64 (1) > camera preview lookat x coordinate
- f64 (1) > camera preview lookat y coordinate
- f64 (1) > camera preview lookat z coordinate
- u32 (1) > number of entities in the game (blocks, spawn markers, etc...)
>> here you start reading data (in a for-loop as an example) as many times as entities exist. Depending on the following byte you can identify with what type of entity you are dealing with
================repeat as many times as entities exist ==================
u8 (1) > entity ID
if entityID = 0 >> block entity
---------------then read------------------
u8 (1) > block type (red,green, white, yellow, etc...)
u8 (1) > unused byte
s32 (1) > x coordinate
s32 (1) > y coordinate
u32 (1) > z coordinate
u32 (1) > x scale
u32 (1) > y scale
u32 (1) > z scale
f32 (1) > z rotation
if block type = 5 >> means that the block is a checkpoint
then read the following byte
u8 (1) > read checkpoint order number
---------------------------------
if entityID = 1 >> sphere spawner
----------------then read-----------------
s32 (1) > x coordinate
s32 (1) > y coordinate
s32 (1) > z coordinate
---------------------------------
if entityID = 2 >> player startpoint
-----------------then read----------------
u8 (1) > unused byte
s32 (1) > x coordinate
s32 (1) > y coordinate
s32 (1) > z coordinate
f32 (1) > z rotation
---------------------------------
if entityID = 128 >> dummy object (used for special, internal stuff like the text markers on the tutorial map)
---------------then read------------------
u8 (1) > dummy ID
s32 (1) > x coordinate
s32 (1) > y coordinate
u32 (1) > z coordinate
u32 (1) > x scale
u32 (1) > y scale
u32 (1) > z scale
f32 (1) > z rotation
---------------------------------
=================================================================
If something isn't clear enough i'll be more than happy to answer the given question.

Re: .cmap format documentation
Thank you for answering. I'll play with this a bit.
Last bumped by Anonymous on Mon Dec 11, 2017 2:56 am.
Who is online
Users browsing this forum: No registered users and 1 guest