Drift button

From MKWii TAS Wiki
Jump to navigation Jump to search

The drift button is an internal input tracked by Mario Kart Wii, not directly accessible to the player.

Overview

On manual drift, many actions are mapped to the B and R buttons (1 and B on Wii Wheel, B on Nunchuk), such as hopping, drifting, and braking. To remove the disambiguation, the game uses a flag known as the drift button to control the actions of the vehicle.

For all intents and purposes, the drift button is treated just like any other controller button by the game; however, it is not a physical button on the controller, therefore the player is not able to directly press or unpress the drift button. The state of the drift button is completely reliant on the A and B/R buttons (2 and 1/B on Wii Wheel, A and B on Nunchuk); if both A and B are active, and B was not pressed before A, then the drift button is pressed. Otherwise, the drift button is not pressed.

Even though the player presses the B/R buttons to hop or drift, internally it is the drift button that initiates both actions. Pressing B/R while the drift button is not set causes the vehicle to brake or reverse instead.

Techniques

Button switching

Every controller except the Nunchuk features two buttons mapped to the hop and brake actions. Switching from one button to the other prompts the game to check the state of the drift button again.

Pressing B, then A+B on the next frame, does not trigger the drift button, and the vehicle simply continues braking. Normally, in order to trigger the drift button, it is required to release the B button for at least one frame so that A is pressed first, for example B → A → A+B. However, pressing B → A+R does trigger the drift button, since R was first pressed on the same frame as A.

Button switching allows the vehicle to remove delay between two consecutive actions, such as braking into a hop (seen on N64 Bowser's Castle UR 3lap) or hopping while reversing (seen on Maple Treeway UR 3lap and GBA Shy Guy Beach UR 3lap). Button switching may also be used for brake supergrinding.

Pause tech

The two conditions for pressing the drift button are handled differently. The game checks whether A and B are active only while the race is progressing. However, the condition for the order of the inputs is checked on every frame, including during in-game pauses. This makes it possible to change the state of the drift button by pausing, without releasing the B button during the race.

Pressing B, then A+B does not set the drift button, as above. However, it is possible to press B, pause the game, then release B, and press A+B, unpausing the game; this results in going from pressing B without drift, to pressing A+B and the drift button, on two consecutive frames of the race. Unlike button switching, this is valid for Nunchuk too.

Another application of pause tech is as follows: press A+B, setting the drift button, then pause, release A and B, press B, then press A unpausing the game. This results in A+B being pressed on two consecutive frames, but the drift button is released on the second frame.

Deactivation of the TAS Code gecko code can lead to the same drift button changes caused by pause tech.

Illegal inputs

Button switching and pause tech make it possible to press the A, B, and drift buttons at the same time in any situation, regardless of what the vehicle was doing on the previous frame. In any case, the game requires the A and B buttons to be held for the drift button to be pressed. Pressing drift + A only, drift + B only, or drift + neither A nor B is not possible with a normal physical controller under any circumstance. These button combinations are known as illegal inputs.

Using tools such as TAS Toolkit, it is possible to control the state of the drift button independently from the game's logic. The game's physics actually do allow for illegal button combinations, and it is even possible for an .rkg file to be saved featuring illegal inputs[1]. However, since there is no known way of achieving these button combinations in regular gameplay, they are not allowed under any category in TAS. This distinction is notable for certain categories, such GBA Shy Guy Beach UR; the inability to hop while reversing, without pressing A for a frame, causes the movement after the respawn to be slightly slower than what the game allows using illegal inputs.