BIKE BIN (File Format): Difference between revisions
mNo edit summary |
mNo edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 10: | Line 10: | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
| 0x00 || Char[4] || '''File magic''' Always ''BIKE'' in ASCII. | | 0x00 || Char[4] || '''File magic'''. Always ''BIKE'' in ASCII. | ||
|- | |- | ||
| 0x04 || UInt32 || '''Version number''' of the file format'''. | | 0x04 || UInt32 || '''Version number''' of the file format'''. | ||
| Line 134: | Line 134: | ||
| 0x98 || UInt32 || {{Unknown-left|'''Unknown'''.}} | | 0x98 || UInt32 || {{Unknown-left|'''Unknown'''.}} | ||
|- | |- | ||
| 0x9C || UInt32 | | | 0x9C || UInt32 || '''[[#Translation Animation|Translation animation]] offset'''. | ||
|- | |- | ||
| 0xA0 || UInt32 || {{Unknown-left|'''Unknown'''.}} | | 0xA0 || UInt32 || {{Unknown-left|'''Unknown'''.}} | ||
|- | |- | ||
| 0xA4 || | | 0xA4 || Float || {{Unknown-left|'''Unknown'''.}} | ||
|- | |- | ||
| 0xA8 || Int16 || '''Albedo texture index'''. | | 0xA8 || Int16 || '''Albedo texture index'''. | ||
| Line 151: | Line 151: | ||
|- | |- | ||
| 0xB2 || Int16 || '''Incandescence texture index'''. | | 0xB2 || Int16 || '''Incandescence texture index'''. | ||
|} | |||
=== Translation Animation === | |||
If the offset is not 0, a simple translation animation is applied to the material. The animation is a constant value. | |||
{| class="wikitable" | |||
! Offset !! Type !! Description | |||
|- | |||
| 0x00 || Float || '''U translation'''. | |||
|- | |||
| 0x04 || Float || '''V translation'''. | |||
|} | |} | ||
| Line 196: | Line 207: | ||
== Node Pair == | == Node Pair == | ||
Each node pair | Each node pair contains the name and the [[#Node|node]] offset. The node pairs are in an array, which means it doesn't specify the hierarchy. Each entry has the following structure: | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 214: | Line 225: | ||
| 0x00 || UInt32 || '''Visibility flag'''. | | 0x00 || UInt32 || '''Visibility flag'''. | ||
|- | |- | ||
| 0x04 | | 0x04 || '''[[#Transform|Transform]]''' || '''Node transform'''. | ||
| | |||
|- | |- | ||
| 0x28 || Float[3] || '''Bounding shere XYZ position'''. | | 0x28 || Float[3] || '''Bounding shere XYZ position'''. | ||
| Line 228: | Line 235: | ||
| 0x3C || UInt32 || '''[[#Node|Child node]] array offset'''. Points to an array of UInt32s, which points to [[#Node|node children]]. The count is not stored, but the array is terminated by 0. | | 0x3C || UInt32 || '''[[#Node|Child node]] array offset'''. Points to an array of UInt32s, which points to [[#Node|node children]]. The count is not stored, but the array is terminated by 0. | ||
|- | |- | ||
| 0x40 | | | 0x40 || '''[[#Transform|Transform]]''' || '''Pose transform'''. | ||
| | |||
|- bgcolor="#AAFFAA" | |- bgcolor="#AAFFAA" | ||
| colspan="3" align="center" | '''If [[#BIKE Header|version]] >= 4.0.0''' | | colspan="3" align="center" | '''If [[#BIKE Header|version]] >= 4.0.0''' | ||
| Line 239: | Line 242: | ||
|- bgcolor="#DDFFDD" | |- bgcolor="#DDFFDD" | ||
| 0x70 || Float[3] || '''Bounding box minimum position'''. | | 0x70 || Float[3] || '''Bounding box minimum position'''. | ||
|} | |||
===== Transform ===== | |||
{| class="wikitable" | |||
! Offset !! Type !! Description | |||
|- | |||
| 0x00 || Float[3] || '''Scale'''. | |||
|- | |||
| 0x0C || Float[3] || '''Rotation''', in radians. | |||
|- | |||
| 0x18 || Float[3] || '''Translation'''. | |||
|} | |} | ||
Latest revision as of 11:21, 16 August 2025
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. All sections and subsections are aligned to 0x10.
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 bone links. |
| 0x20 | UInt32 | Bone links 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 | Byte | Unknown. |
| 0x01 | Byte | Unknown. |
| 0x02 | UInt16 | 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] | Incandescence 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 | Translation animation offset. |
| 0xA0 | UInt32 | Unknown. |
| 0xA4 | Float | 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. |
Translation Animation
If the offset is not 0, a simple translation animation is applied to the material. The animation is a constant value.
| Offset | Type | Description |
|---|---|---|
| 0x00 | Float | U translation. |
| 0x04 | Float | V translation. |
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. |
Bone Link
Each bone link corresponds to a node that contains a model object as well as a node that contains a bone, then it gives a local ID for each bone.
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Model object node offset. |
| 0x04 | UInt32 | Bone node offset. |
| 0x08 | UInt32 | Local bone ID. |
Node Pair
Each node pair contains 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 | Transform | Node transform. |
| 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 | Transform | Pose transform. |
| If version >= 4.0.0 | ||
| 0x64 | Float[3] | Bounding box maximum position. |
| 0x70 | Float[3] | Bounding box minimum position. |
Transform
| Offset | Type | Description |
|---|---|---|
| 0x00 | Float[3] | Scale. |
| 0x0C | Float[3] | Rotation, in radians. |
| 0x18 | Float[3] | Translation. |
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 local bone ID from the corresponding bone link. |
| 0x48 | UInt32 | Weight buffer offset (vertices * 4 bytes per bone). |
| If version >= 4.0.0 | ||
| 0x4C | Float[3] | Bounding box maximum position. |
| 0x58 | Float[3] | Bounding box minimum position. |
Tools
The following tools can handle BIN files:
- (none)