COL (File Format)

From Wexos's Wiki
Revision as of 19:03, 29 June 2025 by Atlas (talk | contribs)
Jump to navigationJump to search

COL is a collision format used in Mario Kart Arcade GP DX and the successor of Mario Kart Arcade GP and Mario Kart Arcade GP 2's MKAGP BIN.

File Format

The file byte order is always little endian.

Header

The file starts with the following header:

Offset Type Description
0x00 Char[4] File magic. Always COL\0 in ASCII.
0x04 Byte[4] Timestamp? Always 16 08 12 20 (2012-08-16?) The game specifically checks if this value is correct, otherwise it won't read the file.
0x08 Int32 Grid width (W).
0x0C Int32 Grid length (L).
0x10 Float Grid cell X size.
0x14 Float Grid cell Y size.
0x18 Float[3] AABB minimum coordinate.
0x24 Float[3] AABB maximal coordinate.

Grid

Followed by the header, the grid data is read from the start of the AABB minimum coordinate, from left to right. A total of W * L cells are loaded.

Cell

Offset Type Description
0x00 Int32 Number of Triangles (T).
0x04 Int32 Number of Cubes (C).

Triangle

Followed by the cell header, there are T 0x70 triangles.

Offset Type Description
0x00 Float[2] Minimul coordinate for this triangle.
0x08 Float[2] Maximal coordinate for this triangle.
0x10 Float[3][3] Triangle vertices XYZ position.
0x34 Float[3][3] Triangle edges XYZ position.
0x58 UInt32 Neighbour triangle flag, used to determine which edges connect to other triangles.
0x5C UInt32 COL flag.
0x60 Float[3] Triangle normal.
0x6C Float Negative dot product between triangle center and triangle normal.

Cube

Followed by the cell's triangles, there are C 0x40 cubes, seemingly used for wall collision detection.

Offset Type Description
0x00 Float[4][4] Cube XYZ positions plus a 0-float, probably used for padding.

Secondary Grid

Followed by the grid, there's a secondary grid with unknown blocks. As of version 1.18 of Mario Kart Arcade GP DX, it only seems to be used in FM_L_N_HIT.col and FM_L_N_HIT_cam.col.

Cell

Offset Type Description
0x00 Int32 Number of Unknown sections (U).

Unknown Section

Followed by the cell header, there are U 0x38 unknown sections.

Offset Type Description
0x00 Int32 Unknown.
0x04 Float[3][3] Unknown.
0x28 Float[4] Unknown. Always 0.

Tools

The following tools can handle COL files:

  • (none)