Internal velocity

From MKWii TAS Wiki
Jump to navigation Jump to search

Internal velocity, also known as IV, vehicle speed, or engine speed, is one of four main types of velocity in Mario Kart Wii. It refers to the speed coming from the vehicle's engine, while external velocity comes from other forces acting on the vehicle.

Overview

IV is represented as a vector, with a direction and magnitude. The direction of the IV vector is the same (or very close) as the vehicle's facing direction in most circumstances. On outside-drift vehicles, the IV vector can deviate by up to ~45° from the facing direction during a drift, and even more during superhopping.

The magnitude of the IV vector is limited by maximum speed. IV is the speed actually provided by the engine, and it cannot increase above the maximum speed value (or decrease below, if moving backwards). Max speed is capped at 120 u/f, and the sum of IV, EV, and moving road speed is capped at 120 u/f too. Maximum base speed refers to the max speed value without any modifiers.

IV determines if the vehicle can perform certain actions. Drifting requires IV to be over 55% of max base speed. If IV is below 30% of max base speed, wheelies can be started but are canceled automatically. Tricking requires the magnitude of IV to be over 50% of max base speed instead, making it possible to trick at high negative IV. Stand-still miniturbos can only be sustained if IV is within ±10 u/f, and the barrel roll state ends if IV exceeds ±15 u/f. Lean rotation values change depending if IV is above or below 5 u/f in magnitude.

Changes to internal velocity

Increase

Holding A increases IV according to the vehicle's acceleration stat. Acceleration is a function of the percentage of IV relative to current max speed, thus being in a wheelie or on offroad affects the vehicle's acceleration.

While driving backwards, reversing (holding B) increases negative IV by 2 u/f², up to -20 u/f.

While a boost is active, a constant acceleration is applied to IV, so that the vehicle can reach its new maximum speed. The acceleration depends on the type of boost: 7 u/f² for mushroom-type boosts, 6 u/f² for trick-type boosts, 3 u/f^2 for miniturbo-type boosts, and 0.7 u/f² for drafts. If multiple boost accelerations are active, they do not stack and only the biggest is applied (except for tricks which have priority).

Decrease

If both A and B are released, IV decays exponentially at a rate of 2% per frame.

Braking decreases IV, applying a constant acceleration of -1.5 u/f² starting on the 2nd brake frame. Braking for 1 frame only reduces IV very slightly, with the slowdown being stronger if the vehicle's last-stage acceleration is low and on steeper slopes (both up and down); this is useful to manipulate QM.

If a vehicle has been airborne for over 5 frames, its IV begins decaying exponentially at a rate of 0.1% per frame, until it touches the ground again.

During a stand-still miniturbo, IV decays exponentially at a rate of 20% per frame.

On manual drift, turning without a boost decreases IV. The slowdown is proportional to the magnitude of the horizontal stick input, but it is also a function of the acceleration, handling, top speed, and handling reactivity stats. This slowdown stacks with deceleration from releasing A+B or braking, so holding hard left/right while decelerating loses speed faster. Optimal wheelie turning is the sequence of inputs which allows for the most turning in a wheelie without losing IV over time; it can be derived mathematically and changes for each character + bike combo.

The waterfalls on DS Yoshi Falls, and at the last turn of Koopa Cape, are moving road which slows down the vehicle, by disabling boost acceleration and decreasing IV by 0.5% and 3.5% per frame respectively. Both effects are prevented if the vehicle has offroad immunity. Since the waterfalls are not offroad, they do not affect maximum speed.

At sufficiently high IV, the cones on Daisy Circuit are knocked away and decrease IV by 18% upon collision. At low IV, the cones are simply pushed around and do not affect IV.

Other

Hitting a wall updates the IV direction to match the horizontal (XZ) facing direction. If the vehicle has been airborne for 5 frames or more, then IV matches the vertical facing direction too.

