struct octaheader { char magic[4]; // "OCTA" int version; // any >8bit quantity is little endian int headersize; // sizeof(header) int worldsize; int numents; int numpvs; int lightmaps; int blendmap; int numvars; };This structure is written straight into the first 36 bytes of the uncompressed map file. The magic field must be the 4-byte string (not zero-terminated) "OCTA" in order for the map to load correctly. For the format described herein, version must be 29, and headersize must be 36. The worldsize is the length of one side of the cube that contains the map (so that we know how big each cube of the octree is). If worldsize is not a power of 2, you will get some very strange effects. Numents is just the number of entities contained in the Entities section. Numpvs, lightmaps, and blendmap are not discussed in this documentation, so I just set them all to 0 and forget about them (you can run calclight from within edit mode to get these filled in properly). Numvars is the number of variables in the Variables section.
magic | version | headersize | worldsize | numents | numpvs | lightmaps | blendmap | numvars |
---|---|---|---|---|---|---|---|---|
OCTA | 29 | 36 | 1024 | 1 | 0 | 0 | 0 | 1 |
4f 43 54 41 | 1d 00 00 00 | 24 00 00 00 | 00 04 00 00 | 01 00 00 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00 | 01 00 00 00 |
type | name | value | ||
---|---|---|---|---|
SVAR | 6 | skybox | 15 | ik2k/env/iklake |
02 | 06 00 | 73 6b 79 62 6f 78 | 0f 00 | 69 6b 32 6b 2f 65 6e 76 2f 69 6b 6c 61 6b 65 |
length | string |
---|---|
3 | fps |
03 | 66 70 73 00 |
extraentinfosize | extras.length |
---|---|
0 | 0 |
00 00 | 00 00 |
texmru.length | texmru |
---|---|
5 | 2, 4, 3, 5, 7 |
05 00 | 02 00 04 00 03 00 05 00 07 00 |
enum { ET_EMPTY=0, ET_LIGHT, ET_MAPMODEL, ET_PLAYERSTART, ET_ENVMAP, ET_PARTICLES, ET_SOUND, ET_SPOTLIGHT, ET_GAMESPECIFIC }; struct entity // persistent map entity { vec o; // position short attr1, attr2, attr3, attr4, attr5; uchar type; // type is one of the above uchar reserved; };The "o" field is of a structure containing three 4-byte floats to specify the x, y, and z co-ordinates (in that order), and the "type" field is as in the following table. The Sauerbraten editing reference can give a lot more information for the meaning of the attribute values.
type | name | attributes |
---|---|---|
0 | ET_EMPTY | |
1 | ET_LIGHT | |
2 | ET_MAPMODEL | attr1 specifies the angle in degrees in the XY plane that the model is rotated by. attr2 specifies the model number. attr3 and attr4 control trigger behaviour. |
3 | ET_PLAYERSTART | attr1 gives the angle in degrees in the XY plane that the player is looking when he spawns. attr2 specifies the team for which this is a spawn point in team modes, either 1 or 2 (or 0 if it is for non-team modes). |
4 | ET_ENVMAP | attr1 specifies the radius of the environment map. |
5 | ET_PARTICLES | |
6 | ET_SOUND | attr1 specifies the sound index. attr2 specifies the radius in which a player must be in order to hear the sound. attr3, if non-zero, specifies the size within which the volume is maximal, and will start tapering when outside this size. |
7 | ET_SPOTLIGHT | |
8 | ET_GAMESPECIFIC | Game specific; unused in Sauerbraten |
position | attributes | type | reserved |
---|---|---|---|
972.0, 972.0, 516.0 | 336, 0, 0, 0, 0 | ET_PLAYERSTART | 0 |
00 00 73 44 00 00 73 44 00 00 01 44 | 50 01 00 00 00 00 00 00 00 00 | 03 | 00 |
type | name | data | description |
---|---|---|---|
0 | OCTSAV_CHILDREN | No more data. | Indicates that instead of moving on to the next child for the current parent cube, the map loader should recurse down and load 8 children for this cube. |
1 | OCTSAV_EMPTY | 6 textures (though they are never visible) and a mask. | Indicates a cube of empty space. |
2 | OCTSAV_SOLID | 6 textures and a mask. | A cube of solid space. |
3 | OCTSAV_NORMAL | 6 textures, a mask, and 24 edges. | TODO: Find out about this. This is basically a cube that has been deformed by moving its corners. |
4 | OCTSAV_LODCUBE | 6 textures and a mask. | This is the same as OCTSAV_CHILDREN, except it has its own textures, which presumably means that Sauerbraten will draw this instead of child cubes when the viewer is far enough away. |
bits | material/properties |
---|---|
......00 | Air |
......01 | Water |
......10 | Lava |
......11 | Glass |
...01... | No clip (no collision) |
...10... | Clip (full cube collision) |
...11... | Game-specific clip |
..1..... | Death |
1....... | Edit-only surface |
type | textures | mask |
---|---|---|
OCTSAV_SOLID | 2, 3, 4, 5, 6, 7 | 0 |
02 | 02 00 03 00 04 00 05 00 06 00 07 00 | 00 |
OCTSAV_SOLID | 2, 3, 4, 5, 6, 7 | 0 |
02 | 02 00 03 00 04 00 05 00 06 00 07 00 | 00 |
OCTSAV_SOLID | 2, 3, 4, 5, 6, 7 | 0 |
02 | 02 00 03 00 04 00 05 00 06 00 07 00 | 00 |
OCTSAV_SOLID | 2, 3, 4, 5, 6, 7 | 0 |
02 | 02 00 03 00 04 00 05 00 06 00 07 00 | 00 |
OCTSAV_EMPTY | 0, 0, 0, 0, 0, 0 | 0 |
01 | 00 00 00 00 00 00 00 00 00 00 00 00 | 00 |
OCTSAV_EMPTY | 0, 0, 0, 0, 0, 0 | 0 |
01 | 00 00 00 00 00 00 00 00 00 00 00 00 | 00 |
OCTSAV_EMPTY | 0, 0, 0, 0, 0, 0 | 0 |
01 | 00 00 00 00 00 00 00 00 00 00 00 00 | 00 |
OCTSAV_EMPTY | 0, 0, 0, 0, 0, 0 | 0 |
01 | 00 00 00 00 00 00 00 00 00 00 00 00 | 00 |
section | data |
---|---|
header | 4f 43 54 41 1d 00 00 00 24 00 00 00 00 04 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 |
variables | 02 06 00 73 6b 79 62 6f 78 0f 00 69 6b 32 6b 2f 65 6e 76 2f 69 6b 6c 61 6b 65 |
gameident | 03 66 70 73 00 |
extras information | 00 00 00 00 |
texture mru | 05 00 02 00 04 00 03 00 05 00 07 00 |
entities | 00 00 73 44 00 00 73 44 00 00 01 44 50 01 00 00 00 00 00 00 00 00 03 00 |
octree | 02 02 00 03 00 04 00 05 00 06 00 07 00 00 02 02 00 03 00 04 00 05 00 06 00 07 00 00 02 02 00 03 00 04 00 05 00 06 00 07 00 00 02 02 00 03 00 04 00 05 00 06 00 07 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |
lightmaps, pvs, blendmap |