From Minecraft Parkour Wiki
Content added Content deleted
|
|
Line 81: |
Line 81: |
|
|
|
|
|
::<math>V\displaystyle _{X,t} = \underset{ }{V\displaystyle _{X,t-1} \times S_{t-1} \times 0.91 } ~ + ~ 0.1 \times M_{t} \times E_{t} \times \left (\frac{0.6}{S_{t}} \right )^{3} \times \sin (D_{t}) </math> |
|
::<math>V\displaystyle _{X,t} = \underset{ }{V\displaystyle _{X,t-1} \times S_{t-1} \times 0.91 } ~ + ~ 0.1 \times M_{t} \times E_{t} \times \left (\frac{0.6}{S_{t}} \right )^{3} \times \sin (D_{t}) </math> |
|
::<math>V\displaystyle _{Z,t} = \underset{\text{助 跑}}{\underbrace{\underset{ }{V\displaystyle _{Z,t-1} \times S_{t-1} \times 0.91 }}} ~ + ~ \underset{\text{加 速 度}}{\underbrace{0.1 \times M_{t} \times E_{t} \times \left (\frac{0.6}{S_{t}} \right )^{3}}} \times \cos (D_{t}) </math> |
|
::<math>V\displaystyle _{Z,t} = \underset{\text{助 跑}}{\underbrace{\underset{ }{V\displaystyle _{Z,t-1} \times S_{t-1} \times 0.91 }}} ~ + ~ \underset{\text{加 速 度}}{\underbrace{0.1 \times M_{t} \times E_{t} \times \left (\frac{0.6}{S_{t}} \right )^{3}}} \times \cos (D_{t}) </math> |
|
|
|
|
|
:'''跳跃速度''': |
|
:'''跳跃速度''': |
Revision as of 12:24, 9 January 2024
在每一刻,游戏会进行如下三个步骤:
- 将加速度加到玩家的速度中。
- 移动玩家(新的位置 = 原位置 + 速度)。
- 降低玩家的速度以模拟阻力。
我们将从介绍各种乘数开始,尽力使公式可读性更强。
乘数
- 移动乘数(参见 45°斜跑)
![{\displaystyle M_{t}={\begin{Bmatrix}1.3&{\text{疾 跑}}\\1.0&{\text{行 走}}\\0.3&{\text{潜 行}}\\0.0&{\text{停 止}}\end{Bmatrix}}\times {\begin{Bmatrix}0.98&{\text{正 常}}\\1.0&45^{\circ }~{\text{斜 跑}}\\0.98{\sqrt {2}}&45^{\circ }~{\text{潜 行}}\end{Bmatrix}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/16284f75c91fab777c3e6bdf7d29b08cbba94f64)
- 效果乘数(参见状态效果)
![{\displaystyle E_{t}={\underset {{\text{每 级 缓 慢 减 少}}~15\%}{\underset {{\text{每 级 速 度 增 加}}~20\%}{\underbrace {\left(1+0.2\times {\text{速 度}}\right)~\times ~\left(1-0.15\times {\text{缓 慢}}\right)} }}}\geq 0}](https://wikimedia.org/api/rest_v1/media/math/render/svg/dfbd99c8b437c73cd8e829a273b434f9a70928f1)
- 滑度乘数(参见滑度)
![{\displaystyle S_{t}={\begin{Bmatrix}0.6&{\text{正 常}}\\0.8&{\text{史 莱 姆}}\\0.98&{\text{冰}}\\1.0&{\text{空 中}}\end{Bmatrix}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c3520979238ca9704df82bf80c767a4f2635ac4c)
直线运动公式
这些简化的公式只适用于直线运动(方向不变)。
尽管这个条件似乎很有限制性,但这些公式对分析常规的跳跃和助跑非常有用。
之后我们将通过引入角度来扩展这些公式。
定义:
是玩家的初始速度(正常 = 0)。
是玩家在第
刻的速度。
- 地面速度:
![{\displaystyle V_{H,t}={\underset {\text{助 跑}}{\underbrace {\underset {}{V_{H,t-1}\times S_{t-1}\times 0.91}} }}~+~{\underset {\text{加 速 度}}{\underbrace {0.1\times M_{t}\times E_{t}\times \left({\frac {0.6}{S_{t}}}\right)^{3}} }}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3678740d5853e622464c38b37db48fd1afcca80c)
- 跳跃速度:
- Failed to parse (unknown function "\begin{Bmatrix}"): {\displaystyle V_{H,t} = \underset{\text{助 跑}}{\underbrace{\underset{ }{V_{H,t-1} \times S_{t-1} \times 0.91 }}} ~ + ~ \underset{\text{加 速 度}}{\underbrace{0.1 \times M_{t} \times E_{t} \times \left (\frac{0.6}{S_{t}} \right )^{3}}} + \underset{\text{疾 跑 跳 跃 加 成}}{\underbrace{\begin{Bmatrix}0.2 & \text{疾 跑}\\ 0.0 & \text{其 它}\end{Bmatrix} }}}
- 空中速度:
![{\displaystyle V_{H,t}={\underset {\text{助 跑}}{\underbrace {\underset {}{V_{H,t-1}\times S_{t-1}\times 0.91}} }}~+~{\underset {\text{加 速 度}}{\underbrace {\underset {}{0.02\times M_{t}}} }}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ad73c902f693c11027028dfbd4a43904f5cfd76d)
完整公式
让我们引入两个新变量:
,玩家的方向,以度为单位(由玩家按键与旋转角度决定)
,玩家的朝向,以度为单位(仅由玩家旋转角度决定)
实际上,角度并不那样简单,因为有效角的数量是有限的(参见朝向与角度)。
为了简单起见,我们将忽略这一事实。
- 定义:
与
对应玩家的初始速度。
与
对应玩家在第
刻的速度。
- 地面速度:
![{\displaystyle V\displaystyle _{X,t}={\underset {}{V\displaystyle _{X,t-1}\times S_{t-1}\times 0.91}}~+~0.1\times M_{t}\times E_{t}\times \left({\frac {0.6}{S_{t}}}\right)^{3}\times \sin(D_{t})}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3b35f76434f51e971ce5c00233017b403f08808c)
![{\displaystyle V\displaystyle _{Z,t}={\underset {\text{助 跑}}{\underbrace {\underset {}{V\displaystyle _{Z,t-1}\times S_{t-1}\times 0.91}} }}~+~{\underset {\text{加 速 度}}{\underbrace {0.1\times M_{t}\times E_{t}\times \left({\frac {0.6}{S_{t}}}\right)^{3}} }}\times \cos(D_{t})}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7e94ed930c14ce60d05b3d7bd9c64e2329de3097)
- 跳跃速度:
![{\displaystyle V\displaystyle _{X,t}={\underset {}{V\displaystyle _{X,t-1}\times S_{t-1}\times 0.91}}~+~0.1\times M_{t}\times E_{t}\times \left({\frac {0.6}{S_{t}}}\right)^{3}\times \sin(D_{t})+{\begin{Bmatrix}0.2&{\text{疾 跑}}\\0.0&{\text{其 它}}\end{Bmatrix}}\times \sin(F_{t})}](https://wikimedia.org/api/rest_v1/media/math/render/svg/66b0ecb73c791ae5b0b524666ebaf5d2083ef099)
![{\displaystyle V\displaystyle _{Z,t}={\underset {\text{助 跑}}{\underbrace {\underset {}{V\displaystyle _{Z,t-1}\times S_{t-1}\times 0.91}} }}~+~{\underset {\text{加 速 度}}{\underbrace {0.1\times M_{t}\times E_{t}\times \left({\frac {0.6}{S_{t}}}\right)^{3}} }}\times \cos(D_{t})+{\underset {\text{疾 跑 跳 跃 加 成}}{\underbrace {{\begin{Bmatrix}0.2&{\text{疾 跑}}\\0.0&{\text{其 它}}\end{Bmatrix}}\times \cos(F_{t})} }}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/8e2050deb7c4efe9bf778e03199eac1c86289ade)
- 空中速度:
![{\displaystyle V\displaystyle _{X,t}={\underset {}{V\displaystyle _{X,t-1}\times S_{t-1}\times 0.91}}~+~0.02\times M_{t}\times \sin(D_{t})}](https://wikimedia.org/api/rest_v1/media/math/render/svg/cd4b64e4b086100e7cc0a9d65bdc7cf37b7ef6dd)
![{\displaystyle V\displaystyle _{Z,t}={\underset {\text{助 跑}}{\underbrace {\underset {}{V\displaystyle _{Z,t-1}\times S_{t-1}\times 0.91}} }}~+~{\underset {\text{加 速 度}}{\underbrace {\underset {}{0.02\times M_{t}}} }}\times \cos(D_{t})}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0effb2f49a06cd3b2fd75119d6a521901145ac56)
运动停止条件
如果玩家撞到墙壁,或者速度小到被认为可以忽略不计,那么水平速度就会被设置为 0。
- 墙壁碰撞:
- 如果玩家撞到 X 轴朝向的墙壁,则助跑部分被取消,
仅保留加速度部分。
- 如果玩家撞到 Z 轴朝向的墙壁,则助跑部分被取消,
仅保留加速度部分。
- 在这两种情况下,玩家都会停止疾跑。
- 可忽略速度阈值:
- 如果
,助跑部分被取消,仅保留加速度部分。
- 如果
,助跑部分被取消,仅保留加速度部分。
- 在 1.9+,阈值被调整到 0.003。
源代码
[...]