BOL (File Format)

From Wexos's Wiki
Jump to navigationJump to search

BOL is a file format used in Mario Kart Double Dash!!. It contains basic information about a course such as CPU routes and check points.

File Format

Header

The format starts with the following header:

Offset Type Description
0x00 Char[4] File identifier. Always 0015 in ASCII.
0x04 Byte Tilt.
ID Description
0x00 Disabled
0x01 Tilt skybox and items
0x02 Tilt everything
0x05 Byte[3] Ambient color in RGB format.
0x08 Byte[4] Light color in RGBA format.
0x0C Float[3] Light position.
0x18 Byte Lap count. If zero is specified, the track will have 3 laps.
0x19 Byte Music ID.
0x1A UInt16 Number of routes.
0x1C UInt16 Number of check paths.
0x1E UInt16 Number of objects.
0x20 UInt16 Number of areas.
0x22 UInt16 Number of cameras.
0x24 UInt16 Number of paths.
0x26 UInt16 Number of respawn points.
0x28 Byte Fog type.
0x29 Byte[3] Fog color in RGB format.
0x2C Float Fog start.
0x30 Float Fog end.
0x34 Byte Unknown.
0x35 Byte Unknown.
0x36 Byte Unknown.
0x37 Byte Unknown.
0x38 Byte[3] Shadow color in RGB format.
0x3B Byte Number of start points.
0x3C Byte Unknown.
0x3D Byte Number of lights.
0x3E Byte Number of mini game parameters.
0x3F Byte Unknown.
0x40 UInt32 Unknown.
0x44 UInt32 Route array offset.
0x48 UInt32 Check path array offset.
0x4C UInt32 Path array offset.
0x50 UInt32 Path point array offset.
0x54 UInt32 Object array offset.
0x58 UInt32 Start point array offset.
0x5C UInt32 Area array offset.
0x60 UInt32 Camera array offset.
0x64 UInt32 Respawn point array offset.
0x68 UInt32 Light array offset.
0x6C UInt32 Mini game parameter array offset.
0x70 UInt32 Unknown.
0x74 UInt32 Unknown.
0x78 UInt32 Unknown.

Route

Routes are sequences of points which CPUs and items follow. Each entry has the following structure:

Offset Type Description
0x00 Float[3] Position.
0x0C UInt16 Setting A.
0x0E UInt16 Group link.
0x10 Float Point scale. Controls how far CPUs and items can leave the route.
0x14 Byte Unknown.
0x15 Byte Enter. CPUs and items can enter (0) or only items can enter (1).
0x16 Byte Route index.
0x17 Byte Setting B.
0x18 Byte Unknown.
0x19 Byte Unknown.
0x1A Byte Unknown.
0x1B Byte Unknown.
0x1C UInt32 Unknown.

Check Path

The check point groups, called check paths, are stored first. Each entry has the following structure:

Offset Type Description
0x00 UInt16 Path length. Number of point in the check path.
0x02 UInt16 Unknown.
0x04 UInt16[4] Previous check paths. 0xFFFF means no previous check path.
0x0C UInt16[4] Next check paths. 0xFFFF means no next check path.

Check Point

After the check paths, all check points are stored. Each point has the following structure:

Offset Type Description
0x00 Float[3] Left position.
0x0C Float[3] Right position.
0x18 Byte Skip group. If a number of consecutive check points are set to the same group, those check points are allowed to be skipped until a check point with a zero group. Zero group is default and means no check point is allowed to be skipped.
0x19 Byte Unknown. 1 is seen in Luigi Circuit, probably has something to do with the ability to drive in both directions on the track.
0x1A Byte Unknown.
0x1B Byte Unknown.

Path

Paths are generic routes, which contains a list of points. They are linked by other resources in a BOL file such as objects. Each path has the following structure:

Offset Type Description
0x00 UInt16 Path length. Number of path points in the path.
0x02 UInt16 Path start. Index of the first path point in the path.
0x04 UInt32 Is closed. Determines the next point after reaching the end. 0 means the path is followed back and forth, 1 means the path goes from the end point to the start point.
0x08 Byte Unknown.
0x09 Byte Unknown.
0x0A UInt16 Unknown.
0x0C UInt32 Unknown.

Path Point

Offset Type Description
0x00 Float[3] Position.
0x0C UInt32 Unknown.
0x10 UInt32 Unknown.
0x14 UInt32 Unknown.
0x18 UInt32 Unknown.
0x1C UInt32 Unknown.

Object

Offset Type Description
0x00 Float[3] Position.
0x0C Float[3] Scale.
0x18 Int16[2][3] Rotation.
0x24 UInt16 Object ID.
0x26 UInt16 Path index. 0xFFFF for no linked path.
0x28 UInt16 Unknown.
0x2A UInt16 Unknown, but related to path. 0xFFFF when no path is linked.
0x2C Byte Unknown.
0x2D Byte Presence mode. Describes in what game modes the object should be loaded.
ID Description
0x00 None
0x01 Single-player (not time trials)
0x02 Multi-player
0x03 All game modes
0x2E Byte Visibility.
0x2F Byte Unknown.
0x30 UInt16[8] Object-specific settings.

