OBR is a file format that holds presets of Sauerbraten map geometries.
This is an incomplete overview and may contain misinterpretations, feel free to correct or add more information. :)
Example of an uncompressed .obr file:
4f45 4252 0000 0000 f001 0000 1002 0000 0002 0000 // header
0100 0000 0100 0000 0100 0000 1000 0000 0000 0000 // selection setup
0000 8083 8043 5050 8080 8080 8080 0100 0100 0200 0300 0400 0500 // first "cube"
4f45 4252 // magic (OEBR)
0000 0000 // ?
5001 0000 // ?
f001 0000 // ?
2002 0000 // ?
0400 0000 // +x
0800 0000 // +y
0300 0000 // +z
1000 0000 // ?
0000 0000 // direction
Direction options are as follows:
- 0 = front-bottom-left
- 1 = back-bottom-right
- 2 = left-bottom-right
- 3 = right-bottom-left
- 4 = down-top-left
- 5 = up-bottom-left
Note: x, y, z are not the coordinates of the cube, but the size of the selection. The "direction" is the origin of the cube within the selection. The initial coordinate is based on the existing selection when the player pastes the prefab.
0000 8083 8083 5050 8080 8080 8080 0100 0100 0200 0300 0400 0500
Each of the 52-digit pairs after the selection setup is a cube:
- The first column is something related to the materials.
- Columns 2 to 7 represent the faces (4 vertices per face) and their push level.
- The rest of the columns are the indices of registered textures for each face.
The default value of each even vertex is 0, which means that the vertex has not been manipulated. For odd vertices, this applies to the value 8.
Note: ingame the "front" face is identified by the outline of a small red cube at the front-bottom-left vertex.
- back-bottom-right(8) front-bottom-left(0) back-bottom-left(8) front-bottom-right(0)
- back-top-right(8) front-top-left(0) back-top-left(8) front-top-right(0)
- right-bottom-left(8) left-bottom-right(0) right-top-left(8) left-top-right(0)
- right-bottom-right(8) left-bottom-left(0) right-top-right(8) left-top-left(0)
- up-bottom-left(8) down-top-left(0) up-top-left(8) down-bottom-left(0)
- up-bottom-right(8) down-top-right(0) up-top-right(8) down-bottom-right(0)
Tip: you can use gzip to compress and decompress obr/ogz/dmo files.