BIKE BIN (File Format)

From Wexos's Wiki
Revision as of 17:11, 1 May 2024 by Wexos (talk | contribs) (Imported from avsys wiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

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 textures.
0x0C UInt32 Texture name array offset. Points to an array of UInt32s, which points to the texture names.
0x10 UInt32 Number of bones.
0x14 UInt32 Bone name array offset. Points to an array of UInt32s, which points to the bone names.
0x18 UInt32 Skeleton 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 UInt32 Unknown.
0x0C UInt32 Unknown.
0x10 UInt32 Unknown.
0x14 UInt32 Unknown.
0x18 Float[4] Ambient color in RGBA.
0x28 Float[4] Diffuse color in RGBA.
0x38 Float[4] Specular color in RGBA.
0x48 Float[4] Unknown color in RGBA.
0x58 Float Shiny.
0x5C Float Unknown.
0x60 Float Unknown.
0x64 Float Unknown.
0x68 Float Unknown.
0x6C Float Unknown.
0x70 Float Unknown.
0x74 UInt32 Unknown.
0x78 UInt32 Unknown.
0x7C UInt32 Unknown.
0x80 UInt32 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 ref texture index.
0xAE Int16 Environment texture index.
0xB0 Int16 Normal texture index.
0xB2 Int16 Unknown texture slot.

Skeleton

The skeleton starts with the following structure:

Offset Type Description
0x00 UInt32 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 UInt32 Unknown.
0x2C UInt32 Unknown.
0x30 UInt32 Unknown.
0x34 UInt32 Unknown.
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.

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 Unknown.
0x10 Float Unknown.
0x14 Float Unknown.
0x18 Float Unknown.
0x1C UInt32 Vertex count.
0x20 UInt32 Position buffer offset.
0x24 UInt32 Normal buffer offset.
0x28 UInt32 Color buffer offset.
0x2C UInt32 UV buffer offset.
0x30 UInt32 Unknown buffer offset.
0x34 UInt32 Unknown.
0x38 UInt32 Unknown.
0x3C UInt32 Index buffer offset.

Tools

The following tools can handle BIN files:

  • (none)