Difference between revisions of "KMG (File Format)"

From Custom Mario Kart
Jump to navigation Jump to search
m (Various Changes)
Line 19: Line 19:
  
 
=== Balloon Battle Data ===
 
=== Balloon Battle Data ===
This section contains parameters used on Balloon Battle. It consists of three sections: a [[#Time Limit Table|Time Limit Table]], an [[#Unknown Tables|Unknown Table]] and a [[#Balloon Battle Parameters|Balloon Battle Parameters]] sub-section.
+
This section contains parameters used on Balloon Battle. It consists of three sections: a [[#Time Limit Table|Time Limit Table]], an [[#Unknown Tables|Unknown Table]] and a [[#Balloon Battle Parameters|Balloon Battle Parameters]] sub-section. It is located at <code>0x10</code>.
 
 
=== Coin Runners Data ===
 
This section contains parameters used on Coin Runners. It consists of seven sections: a [[#Time Limit Table|Time Limit Table]], 5 [[#Unknown Tables|Unknown Tables]] and a [[#Coin Runners Parameters|Coin Runners Parameters]] sub-section.
 
 
 
=== Time Limit Table ===
 
There are two identical tables that contain time limit information for Balloon Battle and Coin Runners. These tables contain 110 UInt16 values that each define the time limit for each number of players on each stage in seconds.
 
 
 
The entries are ordered following the [[List of Identifiers#Courses|Course IDs]] for the battle stages minus 0x20.
 
  
 +
==== Balloon Battle Parameters ====
 
{|class="wikitable"
 
{|class="wikitable"
|+ Format of a Time Limit Table Entry
 
 
! Offset !! Information
 
! Offset !! Information
 
|-
 
|-
| 0x00 || Time limit for 2 players.
+
| 0x00 || Number of points scored when hitting a player.
 
|-
 
|-
| 0x02 || Time limit for 3 players.
+
| 0x02 || Number of extra points scored when defeating a player (originally unused).
 
|-
 
|-
| 0x04 || Time limit for 4 players.
+
| 0x04 || Number of points scored when losing all balloons.
 
|-
 
|-
| 0x06 || Time limit for 5 players.
+
| 0x06 || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x08 || Time limit for 6 players.
+
| 0x08 || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x0A || Time limit for 7 players.
+
| 0x0A || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x0C || Time limit for 8 players.
+
| 0x0C || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x0E || Time limit for 9 players.
+
| 0x0E || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x10 || Time limit for 10 players.
+
| 0x10 || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x12 || Time limit for 11 players.
+
| 0x12 || {{Unknown-left|'''Unknown'''.}}
|-
 
| 0x14 || Time limit for 12 players.
 
 
|}
 
|}
  
=== Unknown Tables ===
+
=== Coin Runners Data ===
For both Balloon Battle and Coin Runners, there are 0xDC-byte tables that control unknown parameters.
+
This section contains parameters used on Coin Runners. It consists of seven sections: a [[#Time Limit Table|Time Limit Table]], 5 [[#Unknown Tables|Unknown Tables]] and a [[#Coin Runners Parameters|Coin Runners Parameters]] sub-section. It is located at <code>0x1DC</code>.
  
=== Balloon Battle Parameters ===
+
==== Coin Runners Parameters ====
 
{|class="wikitable"
 
{|class="wikitable"
 
! Offset !! Information
 
! Offset !! Information
 
|-
 
|-
| 0x00 || Number of points scored when hitting a player.
+
| 0x00 || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x02 || Number of extra points scored when defeating a player (originally unused).
+
| 0x02 || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x04 || Number of points scored when losing all balloons.
+
| 0x04 || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
 
| 0x06 || {{Unknown-left|'''Unknown'''.}}
 
| 0x06 || {{Unknown-left|'''Unknown'''.}}
Line 79: Line 69:
 
| 0x0E || {{Unknown-left|'''Unknown'''.}}
 
| 0x0E || {{Unknown-left|'''Unknown'''.}}
 
|-
 
|-
| 0x10 || {{Unknown-left|'''Unknown'''.}}
+
| 0x10 || Number of coins lost when getting hit by a Banana, Mushroom or Star.
 
|-
 
|-
 
| 0x12 || {{Unknown-left|'''Unknown'''.}}
 
| 0x12 || {{Unknown-left|'''Unknown'''.}}
 
|}
 
|}
  
=== Coin Runners Parameters ===
+
=== Other Structures ===
 +
These are structures that are used multiple times throughout the file.
 +
 
 +
==== Time Limit Table ====
 +
There are two identical tables that contain time limit information for Balloon Battle and Coin Runners. These tables contain 110 unsigned 16-bit values that each define the time limit for each number of players on each stage in seconds.
 +
 
 +
The entries are ordered following the [[List of Identifiers#Courses|Course IDs]] for the battle stages minus 0x20.
 +
 
 
{|class="wikitable"
 
{|class="wikitable"
 +
|+ Format of a Time Limit Table Entry
 
! Offset !! Information
 
! Offset !! Information
 
|-
 
|-
| 0x00 || {{Unknown-left|'''Unknown'''.}}
+
| 0x00 || Time limit for 2 players.
 +
|-
 +
| 0x02 || Time limit for 3 players.
 +
|-
 +
| 0x04 || Time limit for 4 players.
 +
|-
 +
| 0x06 || Time limit for 5 players.
 +
|-
 +
| 0x08 || Time limit for 6 players.
 +
|-
 +
| 0x0A || Time limit for 7 players.
 +
|-
 +
| 0x0C || Time limit for 8 players.
 +
|-
 +
| 0x0E || Time limit for 9 players.
 +
|-
 +
| 0x10 || Time limit for 10 players.
 +
|-
 +
| 0x12 || Time limit for 11 players.
 +
|-
 +
| 0x14 || Time limit for 12 players.
 +
|}
 +
 
 +
Here's an offset table for reference.
 +
 
 +
{|class="wikitable"
 +
! Stage !! 2 Players !! 3 Players !! 4 Players !! 5 Players !! 6 Players !! 7 Players !! 8 Players !! 9 Players !! 10 Players !! 11 Players !! 12 Players
 +
|-
 +
| Delfino Pier        || 0x0  || 0x2  || 0x4  || 0x6  || 0x8  || 0xA  || 0xC  || 0xE  || 0x10 || 0x12 || 0x14
 
|-
 
|-
| 0x02 || {{Unknown-left|'''Unknown'''.}}
+
| Block Plaza          || 0x16 || 0x18 || 0x1A || 0x1C || 0x1E || 0x20 || 0x22 || 0x24 || 0x26 || 0x28 || 0x2A
 
|-
 
|-
| 0x04 || {{Unknown-left|'''Unknown'''.}}
+
| Chain Chomp Wheel    || 0x2C || 0x2E || 0x30 || 0x32 || 0x34 || 0x36 || 0x38 || 0x3A || 0x3C || 0x3E || 0x40
 
|-
 
|-
| 0x06 || {{Unknown-left|'''Unknown'''.}}
+
| Funky Stadium        || 0x42 || 0x44 || 0x46 || 0x48 || 0x4A || 0x4C || 0x4E || 0x50 || 0x52 || 0x54 || 0x56
 
|-
 
|-
| 0x08 || {{Unknown-left|'''Unknown'''.}}
+
| Thwomp Desert        || 0x58 || 0x5A || 0x5C || 0x5E || 0x60 || 0x62 || 0x64 || 0x66 || 0x68 || 0x6A || 0x6C
 
|-
 
|-
| 0x0A || {{Unknown-left|'''Unknown'''.}}
+
| GCN Cookie Land      || 0x6E || 0x70 || 0x72 || 0x74 || 0x76 || 0x78 || 0x7A || 0x7C || 0x7E || 0x80 || 0x82
 
|-
 
|-
| 0x0C || {{Unknown-left|'''Unknown'''.}}
+
| DS Twilight House    || 0x84 || 0x86 || 0x88 || 0x8A || 0x8C || 0x8E || 0x90 || 0x92 || 0x94 || 0x96 || 0x98
 
|-
 
|-
| 0x0E || {{Unknown-left|'''Unknown'''.}}
+
| SNES Battle Course 4 || 0x9A || 0x9C || 0x9E || 0xA0 || 0xA2 || 0xA4 || 0xA6 || 0xA8 || 0xAA || 0xAC || 0xAE
 
|-
 
|-
| 0x10 || Number of coins lost when getting hit by a Banana, Mushroom or Star.
+
| GBA Battle Course 3  || 0xB0 || 0xB2 || 0xB4 || 0xB6 || 0xB8 || 0xBA || 0xBC || 0xBE || 0xC0 || 0xC2 || 0xC4
 
|-
 
|-
| 0x12 || {{Unknown-left|'''Unknown'''.}}
+
| N64 Skyscraper      || 0xC6 || 0xC8 || 0xCA || 0xCC || 0xCE || 0xD0 || 0xD2 || 0xD4 || 0xD6 || 0xD8 || 0xDA
 
|}
 
|}
 +
 +
All of the default time limit values are 180 (3 minutes).
 +
 +
==== Unknown Tables ====
 +
For both Balloon Battle and Coin Runners, there are 0xDC-byte tables that control unknown parameters.
  
 
== Tools ==
 
== Tools ==

Revision as of 04:15, 29 June 2019

Under Construction
This article is not finished. Help improve it by adding accurate information or correcting grammar and spelling.

KMG (Kart MiniGame) is a file format from Mario Kart Wii, exclusively used as minigame.kmg, a sub file of /Race/Common.szs. It contains information for Battle Mode, such as time limits and score increments.

File Format

Header

Offset Type Description
0x00 String File magic. Always RKMG in ASCII.
0x04 UInt32 Length of the file in bytes.
0x08 UInt32 Unknown.
0x0C UInt32 Offset to Coin Runners Data, relative to 0x10.
0x10 End of file header, start of Balloon Battle Data.

Balloon Battle Data

This section contains parameters used on Balloon Battle. It consists of three sections: a Time Limit Table, an Unknown Table and a Balloon Battle Parameters sub-section. It is located at 0x10.

Balloon Battle Parameters

Offset Information
0x00 Number of points scored when hitting a player.
0x02 Number of extra points scored when defeating a player (originally unused).
0x04 Number of points scored when losing all balloons.
0x06 Unknown.
0x08 Unknown.
0x0A Unknown.
0x0C Unknown.
0x0E Unknown.
0x10 Unknown.
0x12 Unknown.

Coin Runners Data

This section contains parameters used on Coin Runners. It consists of seven sections: a Time Limit Table, 5 Unknown Tables and a Coin Runners Parameters sub-section. It is located at 0x1DC.

Coin Runners Parameters

Offset Information
0x00 Unknown.
0x02 Unknown.
0x04 Unknown.
0x06 Unknown.
0x08 Unknown.
0x0A Unknown.
0x0C Unknown.
0x0E Unknown.
0x10 Number of coins lost when getting hit by a Banana, Mushroom or Star.
0x12 Unknown.

Other Structures

These are structures that are used multiple times throughout the file.

Time Limit Table

There are two identical tables that contain time limit information for Balloon Battle and Coin Runners. These tables contain 110 unsigned 16-bit values that each define the time limit for each number of players on each stage in seconds.

The entries are ordered following the Course IDs for the battle stages minus 0x20.

Format of a Time Limit Table Entry
Offset Information
0x00 Time limit for 2 players.
0x02 Time limit for 3 players.
0x04 Time limit for 4 players.
0x06 Time limit for 5 players.
0x08 Time limit for 6 players.
0x0A Time limit for 7 players.
0x0C Time limit for 8 players.
0x0E Time limit for 9 players.
0x10 Time limit for 10 players.
0x12 Time limit for 11 players.
0x14 Time limit for 12 players.

Here's an offset table for reference.

Stage 2 Players 3 Players 4 Players 5 Players 6 Players 7 Players 8 Players 9 Players 10 Players 11 Players 12 Players
Delfino Pier 0x0 0x2 0x4 0x6 0x8 0xA 0xC 0xE 0x10 0x12 0x14
Block Plaza 0x16 0x18 0x1A 0x1C 0x1E 0x20 0x22 0x24 0x26 0x28 0x2A
Chain Chomp Wheel 0x2C 0x2E 0x30 0x32 0x34 0x36 0x38 0x3A 0x3C 0x3E 0x40
Funky Stadium 0x42 0x44 0x46 0x48 0x4A 0x4C 0x4E 0x50 0x52 0x54 0x56
Thwomp Desert 0x58 0x5A 0x5C 0x5E 0x60 0x62 0x64 0x66 0x68 0x6A 0x6C
GCN Cookie Land 0x6E 0x70 0x72 0x74 0x76 0x78 0x7A 0x7C 0x7E 0x80 0x82
DS Twilight House 0x84 0x86 0x88 0x8A 0x8C 0x8E 0x90 0x92 0x94 0x96 0x98
SNES Battle Course 4 0x9A 0x9C 0x9E 0xA0 0xA2 0xA4 0xA6 0xA8 0xAA 0xAC 0xAE
GBA Battle Course 3 0xB0 0xB2 0xB4 0xB6 0xB8 0xBA 0xBC 0xBE 0xC0 0xC2 0xC4
N64 Skyscraper 0xC6 0xC8 0xCA 0xCC 0xCE 0xD0 0xD2 0xD4 0xD6 0xD8 0xDA

All of the default time limit values are 180 (3 minutes).

Unknown Tables

For both Balloon Battle and Coin Runners, there are 0xDC-byte tables that control unknown parameters.

Tools

The following tools can handle KMG files:

  • (none)