Use the Intended Mii Stats

From Custom Mario Kart
Revision as of 14:47, 19 September 2021 by B squo (talk | contribs) (Created page with "{{Online Unsafe}} '''Use the Intended Mii Stats''' is a Cheat Code from B_squo which fixes a small oversight in the code that results in the game loading the wrong st...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Important Information

WARNING — Online unsafe

All versions of this hack may give the player an unfair advantage, so you should not use it on online Worldwides or Regionals, else you might get banned.

Use the Intended Mii Stats is a Cheat Code from B_squo which fixes a small oversight in the code that results in the game loading the wrong stat slots for the Miis, resulting in them having assigned unintended stat values.

Overview

These are the stats the developers coded for the Miis, as driverParam.bin has these stats written in the slots intended for each Mii. These are the ones displayed in the vehicle selection screen as well.

Intended stats
Weight Class Weight Speed Acceleration Handling Drift Mini-Turbo Off-Road Speed Off-Road Rotation
Not drifting Drifting
Normal in Turn A0 A1 A0 A1 Manual Auto Manual Auto 0x02 0x03 0x04 0x05 0x01 0x02 0x03
0x04
0x05
Light Mii Outfit AMii Outfit B 0.252 0.53 0 0 0 0.09 0.01 0 0 0.000265 0.000222 4 0 0 0 0 0 0 0 0
Medium Mii Outfit AMii Outfit B 0.252 0.53 0 0 0 0 0 0 0 0 0 4 0.0171 0.0184 0.0113 0.00641 0.00263 0.00368 0.00263 0.00211
Heavy Mii Outfit AMii Outfit B 0 0.53 0 0.025 0.035 0.09 0.01 0.000555 0.00029 0.000265 0.000222 0 0 0 0 0 0 0 0 0


However, the ones that are actually read in gameplay are as follows:

The stats that are actually read in gameplay
Weight Class Weight Speed Acceleration Handling Drift Mini-Turbo Off-Road Speed Off-Road Rotation
Not drifting Drifting
Normal in Turn A0 A1 A0 A1 Manual Auto Manual Auto 0x02 0x03 0x04 0x05 0x01 0x02 0x03
0x04
0x05
Light Mii Outfit AMii Outfit B 0 0.53 0.000947 0 0 0 0 0.000555 0.00029 0 0 4 0 0 0 0 0 0 0 0
Medium Mii Outfit AMii Outfit B 0.252 0.53 0 0 0 0.09 0.01 0 0 0.000265 0.000222 4 0 0 0 0 0 0 0 0
Heavy Mii Outfit AMii Outfit B 0.252 0.53 0 0 0 0 0 0 0 0 0 4 0.0171 0.0184 0.0113 0.00641 0.00263 0.00368 0.00263 0.00211

How the game determines the stat slot to load for Miis

The assignment of a stat slot to a Mii is made in two steps:

1. Determine the weight class of the Mii being loaded. Miis have many character identifiers assigned to them, one for each combination of weight class, outfit and gender. So, before proceeding, the game needs to know which of the 3 weight classes corresponds to the Mii being loaded.

To do this, the game first substracts the actual character ID of the Mii being loaded with the one assigned to Small Mii Outfit A (Male), which is 0x18. With this, we obtain another number that identifies each Mii, ranging from 0 (Small Mii Outfit A, Male) to 0x11 (Heavy Mii Outfit C, Female).

After that, the game multiplies the result of this operation with the constant 0x2AAAAAAB. Finally, the upper 32-bits of this product identifies the weight class:

  • 0 = Small
  • 1 = Medium
  • 2 = Heavy

For example, if we're loading a Heavy Mii Outfit A (Female), the first operation would be 0x25 - 0x18 = 0x0D, and then, 0x2AAAAAAB * 0x0D = 0x22AAAAAAF. When taking the upper 32-bits of 0x22AAAAAAF, we obtain 2 (Heavy).

2. Specifing the stat slot to be read. The stat slot identifier for each character matches their character ID. The only exception are Miis, as they have 3 slots depending on their weight class.

To obtain the corresponding value for each Mii, the game adds the stat slot ID for Small Mii Outfit A (Male) (0x18) with the weight class value obtained above. This should result in the following:

  • 0x18 = Small Mii
  • 0x19 = Medium Mii
  • 0x1A = Heavy Mii

Using the example above, we should get 0x18 + 2 = 0x1A (Heavy Mii).

The bug

The problem in both steps resides in the ID number specified for Small Mii Outfit A (Male). As stated above, this value should be 0x18. However, the one that is actually written in the code is 0x17 (the immediate value corresponding to the instructions at 0x80592140 and 0x80592160 in RAM, PAL)... this is the ID for Rosalina!

So, when doing the addition at step 2 with this wrong value, we get that the stat slots that are assigned to each Mii are as follows:

  • 0x17 (Rosalina) = Small Mii
  • 0x18 (Small Mii) = Medium Mii
  • 0x19 (Medium Mii) = Heavy Mii

In other words...

- Small Miis use Rosalina's intended stats.

- Medium Miis use Small Mii's intended stats.

- Heavy Miis use Medium Mii's intended stats.

This bug also results in the following quirks:

  • Rosalina and Small Miis share the same stat slot. This means that, for example, if one modifies Rosalina's stats, they'd also change the ones for Small Miis, and viceversa.
  • The intended stats for Heavy Miis go completely unused, as they don't get assigned to any character.

Cheat Codes

The cheat code corrects the ID specified for Small Mii Outfit A (Male) to be 0x18 when the game reads the stats for the Miis.

Use the Intended Mii Stats, PAL

Use the Intended Mii Stats, NTSC-U

Use the Intended Mii Stats, NTSC-J

Use the Intended Mii Stats, NTSC-K


By the same author: B_squo