BIKE BIN (File Format)

From Wexos's Wiki
Revision as of 21:47, 11 August 2025 by Atlas (talk | contribs) (→‎Material)
Jump to navigationJump to search

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 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 maximum position.
0x70 Float[3] Bounding box minimum 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 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)