Iwerlipse
The Iwerlipse is the range of positions Mario can occupy while he is in the air and cannot turn, assuming that drag is constant. The boundary of the Iwerlipse is reached by Arctan Straining - the optimal way of air straining that gives the greatest distance along a chosen angle Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \omega} for a given number of frames Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle T} . For a single frame Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle T=1} , the Iwerlipse is an ellipse with half-width 10 (in the sideways direction) and half-height 1.5 (in the forwards direction). For general Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle T} , it resembles an ellipse with half-width Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle 10T} and half-height Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle 3T(T+1)/4} , but bulges at the corners, covering more area than an ellipse with the same dimensions. As shown by Grassdigger, the shape is well approximated by a generalised superellipse, and thus Pannenkoek2012 proposed calling this shape the Iwerlipse (pronounced eeverlipse /ˈivɜlɪps/) - a pun on the name of Iwer Sonsch, who first discoverered that Arctan Straining was optimal in April 2018.
Basics
Arctan Straining gives the maximum possible distance along a target angle Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \omega} that differs from the facing angle Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \theta} , over a finite number of frames Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle T} . It is performed by choosing straining angles Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \phi_t} (intendedYaw) such that
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \begin{align} \phi_t - \theta = \begin{cases} \arctan \left[\dfrac{10\tan(\omega - \theta)}{1.5(T+1-t)} \right] & \text{if } \cos(\omega-\theta) > 0, \\[14pt] \arctan \left[\dfrac{10\tan(\omega - \theta)}{1.5(T+1-t)} \right] + 180^\circ & \text{if } \cos(\omega-\theta) < 0, \end{cases} \end{align} }
with Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle t} being the frame number between Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle 1} and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle T} . (Usually only the top row of this equation is given, but since the Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \arctan} function only gives results between Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \pm 90^\circ} , we must add Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle 180^\circ} to the result if the target angle is behind Mario.)
Arctan straining is a result of two asymmetries in how Mario's forward velocity and sideways speed are updated
- Forward velocity accelerates gradually over time, while sideways speed is reset every frame
- Straining on a single frame has a weak effect on forward velocity (increasing velocity by a maximum of 1.5), but a strong effect on sideways speed for a single frame (setting sideways speed to a maximum of 10).
In terms of total distance acquired along some direction, forward velocity is thus more effective over long periods of time, where it has time to accelerate to large values, whereas sideways speed is more effective over short periods of time. Optimal straining over many frames then involves straining mostly along the forwards direction to build up a large forward velocity, and then towards the end of the trajectory, transitioning into sideways straining to exploit the large sideways displacement obtainable in a single frame.
Update Equations
When Mario is in the air and cannot turn, the function update_air_without_turn is responsible for updating Mario's velocity variables from one frame, Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle t-1}
, to the next, Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle t}
. Without loss of generality, we can choose coordinates so that Mario's facing angle is zero. In other words, he is facing along the Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle z}
-axis, while his sideways speed is directed along the Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle x}
-axis. Mario's forward velocity, Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle v_t}
, and position coordinates Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle z_t}
and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle x_t}
are then updated via
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \begin{align} v_t &= v_{t-1} - D(v_{t-1}, \phi_t) + 1.5\cos(\phi_t),\\ z_t &= z_{t-1} + v_t,\\ x_t &= x_{t-1} + 10\sin(\phi_t), \end{align}}
where Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \phi_t} is the straining angle (intendedYaw) on frame Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle t} . The total effect of drag is given by the coefficient Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle D} , determined by
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle D(v_{t-1}, \phi_t) = \begin{cases} -2.35 & \text{if } v_{t-1} < - 16.35 - 1.5 \cos(\phi_t),\\ -0.35 & \text{if } -16.35 - 1.5 \cos(\phi_t) \leq v_{t-1} \leq -0.35,\\ v_{t-1} & \text{if } -0.35 < v_{t-1} < 0.35,\\ 0.35 & \text{if } 0.35 \leq v_{t-1} \leq D_\text{cap} + 0.35 - 1.5 \cos(\phi_t),\\ 1.35 & \text{if } v_{t-1} > D_\text{cap} + 0.35 - 1.5 \cos(\phi_t). \end{cases} }
where Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle D_\text{cap}} is a soft velocity cap equal to 48 for long jumps and 32 otherwise.
In practice, these drag boundaries are far enough apart that the drag is often constant over large periods of time. In this case we can write Mario's position after frames as
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \begin{align} x_T &= x_0 + 10 \sum_{t=1}^{T} \sin(\phi_t),\\ z_T &= z_0 + v_0 T - D \sum_{t=1}^T t + 1.5 \sum_{t=1}^T \sum_{n=1}^t \cos(\phi_n). \end{align}}
Using Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \sum_{t=1}^T t = T(T+1)/2} , and by grouping terms of Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \cos(\phi_t)} , the latter can be simplified to
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle z_T = z_0 + v_0 T - \frac{DT(T+1)}{2} + 1.5 \sum_{t=1}^T (T+1-t)\cos(\phi_t). }
Notice that, since forward straining produces an acceleration that is not reset between frames, earlier frames have a stronger effect on the final Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle z} position than later frames. The effective strength is Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle 1.5(T+1-t)} , i.e. 1.5 multiplied by the number of frames remaining (including the current frame), since the forward velocity gained on one frame produces a displacement also on all remaining frames.
Arctan Straining Proof
The displacement vector after Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle T} frames is
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \mathbf{R} = (x_T - x_0)\mathbf{\hat{x}} + (z_T - z_0)\mathbf{\hat{z}}} ,
while the unit vector along the angle Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \omega} is
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \mathbf{\hat{n}} = \sin(\omega)\mathbf{\hat{x}} + \cos(\omega)\mathbf{\hat{z}}} .
The distance we move along a target angle Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \omega} over Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle T} frames is then
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle S = \mathbf{R} \cdot \mathbf{\hat{n}} = \langle S\rangle + \sum_{t=1}^T S_t, }
where
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \langle S \rangle = \left(v_0 T - \frac{DT(T+1)}{2}\right)\cos(\omega), }
is due to our initial velocity and drag, while
Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle S_t = 10\sin(\phi_t)\sin(\omega) + 1.5(T+1-t)\cos(\phi_t)\cos(\omega), }
is the effective contribution from straining on frame Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle t} . Thanks to this separation, we can maximize the total distance Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle S} by individually maximizing each contribution Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle S_t} as a function of Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle \phi_t} :
and finally we find
or, rotating the coordinate system back to allow for general facing angles ,
Since , this equation has two solutions for which are given above.
Iwerlipse Equations
By writing and in terms of , and using the optimal straining relation, we obtain exact expressions for the boundary of the Iwerlipse after frames:
where
and
.
We can restrict , with the four combinations of plus and minus signs giving the remaining quadrants. The Iwerlipse's half-width is , while its half-height is .
Approximations
If is large, the exact expressions involve large summation terms, so it may be useful to have approximate expressions that are easier to compute. By replacing the summations from to with an integral from to (essentially performing the midpoint rule of numerical integration in reverse), we obtain
with the notation . This approximation converges to the true result very quickly: even for , the RMS error (normalized by and ) is , while for it is less than . Similar expressions obtained using the Euler–Maclaurin formula converge more slowly, even with first-order correction terms.
A simpler but less accurate approximation is obtained by fitting the Iwerlipse to the generalized superellipse:
The optimal exponents and have been found up to (5 seconds), and can be obtained from a lookup table[1]. Unlike the integral approximation, this expression never converges to the exact result — there is always some small error.
Quarterstep Penalty
If quartersteps are lost on the final frame, the forward velocity gained on frame no longer accumulates forward distance over frames, but instead over frames. The optimal straining relation becomes:
The optimal straining angle for the final frame is not affected, since in this case the ellipse shrinks in both directions rather than just vertically, i.e. a factor cancels in the numerator and denominator.
History
Plush discovers that during a dive recover, one can gain greater distance along an angle different from Mario's facing angle by “flinging” the control stick through different angles during the trajectory, rather than holding it at a constant angle.
Pannenkoek qualitatively explains this phenomenon that would later be known as arctan straining:
I think you're supposed to hold forward-ish for most of it, then sideways at the end. Because sideways movement doesn't depend on your speed. So 5 frames of sideways holding at the start of the DR is equivalent to the 5 frames at the end. But forward distance depends on your hspeed. So let's say you start with some hspeed. If you go sideways then forwards, then you'll lose that hspeed. But if you go forward then sideways, then you'll take advantage of your starting hspeed. The best inputs would probably mix sideways and forwards somewhat.
— Pannenkoek2012
Peter Fedak shares the correct velocity update equations, and the three of them begin to consider what the mathematically optimal inputs are.
Iwer Sonsch independently rediscovers the velocity update equations and realises that by facing along the hypotenuse of the forward velocity and sideways speed — a trick known in other speedrunning communities as vectoring — he can gain greater distance in a single frame. He wonders how this would look over multiple frames, restarting the discussion of optimal straining. However, there is no quantitative progress until it becomes relevant to the A Button Challenge the following year.
The “Blast to the Stone Pillar” star in JRB is collected in 0 A presses for the first time, after Tyler Kehne figures out how to use conserved speed to get from the nearby pillar to the star platform.
The community turns their attention to whether the “Treasure of the Ocean Cave” star can be collected in a similar way, again reviving the optimal straining question, as people including Iwer, bad_boot, and DeRockProject begin attempting to make the most of the limited speed they have available.
Iwer states the optimal straining equation for the first time in the following form:
This is equivalent to our expression above, since , with, , and, . (If using this expression, we need to add 180° if the target angle is to the right of Mario, since only gives results between 0° and 180°.)
Pannenkoek posts an idea for collecting the “Scale the Mountain” star in TTM via a dive recover. To find out whether it was possible, Iwer, Grassdigger, Jane, bad_boot, and DeRockProject work to plot all of Mario’s possible positions while air straining.
Iwer discovers the exact equations describing Mario's possible positions after frames. Grassdigger and DeRockProject then show that the total shape can be well approximated by a generalised superellipse. Pannenkoek proposes calling it the Iwerlipse.
Silverstrawb provides an alternative proof[2] of the optimal straining relation by converting the discrete update equations into the continuous differential equations
and using the calculus of variations.
Krithalith independently rediscovers Iwer’s original proof and extends it to include quartersteps.
sm64expert adds arctan straining to MKDasher’s input direction LUA program, making it accessible to everyone for the first time.