BOL (File Format)
A BOL file contains information about a course's setup. A variant of the BOL format has been used in Mario Kart DS and Mario Kart Wii. This article describes the Mario Kart: Double Dash!! BOL format.
File Header
Offset | Type | Description |
---|---|---|
0x00 | String | File magic. Always 0015 in ASCII. |
0x04 | Byte | Seems to be related to moving collision. The value is set to 1 in daisy_course.bol. When this value is set to 0x00, the tables and rolling ? blocks on the cruiser will not move. |
0x05 | Byte | Unknown. |
0x06 | Byte | Unknown. |
0x07 | Byte | Unknown. |
0x08 | UInt32 | Unknown. |
0x0C | Float[3] | Light source position. |
0x18 | Byte | Number of laps. |
0x19 | Byte | Music ID. |
0x1A | UInt16 | Number of Section 1 entries. |
0x1C | UInt16 | Number of Section 2 groups. |
0x1E | UInt16 | Number of Section 5 entries. |
0x20 | UInt16 | Number of Section 7 entries. |
0x22 | UInt16 | Number of Section 8 entries |
0x24 | UInt16 | Number of Section 3 entries. |
0x26 | UInt16 | Number of Section 9 entries. |
0x28 | Byte | Fog Type. |
0x29 | Byte | Fog Color. |
0x2A | UInt16 | Unknown. |
0x2C | Float | Fog Start Z. |
0x30 | Float | Fog End Z. |
0x34 | UInt16 | Unknown. |
0x36 | UInt16 | Unknown. |
0x38 | UInt32 | Unknown. |
0x3C | UInt32 | Unknown. |
0x40 | UInt32 | Start of the file, always 0x00. |
0x44 | UInt32 | Section 1 offset, always 0x7C. |
0x48 | UInt32 | Section 2 offset. |
0x4C | UInt32 | Section 3 offset. |
0x50 | UInt32 | Section 4 offset. |
0x54 | UInt32 | Section 5 offset. |
0x58 | UInt32 | Section 6 offset. |
0x5C | UInt32 | Section 7 offset. |
0x60 | UInt32 | Section 8 offset. |
0x64 | UInt32 | Section 9 offset. |
0x68 | UInt32 | Section 10 offset. |
0x6C | UInt32 | Section 11 offset. |
0x70 | Byte[12] | Padding. |
0x7C | End of this file header |
Sections
The file consists of a series of sections, each describing a different aspect of the course setup.
Section 1
Section 1 describes enemy/item points; the routes of CPU racers and items such as red shells. The CPU racers and items attempt to follow the path described by each group of points. Each entry is a 0x20 byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | Float[3] | A 3D position vector of the position. |
0x0C | Int16 | Point setting. |
0x0E | Int16 | Link of current group if start of group.
Link to next group if end of group. Otherwise -1. |
0x10 | Float | Scale. |
0x14 | UInt16 | Group setting if start of group. Otherwise 0.
|
0x16 | Byte | Group. |
0x17 | Byte | Point setting. |
0x18 | Byte[8] | Padding. |
Section 2
The first part of Section 2 describes checkpoint grouping; how the routes of checkpoints link together. Each entry is a 0x14 byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | UInt16 | Point length. The number of points in this group. |
0x02 | UInt16 | Group link. |
0x04 | Int16[4] | Previous group. The indices of up to 4 group links that follow to this one. Unneeded slots are set to value -1. |
0x0C | Int16[4] | Next group. The indices of up to 4 group links to follow after this one. Unneeded slots are set to value -1. |
The second part of Section 2 describes checkpoints; the routes players must follow to count laps. The racers must follow the path described by each group of points (as determined by the first part of Section 2). Each entry is a 0x1C byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | Float[3] | A 3D position vector of the start of the check point line. |
0x0C | Float[3] | A 3D position vector of the end of check point line. |
0x18 | Byte[4] | Padding. |
Section 3
Section 3 describes routes; these are routes for many things including cameras and objects. Each entry is a 0x10 byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | UInt16 | Point length. The number of Section 4 entries in this group. |
0x02 | UInt16 | Point start. The index of the first Section 4 entry in this group. |
0x04 | Byte[12] | Padding. |
Section 4
Section 4 describes route points. Each entry is a 0x20 byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | Float[3] | A 3D position vector of the route position. |
0x0C | Byte[20] | Padding. |
Section 5
Section 5 decribes objects. Each entry is a 0x40 byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | Float[3] | A 3D position vector of the start position. |
0x0C | Float[3] | A 3D scale vector of the start position. |
0x18 | Int32[3] | A 3D rotation vector of the start position. |
0x24 | UInt16 | Object ID. |
0x26 | Int16 | Route ID. Links to Section 3. 0xFFFF if no route is used. |
0x28 | Byte[24] | Unknown. Probably object settings. |
Section 6
Section 6 describes kart points; the starting positions of racers. Each entry is a 0x28 byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | Float[3] | A 3D position vector of the start position. |
0x0C | Float[3] | A 3D scale vector of the start position. |
0x18 | Int32[3] | A 3D rotation vector of the start position. |
0x24 | Byte | 0: Pole position is left 1: Pole position is right. |
0x25 | Byte | Player ID. In courses with multiple start positions (such as battle courses), this determines which players start here. Otherwise set to 0xFF to set all players start positions to this point. |
0x26 | UInt16 | Padding. |
Section 7
Section 7 describes areas; used to determine for example which camera to use. Each entry is a 0x38 byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | Float[3] | A 3D position vector of the area. |
0x0C | Float[3] | A 3D scale vector of the area. |
0x18 | Int32[3] | A 3D rotation vector of the area. |
0x24 | UInt16 | Unknown. |
0x26 | UInt16 | Unknown. |
0x28 | Byte[16] | Unknown. |
Section 8
Section 8 describes Cameras. Each entry is a 0x48 byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | Float[3] | A 3D position vector of the first view point. |
0x0C | Int32[3] | A 3D rotation vector. |
0x18 | Float[3] | A 3D position vector of the second view point. |
0x24 | Float[3] | A 3D position vector of the third view point. |
0x30 | Byte | Unknown. |
0x31 | Byte | Camera Type. |
0x32 | UInt16 | Start Zoom. |
0x34 | UInt16 | Camera Duration (in 1/60 second units). |
0x36 | UInt16 | Unknown. |
0x38 | UInt16 | Unknown. |
0x3A | UInt16 | Unknown. |
0x3C | Int16 | Linked Route ID (-1 if none). |
0x3E | UInt16 | Route Speed? |
0x40 | UInt16 | End Zoom. |
0x42 | Int16 | Next Camera (-1 if none). |
0x44 | String | Camera Name? (Most of the time "null" or "para"). |
Section 9
Section 9 describes Jugem points; the respawn positions. Each entry is a 0x20 byte structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | Float[3] | A 3D position vector of the respawn position. |
0x0C | Int32[3] | A 3D rotation vector of the respawn position. |
0x18 | UInt16 | Respawn ID? |
0x1A | UInt16 | Unknown. |
0x1C | UInt16 | Unknown. |
0x1E | UInt16 | Unknown. |
Section 10
Unknown.
Offset | Type | Description |
---|---|---|
0x00 | UInt32 | Unknown. |
0x04 | Float[3] | Unknown. |
0x10 | UInt32 | Unknown. |
Section 11
Unknown.
Rotation Vector
The Mario Kart: Double Dash!! rotation vector consists of 3 Int32 values. The first two values form a two-dimensional direction vector with the first pointing in X-direction and the second pointing in Z-direction. The third value represents the length of the vector (it is quite inaccurate, though). Its value is usually 0x27100000 (655360000 in base 10). Using trigonometry, the rotation angle around the Y-axis can be calculated as follows:
angle (in degree) = sign(value1 + 0.5) * arccos(value2 / value3) * (180 / pi)
This C# snippet can properly determine the value as well:
public static double returnRotations(int xrot, int yrot, int zrot) { double radToDeg = 57.2957795d; double angle1 = radToDeg * Math.Atan2((double)yrot / (double)zrot, (double)xrot / (double)zrot); angle1 = 90 - angle1; return angle1; }
Tools
The following tools can handle BOL files:
- BOL Editor, by NiAlBlack
- Mario Kart DS Course Modifier, by Gericom (converts a BOL file to a NKM file)
- Wexos's Toolbox, by Wexos (only view)