Difference between revisions of "Use the Intended Mii Stats"

From Custom Mario Kart
Jump to navigation Jump to search
(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...")
 
Line 1: Line 1:
 
{{Online Unsafe}}
 
{{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 stat slots for the Miis, resulting in them having assigned unintended stat values.
 
  
 
== Overview ==
 
== Overview ==
 +
'''Use the Intended Mii Stats''' is a [[cheat code]] created by [[B_squo]]. It fixes a small oversight in the code that results in the game loading the wrong stat slots for the [[Mii]]s, resulting in them having assigned unintended stat values.
  
 
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.
 
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.
Line 111: Line 110:
 
|bgcolor="MistyRose"| 0
 
|bgcolor="MistyRose"| 0
 
|}
 
|}
 
  
 
However, the ones that are actually read in gameplay are as follows:
 
However, the ones that are actually read in gameplay are as follows:
Line 220: Line 218:
 
|}
 
|}
  
== How the game determines the stat slot to load for Miis ==
+
== 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:
 
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 [[List_of_Identifiers#Characters|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.
+
'''1. Determine the weight class of the Mii being loaded.''' Miis have many [[List of Identifiers#Characters|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 three 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).
+
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 (large 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:
 
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
 
* 0 = Small
 
* 1 = Medium
 
* 1 = Medium
* 2 = Heavy
+
* 2 = Large
  
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).
+
For example, if we're loading a large 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 (large).
  
'''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.
+
'''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 three 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:
 
  
 +
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
 
* 0x18 = Small Mii
 
* 0x19 = Medium Mii
 
* 0x19 = Medium Mii
* 0x1A = Heavy Mii
+
* 0x1A = Large 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!'''
+
Using the example above, we should get 0x18 + 2 = 0x1A (large Mii).
  
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:
+
== 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 two with this wrong value, we get that the stat slots that are assigned to each Mii are as follows:
 
* 0x17 (Rosalina) = Small Mii
 
* 0x17 (Rosalina) = Small Mii
 
* 0x18 (Small Mii) = Medium Mii
 
* 0x18 (Small Mii) = Medium Mii
* 0x19 (Medium Mii) = Heavy Mii
+
* 0x19 (Medium Mii) = Large 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.'''
+
In other words:
 +
* '''Small Miis use Rosalina's intended stats.'''
 +
* '''Medium Miis use small Mii's intended stats.'''
 +
* '''Large Miis use medium Mii's intended stats.'''
  
 
This bug also results in the following quirks:
 
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 would also change the ones for Small Miis and vice versa.
* 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 large Miis go completely unused, as they do not get assigned to any character.
 
 
* The intended stats for Heavy Miis go completely unused, as they don't get assigned to any character.
 
  
 
== Cheat Codes ==
 
== 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.
+
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.
  
 
<spoiler text="Use the Intended Mii Stats, PAL">
 
<spoiler text="Use the Intended Mii Stats, PAL">
Line 299: Line 287:
  
 
{{User-B_squo-Link}}
 
{{User-B_squo-Link}}
[[category:Cheat Codes]]
+
[[Category:Cheat Codes]]

Revision as of 19:35, 19 September 2021

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.

Overview

Use the Intended Mii Stats is a cheat code created by B_squo. It 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.

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 three 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 (large 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 = Large

For example, if we're loading a large 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 (large).

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 three 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 = Large Mii

Using the example above, we should get 0x18 + 2 = 0x1A (large 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 two 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) = Large Mii

In other words:

  • Small Miis use Rosalina's intended stats.
  • Medium Miis use small Mii's intended stats.
  • Large 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 would also change the ones for Small Miis and vice versa.
  • The intended stats for large Miis go completely unused, as they do not 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