BIKE BIN (File Format)
BIN is a model file format used in Mario Kart Arcade GP DX which inherits from the BIKE format. The format consist of a hierarchy of nodes, where each node can contain child nodes and meshes. The textures are external DDS files, and are linked by each material.
File Format
The file byte order is always little endian.
BIKE Header
The file starts with the common BIKE header. It has the following structure:
| Offset | Type | Description |
|---|---|---|
| 0x00 | Char[4] | File magic Always BIKE in ASCII. |
| 0x04 | UInt32 | Version number of the file format. |
| 0x08 | UInt32 | Size of this header in bytes. |
| 0x0C | UInt32 | Unknown. Seems to be padding. |
BIN Header
The BIN header follows the BIKE header. It has the following structure:
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Number of materials. |
| 0x04 | UInt32 | Material array offset. |
| 0x08 | UInt32 | Number of texture references. |
| 0x0C | UInt32 | Texture reference array offset. |
| 0x10 | UInt32 | Number of bones. |
| 0x14 | UInt32 | Bone array offset. |
| 0x18 | UInt32 | Root node offset. |
| 0x1C | UInt32 | Number of unknowns. |
| 0x20 | UInt32 | Unknown array offset. |
| 0x24 | UInt32 | Number of node pairs. |
| 0x28 | UInt32 | Node pair array offset. |
Material
Each material has the following structure:
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Unknown. |
| 0x04 | UInt32 | Unknown. |
| 0x08 | Byte | Unknown. |
| 0x09 | Byte | Unknown. |
| 0x0A | UInt16 | Unknown. |
| 0x0C | UInt32 | Unknown. |
| 0x10 | Byte | Unknown. |
| 0x11 | Byte | Unknown. |
| 0x12 | UInt16 | Unknown. |
| 0x14 | UInt32 | Unknown. |
| 0x18 | UInt32 | Unknown. |
| 0x1C | Byte | Unknown. |
| 0x1D | Byte | Unknown. |
| 0x1E | UInt16 | Unknown. |
| 0x20 | Byte | Unknown. |
| 0x21 | Byte | Unknown. |
| 0x22 | UInt16 | Unknown. |
| 0x24 | Byte | Unknown. |
| 0x25 | Byte | Unknown. |
| 0x26 | Byte | Unknown. |
| 0x27 | Byte | Unknown. |
| 0x28 | Float[4] | Ambient color in RGBA. |
| 0x38 | Float[4] | Diffuse color in RGBA. |
| 0x48 | Float[4] | Specular color in RGBA. |
| 0x58 | Float[4] | Unknown color in RGBA. |
| 0x68 | Float | Shiny. |
| 0x6C | Float | Unknown. |
| 0x70 | Float | Unknown. |
| 0x74 | Float | Unknown. |
| 0x78 | Float | Unknown. |
| 0x7C | Float | Unknown. |
| 0x80 | Float | Unknown. |
| 0x84 | UInt32 | Unknown. |
| 0x88 | UInt32 | Unknown. |
| 0x8C | UInt32 | Unknown. |
| 0x90 | UInt32 | Unknown. |
| 0x94 | UInt32 | Unknown. |
| 0x98 | UInt32 | Unknown. |
| 0x9C | UInt32 | Unknown. |
| 0xA0 | UInt32 | Unknown. |
| 0xA4 | UInt32 | Unknown. |
| 0xA8 | Int16 | Albedo texture index. |
| 0xAA | Int16 | Specular texture index. |
| 0xAC | Int16 | Reflective texture index. |
| 0xAE | Int16 | Environment texture index. |
| 0xB0 | Int16 | Normal texture index. |
| 0xB2 | Int16 | Incandescence texture index. |
Texture Reference
Each texture reference has the following structure:
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Texture name offset. |
Bone
Each bone has the following structure:
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Bone name offset. |
| 0x04 | UInt32 | Node pair offset. |
Root Node
The root node has the following structure:
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Node pair offset. |
| 0x04 | Byte[0x0C] | Always 0. |
Unknown Section
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Offset. |
| 0x04 | UInt32 | Offset. |
| 0x08 | UInt32 | Some kind of index. |
Node Pair
Each node pair contain the name and the node offset. The node pairs are in an array, which means it doesn't specify the hierarchy. Each entry has the following structure:
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Node name offset. |
| 0x04 | UInt32 | Node offset. |
Node
Each node has the following structure:
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Visibility flag. |
| 0x04 | Float[3] | Node scale. |
| 0x10 | Float[3] | Node rotation, in radians. |
| 0x1C | Float[3] | Node translation. |
| 0x28 | Float[3] | Bounding shere XYZ position. |
| 0x34 | Float | Bounding sphere radius. |
| 0x38 | UInt32 | Model object array offset. Points to an array of UInt32s, which points to model objects. The count is not stored, but the array is terminated by 0. |
| 0x3C | UInt32 | Child node array offset. Points to an array of UInt32s, which points to node children. The count is not stored, but the array is terminated by 0. |
| 0x40 | Float[3] | Unknown. |
| 0x4C | Float[3] | Unknown. |
| 0x58 | Float[3] | Unknown. |
| If version >= 4.0.0 | ||
| 0x64 | Float[3] | Bounding box minimum position. |
| 0x70 | Float[3] | Bounding box maximum position. |
Model Object
Each entry has the following structure:
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Unknown. |
| 0x04 | UInt32 | Number of triangles to draw. The number of elements in the index buffer is equal to this number multiplied by 3. |
| 0x08 | UInt32 | Material index. |
| 0x0C | Float[3] | Bounding shere XYZ position. |
| 0x18 | Float | Bounding sphere radius. |
| 0x1C | UInt32 | Vertex count. |
| 0x20 | UInt32 | Position buffer offset. |
| 0x24 | UInt32 | Normal buffer offset. |
| 0x28 | UInt32 | Color buffer offset. |
| 0x2C | UInt32 | UV buffer 1 offset. |
| 0x30 | UInt32 | UV buffer 2 offset. |
| 0x34 | UInt32 | UV buffer 3 offset. |
| 0x38 | UInt32 | UV buffer 4 offset. |
| 0x3C | UInt32 | Index buffer offset. |
| 0x40 | UInt32 | Number of bones influencing the vertices. |
| 0x44 | UInt32 | Bone ID mask. Each bit represents a bone ID. |
| 0x48 | UInt32 | Weight buffer offset (vertices * 4 bytes per bone). |
| If version >= 4.0.0 | ||
| 0x4C | Float[3] | Bounding box minimum position. |
| 0x58 | Float[3] | Bounding box maximum position. |
Tools
The following tools can handle BIN files:
- (none)