EV can be converted to IV. EV is either (almost) perpendicular to the facing direction, or purely vertical while airborne in the case of gravity; if the facing angle changes such that EV is partially parallel to it, the projection of EV on the facing unit vector is converted to IV.

During the countdown, IV is set to 0 u/f. Movement is still possible due to EV.

Maximum speed

Maximum speed acts as the limit of IV; if the vehicle's IV were to increase over max speed, it is set equal to the max speed instead. The value of maximum speed is affected by the top speed stat, ranging from 75.00 to 86.13 u/f.
Maximum speed is a positive value, but it limits both positive and negative IV. If IV is negative, its absolute value can't increase above maximum speed.

Increase

Boosts increase maximum speed while they are active, as well as provide acceleration to IV. Miniturbos increase maximum speed by 20%, tricks by 30%, and mushrooms by 40% with a minimum of 115 u/f. If two boosts are active at once, the biggest one determines max speed, except trick boosts which have priority over mushrooms.

Wheelies increase maximum speed by 15%, and do not boost IV. The wheelie bonus stacks additively with other boosts, i.e. a wheelie + miniturbo increases max speed by 35%.

Decrease

When a boost or wheelie ends, maximum speed does not immediately jump to a lower value; it decreases at a constant rate of 3 u/f², bringing IV down with it, until it reaches the regular top speed value. Deceleration from multiple sources does not stack; for instance, bikes can drop the wheelie while decelerating from a boost, without any penalty to their max speed. This is known as deceleration stacking.

Touching offroad works similarly; as long as at least one hitbox is colliding with offroad, maximum speed decreases by 3 u/f², until reaching max offroad speed. This value depends on the offroad type, and is a function of the speed and offroad stats. This means that clipping offroad for N frames only reduces max speed by 3N. Offroad deceleration also doesn't stack with wheelie and boost deceleration.

When driving on out of bounds collision, it counts as offroad and reduces max speed to 10% of the regular value. This is not affected by the offroad stat, so only the speed stat affects max speed on out of bounds.

Slow ramps also decrease maximum speed (and thus IV) by a constant 3 u/f² until reaching the speed lock.

If the angle between the vehicle's velocity and the wall's normal is greater than 90° (i.e. the wall is facing towards the vehicle), maximum speed abruptly decreases by a large amount, so that the vehicle quickly slows down. Depending on the angle of collision, maximum speed can decrease from ~35% of the previous value up to just above 0 u/f. Max speed remains lowered as long as the vehicle is colliding with the wall, then returns to its previous value.

Discrepancy between IV and maximum speed

Summing up, when max speed increases, it jumps to a higher value. When max speed decreases, it is gradually lowered by 3 u/f^2, and the vehicle is expected to slow down due to IV being capped. However, if IV is much lower than max speed, then max speed can decrease, and the vehicle doesn't slow down until the two values are equal.

The most common application of this quirk involves clipping offroad without speed loss. For example: the Spear drifts at 85.60 u/f; its max speed jumps to 115.56 u/f with a miniturbo + wheelie, and IV begins increasing by 3 u/f². On the following frame, the Spear touches offroad; max speed begins decreasing by 3 u/f², but IV is unaffected.
After 4 frames, IV and max speed are at 100.60 and 103.56 u/f respectively, so the Spear has not slowed down yet. On the next frame, max speed would decrease to 100.56 u/f, and so would IV; but if the Spear stops touching offroad, then max speed jumps to 115.56 u/f again, and IV continues increasing. As a result, the Spear is able to drive over offroad for 4 frames without speed loss, because it is accelerating from the boost.

Another less common application is rewheelies for automatic. Starting a wheelie after a drift increases max speed by 15%, while IV slowly matches it. Dropping the wheelie by holding ±6/±7 for 16 frames decreases max speed by 3 u/f², but IV is still much lower, so the bike is able to turn tighter for a few frames without losing speed. This can be looped to improve the bike's turning out of a drift without affecting its IV.