Nonrecursive Movement Formulas/ja

Since arithmetico-geometric sequences have explicit formulas, we can build non-recursive functions to calculate simple but useful results, such as the height of the player on any given tick, or the distance of a jump in terms of the initial speed and duration.

定義:


 * $v_0$ is the player's initial speed (speed on $$t_0$$, before jumping)
 * $t$ is the number of ticks considered (ex: t=12 on flat ground, see Jump Duration)
 * $J$ is the "jump bonus" (0.3274 for sprintjump, 0.291924 for strafed sprintjump, 0.1 for 45° no-sprint jump...)
 * $M$ is the movement multiplier after jumping (1.3 for 45° sprint, 1.274 for normal sprint, 1.0 for no-sprint 45°...)

Vertical Movement (jump) [1.8]
Vertical speed after jumping ($$t \geq 6$$)


 * $\textrm{V}_Y(t) = 4 \times 0.98^{t-5} - 3.92$

Relative height after jumping ($$t \geq 6$$)


 * $\textrm{Y}_{rel}(t) = \underset{\textrm{jump peak}}{\underbrace{197.4 - 217 \times 0.98^5}} + 200 (0.98-0.98^{t-4}) - 3.92 (t-5)$

For $t<6$, see below.

Vertical Movement (jump) [1.9+]
Vertical speed after jumping ($$t \geq 1$$)


 * $\textrm{V}_Y(t) = 0.42 \times 0.98^{t-1} + 4 \times 0.98^t - 3.92$

Relative height after jumping ($$t \geq 0$$)


 * $\textrm{Y}_{rel}(t) = 217 \times (1 - 0.98^t) - 3.92 t$

Horizontal Movement (instant jump)
Assuming the player was airborne before jumping.

Horizontal speed after sprintjumping ($$t \geq 2$$)


 * $\textrm{V}_H(v_0,t) = \frac{0.02 M}{0.09} + 0.6 \times 0.91^t \times \left ( v_0 + \frac{J}{0.91} - \frac{0.02 M}{0.6 \times 0.91 \times 0.09} \right )$

Sprintjump distance ($$t \geq 2$$)


 * $\textrm{Dist}(v_0,t) = 1.91 v_0 + J + \frac{0.02 M}{0.09} (t-2) + \frac{0.6 \times 0.91^2}{0.09} \times (1 - 0.91^{t-2}) \times \left ( v_0 + \frac{J}{0.91} - \frac{0.02 M}{0.6 \times 0.91 \times 0.09} \right )$

Note: These formulas are accurate for most values of $$v_0$$, but some negative values can wind up activating the speed threshold and reset the player's speed at some point, thus rendering these formulas inaccurate.

Horizontal Movement (delayed jump)
Assuming the player is on ground before jumping (at least 1 tick since landing).

Horizontal speed after sprintjumping ($$t \geq 2$$)


 * $\textrm{V}^*_H(v_0,t) = \frac{0.02 M}{0.09} + 0.6 \times 0.91^t \times \left ( 0.6 v_0 + \frac{J}{0.91} - \frac{0.02 M}{0.6 \times 0.91 \times 0.09} \right )$

Sprintjump distance ($$t \geq 2$$)


 * $\textrm{Dist}^*(v_0,t) = 1.546 v_0 + J + \frac{0.02 M}{0.09} (t-2) + \frac{0.6 \times 0.91^2}{0.09} \times (1 - 0.91^{t-2}) \times \left ( 0.6v_0 + \frac{J}{0.91} - \frac{0.02 M}{0.6 \times 0.91 \times 0.09} \right )$

Advanced Formulas
Horizontal speed after $$n$$ consecutive sprintjumps on a momentum of period $T$  ($$n \geq 0$$, $$T \geq 2$$).


 * $\textrm{V}^{\,n}_H(v_0,T,n) = \left ( 0.6 \times 0.91^T \right )^n v_0 + \left ( 0.6 \times 0.91^{T-1} J + 0.02M \frac{1 - 0.91^{T-1}}{0.09} \right ) \frac{1- (0.6 \times 0.91^T)^n}{1 - 0.6 \times 0.91^T} $

If the first sprintjump is delayed, multiply $v_0$ by 0.6