Start Point

Offset Type Description
0x00 Float[3] Position.
0x0C Float[3] Scale.
0x18 Int16[2][3] Rotation.
0x24 Byte Pole position. Left (0) or Right (1).
0x25 Byte Player ID.
0x26 UInt16 Unknown.

Area

Area are used to perform tasks depending on where the player are. Each entry has the following structure:

Offset Type Description
0x00 Float[3] Position.
0x0C Float[3] Scale.
0x18 Int16[2][3] Rotation.
0x24 Byte Unknown.
0x25 Byte Area type.
0x26 UInt16 Camera index. 0xFFFF for no linked camera.
0x28 UInt32 Unknown.
0x2C UInt32 Unknown.
0x30 UInt16 Unknown.
0x32 UInt16 Unknown.
0x34 UInt16 Shadow index.
0x36 UInt16 Light index.
Area types

The following area types are supported:

Type Description
0x00 ?
0x01 Camera activator. Changes the replay camera.
0x02 ?
0x03 ?
0x04 ?
0x05 ?
0x06 ?
0x07 ?

Camera

Cameras are used give a view of track. There are both intro cameras and replay cameras. Each entry has the following structure:

Offset Type Description
0x00 Float[3] Position.
0x0C Int16[2][3] Rotation.
0x18 Float[3] End position.
0x24 Float[3] Start position.
0x30 UInt16 Camera type.
0x32 Int16 FOV start.
0x34 UInt16 Time duration.
0x36 UInt16 Is first opening camera. Used to identify the first opening camera to play.
0x38 UInt16 Unknown.
0x3A UInt16 Unknown.
0x3C UInt16 Path index. 0xFFFF if no path linked.
0x3E UInt16 Path speed.
0x40 Int16 FOV end.
0x42 UInt16 Next camera.
0x44 Char[4] Camera tag, used to identify specific cameras. "null" is used as default, meaning no tag.
Camera types

Many different camera types are supported. The camera type seems to be different depending on the context, although this have no been confirmed. Some types also seem to have optional path support. The following types are supported:

Type Name Route Description
0x0000 Fix No Static camera which from its position always look forward.
0x0001 FixPath/StartOnlyPath Yes Opening camera which follows a path, always looking forward.
0x0002 FixChase No Camera which starts at its position, then moves with the player, always looking forward.
0x0003 FixSpl Yes Static camera which from the first path point always look forward. Code states that the path should contain four points.
0x0004 StartFixPath Yes Opening camera which follows a path, looking at start.
0x0005 DemoPath/StartPath Yes Opening camera which follows a path, looking at start and shifts to end.
0x0006 StartLookPath No Opening camera which from its position looks at start and shifts to end.
0x0007 FixPala No Camera, with the player as the origin, looks from start to end. The start and end vectors seem to be stored in a different coordinate system. X is mirrored, Y represents the negative depth and Z represents the height.
0x0008 DemoGoal* No Used for camera with tag "para". With the player as origin, it looks from start to end.
0x0100 FixSearch No Static camera which from its position always look at the player.
0x0101 ChasePath Yes Camera which follows a path, always looking at the player.
0x0102 Chase No Camera which starts at its position, then moves with the player, always looking at the player.
0x0103 ChaseSpl Yes Static camera which from the first path point always look at the player.
Camera Tags

The following camera tags are used:

Tag Description
chie ?
cour ?
debu ?
desi ?
dire ?
down ?
endd ?
exec ?
farr ?
firs ?
fron ?
grap ?
item ?
last ?
loca ?
lose ?
mare ?
mari ?
mini ?
mont ?
musi ?
next ?
null Default, not special tag.
open ?
para Camera which is used a few seconds after reaching the goal line.
park ?
prdi ?
prma ?
prod ?
prog ?
ring ?
scre ?
spec ?
topp ?
voic ?

Respawn Point

Offset Type Description
0x00 Float[3] Position.
0x0C Int16[2][3] Rotation.
0x18 UInt16 Index.
0x1A UInt16 Route index. 0xFFFF for no linked route.
0x1C UInt16 Unknown.
0x1E UInt16 Check point index. 0xFFFF for no linked check point.

Light

Offset Type Description
0x00 Byte[4] Light color in RGBA format.
0x04 Float[3] Light position.
0x10 Byte[4] Ambient color in RGBA format.

Mini Game Parameter

Offset Type Description
0x00 UInt16 Unknown.
0x02 UInt16 Unknown.
0x04 UInt16 Unknown.
0x06 UInt16 Unknown.

Tools

The following tools can handle BOL files: