Difference between revisions of "Lap & Speed Modifier"

From Custom Mario Kart
Jump to navigation Jump to search
m (Fix minor typo)
 
(15 intermediate revisions by 8 users not shown)
Line 1: Line 1:
'''Lap & Speed Modifier''' is the name of an [[Mario Kart Wii]] extension to modify the number of laps and the basic speed of a race. It was developed by [[MrBean35000vr]] for [[CTGP]] and is also available as cheat code.
+
'''Lap & Speed Modifier''' is a [[Mario Kart Wii]] extension that modifies the number of laps and the basic speed of a race. It was developed by [[MrBean35000vr]] for [[CTGP Revolution v1.03]] with help from Geeh and MrEvil and is also available as a pair of cheat codes.
  
 +
== Media ==
  
__TOC__
+
{{youtube-box||UOPIm79ijfY|Speed Modifier}}
 
+
{{youtube-box||3xz3i3IxHwc|Max Lap Count Modifier}}
  
 
== How it works (STGI) ==
 
== How it works (STGI) ==
Line 9: Line 10:
 
The '''Lap & Speed Modifier''' reads some values of [[KMP#STGI|KMP/STGI]]:
 
The '''Lap & Speed Modifier''' reads some values of [[KMP#STGI|KMP/STGI]]:
 
* The byte at offset 0 is used for the number of laps, if it is between 1 and 9.
 
* The byte at offset 0 is used for the number of laps, if it is between 1 and 9.
* The 2 bytes at offsets 0x0A and 0x0B are interpreted as the 2 most significant bytes of the floating point speed factor. The usual range is 0.5 to 2.0.
+
* The 2 bytes at offsets 0x0A and 0x0B are interpreted as the 2 most significant bytes of the floating point speed factor. The least significant two bytes of the speed factor are always 0. If the speed modifier equals 0.0 a value of 1.0 is used instead (for backwards compatibility with tracks not using a Speed modifier). The usual range is 0.5 (0x3F00) to 2.0 (0x4000).
 +
 
 +
=== Speed Factor Discussion ===
 +
The tracks are generally designed for speed factor 1.0. With it, a player can increment its position up to 120 game units if using a mushroom or Bullet Bill. If using a speed factor of 2.0, the increment can be 2*120 = 240 game units. So it is possible to miss walls, items or opponents if, in one calculation, the vehicle was behind the object and on the next calculation, in front of the object. While testing speed factor 3, [[Wiimm]] and [[Leseratte]] slipped through {{obj-ref|0x65|Item}} and Fake Item Boxes.
 +
 
 +
Another relevant factor is the ''blow factor'' of the cubes if creating a KCL. For optimization, the world is generally divided into cubes of 512*512*512 units and only the triangle list for the current cube is used to find collisions. It is important that near neighboring triangles, cubes are also included into the triangle list for the cube. Nintendo blows up the cubes by factor ~3.35 (KCL_BLOW=600 or --kcl=CHARY for [[Wiimms SZS Tools]]) to find neighboring triangles. If using option --kcl=SMALL, then only 200 units are used. This value is enough for speed factor 1.0, but may be too small for factor 2.0.
 +
 
 +
Another point are [[checkpoints]]. If they are placed too near, you can miss some checkpoints. And if you miss a key checkpoint, the result is a no-lap-count bug.
 +
 
 +
'''So the best is to use never speed factors >2.0!'''
  
 
== Cheat Codes ==
 
== Cheat Codes ==
  
Cheat codes are available for 3 regions:
+
Cheat codes are available for 4 regions. The cheat codes are already built into [[LE-CODE]]:
 +
 
 +
<spoiler text="Lap Modifier, PAL">
 +
<pre>
 +
Lap Modifier, PAL [MrBean35000vr]
 +
C25328B0 00000005
 +
3CA0809C 80A5D6E8
 +
80A5003C 80A50000
 +
80A50000 80A50000
 +
88050000 98040B8D
 +
60000000 00000000
 +
045336B8 60000000
 +
04534350 60000000
 +
04534BBC 60000000
 +
04723D10 281D0009
 +
04723D40 3BA00009
 +
C2723D50 00000007
 +
4800002D 00000000
 +
00000000 00000000
 +
3F800000 40000000
 +
40400000 40800000
 +
40A00000 40C00000
 +
40E00000 7CA802A6
 +
38800003 00000000
 +
</pre></spoiler>
  
<spoiler text="PAL">
+
<spoiler text="Speed Modifier, PAL">
 
<pre>
 
<pre>
 +
Speed Modifier, PAL [MrBean35000vr]
 
C257B9B0 00000004
 
C257B9B0 00000004
 
C00459F4 3E808170
 
C00459F4 3E808170
Line 102: Line 137:
 
60000000 FF80E890
 
60000000 FF80E890
 
3A800000 60000000
 
3A800000 60000000
C25328B0 00000005
 
3CA0809C 80A5D6E8
 
80A5003C 80A50000
 
80A50000 80A50000
 
88050000 98040B8D
 
60000000 00000000
 
045336B8 60000000
 
04534350 60000000
 
04534BBC 60000000
 
04723D10 281D0009
 
04723D40 3BA00009
 
C2723D50 00000007
 
4800002D 00000000
 
00000000 00000000
 
3F800000 40000000
 
40400000 40800000
 
40A00000 40C00000
 
40E00000 7CA802A6
 
38800003 00000000
 
 
</pre></spoiler>
 
</pre></spoiler>
<spoiler text="NTSC/USA">
+
 
 +
<spoiler text="Lap Modifier, NTSC/USA">
 
<pre>
 
<pre>
 +
Lap Modifier, NTSC/USA [MrBean35000vr]
 
C252DD68 00000005
 
C252DD68 00000005
 
3CA0809C 80A58F28
 
3CA0809C 80A58F28
Line 143: Line 161:
 
40E00000 7CA802A6
 
40E00000 7CA802A6
 
38800003 00000000
 
38800003 00000000
 +
</pre></spoiler>
 +
 +
<spoiler text="Speed Modifier, NTSC/USA">
 +
<pre>
 +
Speed Modifier, NTSC/USA [MrBean35000vr]
 
C257514C 00000004
 
C257514C 00000004
 
C0041134 3E808170
 
C0041134 3E808170
Line 229: Line 252:
 
3A800000 60000000
 
3A800000 60000000
 
</pre></spoiler>
 
</pre></spoiler>
<spoiler text="NTSC/Japan">
+
 
 +
<spoiler text="Lap Modifier, NTSC/Japan">
 
<pre>
 
<pre>
 +
Lap Modifier, NTSC/Japan [MrBean35000vr]
 
C2532230 00000005
 
C2532230 00000005
 
3CA0809C 80A5C748
 
3CA0809C 80A5C748
Line 237: Line 262:
 
88050000 98040B8D
 
88050000 98040B8D
 
60000000 00000000
 
60000000 00000000
04533048 60000000
+
04533038 60000000
 
04533CD0 60000000
 
04533CD0 60000000
 
0453453C 60000000
 
0453453C 60000000
Line 250: Line 275:
 
40E00000 7CA802A6
 
40E00000 7CA802A6
 
38800003 00000000
 
38800003 00000000
 +
</pre></spoiler>
 +
 +
<spoiler text="Speed Modifier, NTSC/Japan">
 +
<pre>
 +
Speed Modifier, NTSC/Japan [MrBean35000vr]
 
C257B330 00000004
 
C257B330 00000004
 
C0044B54 3E808170
 
C0044B54 3E808170
Line 334: Line 364:
 
FFC0E890 3E600000
 
FFC0E890 3E600000
 
60000000 FF80E890
 
60000000 FF80E890
3A800000 60000000</pre></spoiler>
+
3A800000 60000000
 +
</pre></spoiler>
 +
 
 +
<spoiler text="Lap Modifier, NTSC/Korea">
 +
<pre>
 +
Lap Modifier, NTSC/Korea [MrBean35000vr]
 +
C2520908 00000005
 +
3CA0809B 80A5BD28
 +
80A5003C 80A50000
 +
80A50000 80A50000
 +
88050000 98040B8D
 +
60000000 00000000
 +
04521710 60000000
 +
045223A8 60000000
 +
04522C14 60000000
 +
047120B8 281D0009
 +
047120E8 3BA00009
 +
C27120F8 00000007
 +
4800002D 00000000
 +
00000000 00000000
 +
3F800000 40000000
 +
40400000 40800000
 +
40A00000 40C00000
 +
40E00000 7CA802A6
 +
38800003 00000000
 +
</pre></spoiler>
 +
 
 +
<spoiler text="Speed Modifier, NTSC/Korea">
 +
<pre>
 +
Speed Modifier, NTSC/Korea [MrBean35000vr]
 +
C2569A08 00000004
 +
C0043E6C 3E808170
 +
C3940000 EC1C0032
 +
FF80E890 3A800000
 +
60000000 60000000
 +
C25665B0 00000004
 +
C0093E6C 3E808170
 +
C3940000 EC1C0032
 +
FF80E890 3A800000
 +
60000000 60000000
 +
C2573920 00000004
 +
C0053E70 3E808170
 +
C3940000 EC1C0032
 +
FF80E890 3A800000
 +
60000000 60000000
 +
C25699F8 00000004
 +
C0043E70 3E808170
 +
C3940000 EC1C0032
 +
FF80E890 3A800000
 +
60000000 60000000
 +
C2569C1C 00000004
 +
C01E0108 3E808170
 +
C3940000 EC1C0032
 +
FF80E890 3A800000
 +
60000000 60000000
 +
C2569DD8 00000004
 +
C0030004 3E808170
 +
C3740000 EC1B0032
 +
FF60E890 3A800000
 +
60000000 60000000
 +
C2569DB4 00000004
 +
C0030014 3E808170
 +
C3740000 EC1B0032
 +
FF60E890 3A800000
 +
60000000 60000000
 +
C2580204 00000004
 +
C0230024 3E808170
 +
C3940000 EC3C0072
 +
FF80E890 3A800000
 +
60000000 60000000
 +
C2580214 00000004
 +
C0230028 3E808170
 +
C3940000 EC3C0072
 +
FF80E890 3A800000
 +
60000000 60000000
 +
C2580224 00000004
 +
C023002C 3E808170
 +
C3940000 EC3C0072
 +
FF80E890 3A800000
 +
60000000 60000000
 +
C2580234 00000004
 +
C0230030 3E808170
 +
C3940000 EC3C0072
 +
FF80E890 3A800000
 +
60000000 60000000
 +
C25801E4 0000001D
 +
C0230018 3E80809B
 +
8294BD28 8294003C
 +
82940000 82940000
 +
82940000 A274000A
 +
5673801E 2C130000
 +
40820008 3E603F80
 +
3E808170 92740000
 +
3E600000 C3940000
 +
EC3C0072 3E808160
 +
3E6042D2 92740004
 +
3E604296 92740008
 +
3E604382 9274000C
 +
3E604302 92740010
 +
3E60491C 62734000
 +
92740014 3E604302
 +
92740018 60000000
 +
C3D40004 EFDC07B2
 +
3E608089 D3D34220
 +
C3D40008 EFDC07B2
 +
D3D33F10 C3D4000C
 +
EFDC07B2 D3D34034
 +
C3D40010 EFDC07B2
 +
D3D34084 C3D40014
 +
EFDC07B2 D3D34094
 +
C3D40018 EFDC07B2
 +
D3D33F1C 60000000
 +
FFC0E890 3E600000
 +
60000000 FF80E890
 +
3A800000 60000000
 +
</pre></spoiler>
  
 
== Wiimms SZS Tools ==
 
== Wiimms SZS Tools ==
 
=== Patching Track Files ===
 
=== Patching Track Files ===
  
The values of the STGO section can be patched easily by tool '''wszst''':
+
The values of the STGI section can easily be patched by the tool '''wszst''':
 
* '''wszst patch [http://szs.wiimm.de/opt/speed-mod --speed-mod=factor] ...''' will change the speed factor.
 
* '''wszst patch [http://szs.wiimm.de/opt/speed-mod --speed-mod=factor] ...''' will change the speed factor.
* '''wszst patch [http://szs.wiimm.de/opt/kmp --kmp=3laps] ...''' will patch the lap number. Values between '''1lap''' and '''9laps''' are possible.
+
* '''wszst patch [http://szs.wiimm.de/opt/kmp --kmp=3laps] ...''' will patch the lap number. Values between '''1lap''' and '''9laps''' are possible (however, 9 laps don't work correctly in the game for some reason, it will display 8 laps but actually drive for 9 laps).
 
* '''wszst patch [http://szs.wiimm.de/opt/kmp --kmp=MODE] ...''' will patch the pole position (modes '''left''' or '''right''') and/or the narrow mode (modes '''wide''' or '''narrow''').
 
* '''wszst patch [http://szs.wiimm.de/opt/kmp --kmp=MODE] ...''' will patch the pole position (modes '''left''' or '''right''') and/or the narrow mode (modes '''wide''' or '''narrow''').
  
Line 349: Line 494:
  
 
[[category:Software]]
 
[[category:Software]]
 +
[[category:Cheat Codes]]

Latest revision as of 22:34, 20 July 2023

Lap & Speed Modifier is a Mario Kart Wii extension that modifies the number of laps and the basic speed of a race. It was developed by MrBean35000vr for CTGP Revolution v1.03 with help from Geeh and MrEvil and is also available as a pair of cheat codes.

Media

Speed Modifier
Max Lap Count Modifier

How it works (STGI)

The Lap & Speed Modifier reads some values of KMP/STGI:

  • The byte at offset 0 is used for the number of laps, if it is between 1 and 9.
  • The 2 bytes at offsets 0x0A and 0x0B are interpreted as the 2 most significant bytes of the floating point speed factor. The least significant two bytes of the speed factor are always 0. If the speed modifier equals 0.0 a value of 1.0 is used instead (for backwards compatibility with tracks not using a Speed modifier). The usual range is 0.5 (0x3F00) to 2.0 (0x4000).

Speed Factor Discussion

The tracks are generally designed for speed factor 1.0. With it, a player can increment its position up to 120 game units if using a mushroom or Bullet Bill. If using a speed factor of 2.0, the increment can be 2*120 = 240 game units. So it is possible to miss walls, items or opponents if, in one calculation, the vehicle was behind the object and on the next calculation, in front of the object. While testing speed factor 3, Wiimm and Leseratte slipped through Item and Fake Item Boxes.

Another relevant factor is the blow factor of the cubes if creating a KCL. For optimization, the world is generally divided into cubes of 512*512*512 units and only the triangle list for the current cube is used to find collisions. It is important that near neighboring triangles, cubes are also included into the triangle list for the cube. Nintendo blows up the cubes by factor ~3.35 (KCL_BLOW=600 or --kcl=CHARY for Wiimms SZS Tools) to find neighboring triangles. If using option --kcl=SMALL, then only 200 units are used. This value is enough for speed factor 1.0, but may be too small for factor 2.0.

Another point are checkpoints. If they are placed too near, you can miss some checkpoints. And if you miss a key checkpoint, the result is a no-lap-count bug.

So the best is to use never speed factors >2.0!

Cheat Codes

Cheat codes are available for 4 regions. The cheat codes are already built into LE-CODE:

Lap Modifier, PAL


Speed Modifier, PAL


Lap Modifier, NTSC/USA


Speed Modifier, NTSC/USA


Lap Modifier, NTSC/Japan


Speed Modifier, NTSC/Japan


Lap Modifier, NTSC/Korea


Speed Modifier, NTSC/Korea


Wiimms SZS Tools

Patching Track Files

The values of the STGI section can easily be patched by the tool wszst:

  • wszst patch --speed-mod=factor ... will change the speed factor.
  • wszst patch --kmp=3laps ... will patch the lap number. Values between 1lap and 9laps are possible (however, 9 laps don't work correctly in the game for some reason, it will display 8 laps but actually drive for 9 laps).
  • wszst patch --kmp=MODE ... will patch the pole position (modes left or right) and/or the narrow mode (modes wide or narrow).

Patching main.dol to enable LS-Mod support

wstrt patch supports the option --add-section=file to add a section to file main.dol. The section can be a gecko code interpreter together with some cheat codes.