MKAGP BIN (File Format): Difference between revisions
From Wexos's Wiki
Jump to navigationJump to search
mNo edit summary |
m (→Header) |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 14: | Line 14: | ||
| 0x04 || Int32 || '''Grid length''' ('''L'''). | | 0x04 || Int32 || '''Grid length''' ('''L'''). | ||
|- | |- | ||
| | | 0x08 || Float || '''Grid cell X size'''. | ||
|- | |- | ||
| | | 0x0C || Float || '''Grid cell Y size'''. | ||
|- | |- | ||
| | | 0x10 || Float[2] || '''AABB minimum coordinate XZ'''. | ||
|- | |- | ||
| | | 0x18 || Float[2] || '''AABB maximum coordinate XZ'''. | ||
|- | |||
| 0x20 || Float[2] || '''Negative AABB minimum coordinate XZ'''. Unknown usage. | |||
|- | |||
| 0x28 || UInt32 || '''[[#Grid|Grids]] offset'''. | |||
|} | |} | ||
== Grid == | == Grid == | ||
At the end of the file, | At the end of the file, '''W''' * '''L''' grid cell headers are stored in 0x10 byte blocks. | ||
=== Cell === | === Cell === | ||
| Line 38: | Line 42: | ||
| 0x08 || UInt32 || '''Cubes offset'''. Garbage data if none for this cell. | | 0x08 || UInt32 || '''Cubes offset'''. Garbage data if none for this cell. | ||
|- | |- | ||
| 0x0C || Int32 || '''Number of [[# | | 0x0C || Int32 || '''Number of [[#Wall|Walls]]'''. | ||
|} | |} | ||
| Line 45: | Line 49: | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
| 0x00 || Float[2] || ''' | | 0x00 || Float[2] || '''Minimal coordinate''' for this triangle. | ||
|- | |- | ||
| 0x08 || Float[2] || '''Maximal coordinate''' for this triangle. | | 0x08 || Float[2] || '''Maximal coordinate''' for this triangle. | ||
| Line 62: | Line 66: | ||
|} | |} | ||
==== | ==== Wall ==== | ||
There are '''C''' 0x20 walls, which are used for wall collision detection. The walls are auto-generated from [[#Triangle|all triangles]] by checking which edges are missing neighbour triangles. | |||
{| class="wikitable" | {| class="wikitable" | ||
! Offset !! Type !! Description | ! Offset !! Type !! Description | ||
|- | |- | ||
| 0x00 || Float[2][ | | 0x00 || Float[2] || '''Min XZ''' of the triangle edge. | ||
|- | |||
| 0x08 || Float[2] || '''Max XZ''' of the triangle edge. | |||
|- | |||
| 0x10 || Float[2] || '''Position 1 XZ''' of the triangle edge forming the wall. | |||
|- | |||
| 0x18 || Float[2] || '''Position 2 XZ''' of the triangle edge forming the wall. | |||
|} | |} | ||
Latest revision as of 01:32, 14 July 2025
MKAGP BIN is a collision format used in Mario Kart Arcade GP and Mario Kart Arcade GP 2.
File Format
The file byte order is always big endian.
Header
The file starts with the following header:
| Offset | Type | Description |
|---|---|---|
| 0x00 | Int32 | Grid width (W). |
| 0x04 | Int32 | Grid length (L). |
| 0x08 | Float | Grid cell X size. |
| 0x0C | Float | Grid cell Y size. |
| 0x10 | Float[2] | AABB minimum coordinate XZ. |
| 0x18 | Float[2] | AABB maximum coordinate XZ. |
| 0x20 | Float[2] | Negative AABB minimum coordinate XZ. Unknown usage. |
| 0x28 | UInt32 | Grids offset. |
Grid
At the end of the file, W * L grid cell headers are stored in 0x10 byte blocks.
Cell
All offsets are absolute.
| Offset | Type | Description |
|---|---|---|
| 0x00 | UInt32 | Triangles offset. Garbage data if none for this cell. |
| 0x04 | Int32 | Number of Triangles. |
| 0x08 | UInt32 | Cubes offset. Garbage data if none for this cell. |
| 0x0C | Int32 | Number of Walls. |
Triangle
| Offset | Type | Description |
|---|---|---|
| 0x00 | Float[2] | Minimal 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 | MKAGP BIN flag. |
| 0x60 | Float[3] | Triangle normal. |
| 0x6C | Float | Negative dot product between triangle center and triangle normal. |
Wall
There are C 0x20 walls, which are used for wall collision detection. The walls are auto-generated from all triangles by checking which edges are missing neighbour triangles.
| Offset | Type | Description |
|---|---|---|
| 0x00 | Float[2] | Min XZ of the triangle edge. |
| 0x08 | Float[2] | Max XZ of the triangle edge. |
| 0x10 | Float[2] | Position 1 XZ of the triangle edge forming the wall. |
| 0x18 | Float[2] | Position 2 XZ of the triangle edge forming the wall. |
Tools
The following tools can handle MKAGP BIN files:
- (none)