Miniturbo: Difference between revisions
m →Types |
m Add relevant code |
||
Line 24: | Line 24: | ||
== Relevant code == | == Relevant code == | ||
<syntaxhighlight lang="cpp" line="1"> | |||
// TODO: context, comments | |||
// NOTE: This has not been confirmed to match yet, but is at least functionally equivalent | |||
void Kart::KartMove::calcMtCharge() { | |||
if (mDriftState >= 3) { | |||
return; | |||
} | |||
KartState *state = mAccessor->getState(); | |||
if (state->mFlags & ONLINE_REMOTE) { | |||
return; | |||
} | |||
addMtCharge(1, mMtCharge, BASE_MT_CHARGE, MAX_MT_CHARGE); | |||
addMtCharge(2, mSmtCharge, BASE_SMT_CHARGE, MAX_SMT_CHARGE); | |||
} | |||
bool Kart::KartMove::addMtCharge(s32 driftState, s16 &mtCharge, s16 baseMtCharge, s16 maxMtCharge) { | |||
bool charged = false; | |||
if (mDriftState == driftState) { | |||
mtCharge += baseMtCharge; | |||
addExtraMtCharge(mtCharge, EXTRA_MT_CHARGE, NO_EXTRA_MT_CHARGE, BONUS_CHARGE_STICK_THRESHOLD); | |||
if (checkMtCharge(mtCharge, maxMtCharge)) { | |||
charged = true; | |||
++mDriftState; | |||
} | |||
} | |||
return charged; | |||
} | |||
void Kart::KartMove::addExtraMtCharge(s16 &mtCharge, s16 left, s16 right, f32 bonusStickChargeThreshold) const { | |||
s16 leftTurningBonus = left; | |||
s16 rightTurningBonus = right; | |||
if (mHopStickX == -1) { | |||
leftTurningBonus = right; | |||
rightTurningBonus = left; | |||
} | |||
f32 stickX = mAccessor->getState()->getStickX(); | |||
if (stickX < -bonusStickChargeThreshold) { | |||
mtCharge += leftTurningBonus; | |||
} else if (stickX > bonusStickChargeThreshold) { | |||
mtCharge += rightTurningBonus; | |||
} | |||
} | |||
// This function is never seen anywhere in the binary | |||
// However, it's heavily speculated to exist due to the assembly instructions | |||
inline bool KartMove::checkMtCharge(s16 &mtCharge, s16 maxMtCharge) { | |||
if (maxMtCharge < mtCharge) { | |||
mtCharge = maxMtCharge; | |||
return true; | |||
} | |||
return false; | |||
} | |||
</syntaxhighlight> |
Revision as of 17:14, 30 August 2023
The miniturbo, or mini-turbo is a speed boost technique present in every Mario Kart game.
Overview
When performing a drift, assuming you are using manual transmission, a miniturbo will charge up after a certain period of time, and when you release the drift, you will get a boost from this miniturbo. Miniturbos charge at different rates depending on the joystick direction held during the drift. Although the GCN joystick has an input range from 0 to 255 on both axes, all inputs are simplified and reduced down to an input range from 0 to 14 on both axes. These are also referred to as -7 to +7 to ease understanding even more. Miniturbo charge is a numerical value that counts upwards from 0. If you are performing a right drift, any input from -7 to +2 will increase that value an increment of 2 every frame, and any input from +3 to +7 will increase that value an increment of 5 every frame. Conversely, if you are performing a left drift, any input from +7 to -2 will increase that value an increment of 2 every frame, and any input from -3 to -7 will increase that value an increment of 5 every frame.
Types
There are three types of miniturbos in Mario Kart Wii:
TO DO: Boost lengths and corresponding images for each type.
Standard Miniturbo
This is the most common type of miniturbo. It is charged when miniturbo charge counter becomes greater than 270, and is possible on both bikes and karts. Upon reaching at least 150 charge, individual blue sparks begin appearing at the back of the vehicle the next frame.
Super Miniturbo
This miniturbo is only possible on karts. Beginning on the same frame that the standard miniturbo is fully charged, a new super miniturbo counter begins counting from 0 up to 300. It is charged when the super miniturbo counter becomes greater than 300, and individual orange sparks appear the frame after the charge counter reaches at least 180. The player may be tempted to release the miniturbo after a standard miniturbo is charged, but should they continue to hold the drift for slightly longer until the orange sparks will appear, they can instead release a super miniturbo.
Standstill Miniturbo
This miniturbo can be begin to be charged by holding accelerate and brake (A and B) simultaneously when IV is between -10 and 10. This increments a standstill miniturbo charge counter by 1 per frame until it becomes greater than 75, after which the standstill miniturbo can be released.
Softdrift
Luke's Rule
Reference Campbell's sheet here
Relevant code
// TODO: context, comments // NOTE: This has not been confirmed to match yet, but is at least functionally equivalent void Kart::KartMove::calcMtCharge() { if (mDriftState >= 3) { return; } KartState *state = mAccessor->getState(); if (state->mFlags & ONLINE_REMOTE) { return; } addMtCharge(1, mMtCharge, BASE_MT_CHARGE, MAX_MT_CHARGE); addMtCharge(2, mSmtCharge, BASE_SMT_CHARGE, MAX_SMT_CHARGE); } bool Kart::KartMove::addMtCharge(s32 driftState, s16 &mtCharge, s16 baseMtCharge, s16 maxMtCharge) { bool charged = false; if (mDriftState == driftState) { mtCharge += baseMtCharge; addExtraMtCharge(mtCharge, EXTRA_MT_CHARGE, NO_EXTRA_MT_CHARGE, BONUS_CHARGE_STICK_THRESHOLD); if (checkMtCharge(mtCharge, maxMtCharge)) { charged = true; ++mDriftState; } } return charged; } void Kart::KartMove::addExtraMtCharge(s16 &mtCharge, s16 left, s16 right, f32 bonusStickChargeThreshold) const { s16 leftTurningBonus = left; s16 rightTurningBonus = right; if (mHopStickX == -1) { leftTurningBonus = right; rightTurningBonus = left; } f32 stickX = mAccessor->getState()->getStickX(); if (stickX < -bonusStickChargeThreshold) { mtCharge += leftTurningBonus; } else if (stickX > bonusStickChargeThreshold) { mtCharge += rightTurningBonus; } } // This function is never seen anywhere in the binary // However, it's heavily speculated to exist due to the assembly instructions inline bool KartMove::checkMtCharge(s16 &mtCharge, s16 maxMtCharge) { if (maxMtCharge < mtCharge) { mtCharge = maxMtCharge; return true; } return false; }