Horizontal Movement Formulas/zh: Difference between revisions

From Minecraft Parkour Wiki
Content added Content deleted
(Created page with "::<math>E_{t} = (\underset{每级缓慢减少 \; 15\%}{\underset{每级速度增加 \; 20\%}{\underbrace{\left ( 1 + 0.2\times 速度 \right ) \: \times\: \left ( 1 - 0.15\times 缓慢 \right )}}} \geq 0</math>")
No edit summary
 
(42 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
__NOTOC__
__NOTOC__
在每 tick,游戏会进行如下三个步骤:
在每一刻,游戏会进行如下三个步骤:


#将加速度加到玩家的速度中。
#将加速度加到玩家的速度中。
Line 11: Line 11:




<span id="Multipliers"></span>
== 乘数 ==
== 乘数 ==


Line 16: Line 17:




::<math>M_{t} = \begin{Bmatrix}1.3 & \textrm{疾跑} \\ 1.0 & \textrm{行走}\\ 0.3 & \textrm{潜行}\\ 0.0 & \textrm{停止} \end{Bmatrix} \times \begin{Bmatrix}0.98 & \textrm{正常}\\ 1.0 & \textrm{45°斜跑} \\ 0.98 \sqrt{2} & \textrm{45°潜行} \end{Bmatrix}</math>
::<math>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}</math>




Line 22: Line 23:




::<math>E_{t} = (\underset{每级缓慢减少 \; 15\%}{\underset{每级速度增加 \; 20\%}{\underbrace{\left ( 1 + 0.2\times 速度 \right ) \: \times\: \left ( 1 - 0.15\times 缓慢 \right )}}} \geq 0</math>
::<math>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</math>




Line 28: Line 29:




::<math>S_{t} = \begin{Bmatrix}0.6 & \textrm{正常}\\ 0.8 & \textrm{史莱姆}\\ 0.98& \textrm{冰} \\ 1.0 & \textrm{空中} \end{Bmatrix}</math>
::<math>S_{t} = \begin{Bmatrix}0.6 & \text{正 常}\\ 0.8 & \text{史 姆}\\ 0.98& \text{冰} \\ 1.0 & \text{空 中} \end{Bmatrix}</math>
:
:


<br />
<br />


<span id="Linear_Formulas"></span>
== 线性运动公式 ==
== 直线运动公式 ==


这些简化的公式只适用于直线运动(方向不变)。
<div lang="en" dir="ltr" class="mw-content-ltr">
尽管这个条件似乎很有限制性,但这些公式对分析常规的跳跃和助跑非常有用。
These simplified formulas only apply to linear movement (no change in direction).
之后我们将通过引入角度来扩展这些公式。
While this condition might seem very restrictive, these formulas are very useful to analyze conventional jumps and momentum
:<br />'''定义''':
We'll later expand on these formulas by including angles.
:*<math>V_{H,0}</math> 是玩家的初始速度(正常 = 0)。
:<br />'''Definition''':
:*<math display="inline">V_{H,t}</math> 是玩家在第 <math display="inline">t</math> 刻的速度。
:*<math>V_{H,0}</math> is the player's initial speed (default = 0).
:*<math display="inline">V_{H,t}</math> is the player's speed on tick <math display="inline">t</math>.
</div>




:'''地面速度''':
<div lang="en" dir="ltr" class="mw-content-ltr">
:'''Ground Speed''':
</div>


::<math>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}}} </math>
<div lang="en" dir="ltr" class="mw-content-ltr">
::<math>V_{H,t} = \underset{Momentum}{\underbrace{\underset{ }{V_{H,t-1} \times S_{t-1} \times 0.91 }}} \: + \: \underset{Acceleration}{\underbrace{0.1 \times M_{t} \times E_{t} \times \left (\frac{0.6}{S_{t}} \right )^{3}}} </math>
</div>




:'''跳跃速度''':
<div lang="en" dir="ltr" class="mw-content-ltr">
:'''Jump Speed''':
</div>


::<math>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} }}</math>
<div lang="en" dir="ltr" class="mw-content-ltr">
::<math>V_{H,t} = \underset{Momentum}{\underbrace{\underset{ }{V_{H,t-1} \times S_{t-1} \times 0.91 }}} \: + \: \underset{Acceleration}{\underbrace{0.1 \times M_{t} \times E_{t} \times \left (\frac{0.6}{S_{t}} \right )^{3}}} + \underset{Sprintjump \; Boost}{\underbrace{\begin{Bmatrix}0.2 & \textrm{Sprinting}\\ 0.0 & \textrm{Else}\end{Bmatrix} }}</math>
</div>




:'''空中速度''':
<div lang="en" dir="ltr" class="mw-content-ltr">
:'''Air Speed''':
</div>


::<math>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}}}} </math>
<div lang="en" dir="ltr" class="mw-content-ltr">
::<math>V_{H,t} = \underset{Momentum}{\underbrace{\underset{ }{V_{H,t-1} \times S_{t-1} \times 0.91 }}} \: + \: \underset{Acceleration}{\underbrace{\underset{ }{0.02 \times M_{t}}}} </math>
</div>






<span id="Complete_Formulas"></span>
<div lang="en" dir="ltr" class="mw-content-ltr">
== 完整公式 ==
==Complete Formulas==
</div>


让我们引入两个新变量:
<div lang="en" dir="ltr" class="mw-content-ltr">
:*<math display="inline"> D_{t} </math>,玩家的方向,以度为单位(由玩家按键与旋转角度决定)
Let's introduce two more variables:
:*<math display="inline"> D_{t} </math> , The player's Direction in degrees (defined by their inputs and rotation)
:*<math display="inline"> F_{t} </math>,玩家的朝向,以度为单位(仅由玩家旋转角度决定)
:*<math display="inline"> F_{t} </math> , The player's Facing in degrees (defined by their rotation only)
</div>




实际上,角度并不那样简单,因为有效角的数量是有限的(参见[[Special:MyLanguage/Facing and Angles|朝向与角度]])。
<div lang="en" dir="ltr" class="mw-content-ltr">
In reality, angles aren't as simple as that, as there are a limited number of significant angles (see [[Special:MyLanguage/Facing and Angles|Facing and Angles]]).
</div>


为了简单起见,我们将忽略这一事实。
<div lang="en" dir="ltr" class="mw-content-ltr">
For the purpose of simplicity, we'll ignore this fact.
</div>




:'''定义''':
<div lang="en" dir="ltr" class="mw-content-ltr">
:*<math display="inline">V_{X,0}</math> 与 <math display="inline">V_{Z,0}</math> 对应玩家的初始速度。
:'''Definition''':
:*<math display="inline">V_{X,0}</math> and <math display="inline">V_{Z,0}</math> correspond to the player's initial velocity.
:*<math display="inline">V_{X,t}</math> <math display="inline">V_{Z,t}</math> 对应玩家在第<math display="inline">t</math>刻的速度。<br /> <br />
:'''地面速度''':
:*<math display="inline">V_{X,t}</math> and <math display="inline">V_{Z,t}</math> correspond to the player's velocity on tick <math display="inline">t</math> <br /> <br />
:'''Ground Velocity''':
</div>


::<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>
<div lang="en" dir="ltr" class="mw-content-ltr">
::<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{Momentum}{\underbrace{\underset{ }{V\displaystyle _{Z,t-1} \times S_{t-1} \times 0.91 }}} \: + \: \underset{Acceleration}{\underbrace{0.1 \times M_{t} \times E_{t} \times \left (\frac{0.6}{S_{t}} \right )^{3}}} \times \cos (D_{t}) </math>
</div>


:'''跳跃速度''':
<div lang="en" dir="ltr" class="mw-content-ltr">
:'''Jump Velocity''':
</div>


::<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}) + \begin{Bmatrix} 0.2 & \text{疾 跑}\\ 0.0 & \text{其 它}\end{Bmatrix} \times \sin (F_{t}) </math>
<div lang="en" dir="ltr" class="mw-content-ltr">
::<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}) + \begin{Bmatrix} 0.2 & \textrm{Sprinting}\\ 0.0 & \textrm{Else}\end{Bmatrix} \times \sin (F_{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}) + \underset{\text{疾 跑 跳 跃 加 成}}{\underbrace{\begin{Bmatrix} 0.2 & \text{疾 跑}\\ 0.0 & \text{其 它}\end{Bmatrix} \times \cos (F_{t})}} </math>
::<math>V\displaystyle _{Z,t} = \underset{Momentum}{\underbrace{\underset{ }{V\displaystyle _{Z,t-1} \times S_{t-1} \times 0.91 }}} \: + \: \underset{Acceleration}{\underbrace{0.1 \times M_{t} \times E_{t} \times \left (\frac{0.6}{S_{t}} \right )^{3}}} \times \cos (D_{t}) + \underset{Sprintjump \; Boost }{\underbrace{\begin{Bmatrix} 0.2 & \textrm{Sprinting}\\ 0.0 & \textrm{Else}\end{Bmatrix} \times \cos (F_{t})}} </math>
</div>


:'''空中速度''':
<div lang="en" dir="ltr" class="mw-content-ltr">
:'''Air Velocity''':
</div>


::<math>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}) </math>
<div lang="en" dir="ltr" class="mw-content-ltr">
::<math>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}) </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{\underset{}{0.02 \times M_{t}}}} \times \cos (D_{t}) </math>
::<math>V\displaystyle _{Z,t} = \underset{Momentum}{\underbrace{\underset{ }{V\displaystyle _{Z,t-1} \times S_{t-1} \times 0.91 }}} \: + \: \underset{Acceleration}{\underbrace{\underset{}{0.02 \times M_{t}}}} \times \cos (D_{t}) </math>
</div>




<span id="Stopping_Conditions"></span>
<div lang="en" dir="ltr" class="mw-content-ltr">
== 运动停止条件 ==
==Stopping Conditions==
</div>


如果玩家撞到墙壁,或者速度小到被认为可以忽略不计,那么水平速度就会被设置为 0。
<div lang="en" dir="ltr" class="mw-content-ltr">
Horizontal speed is set to 0 if the player hits a wall, or if the speed is considered to be negligible.
</div>




:'''墙壁碰撞''':
<div lang="en" dir="ltr" class="mw-content-ltr">
:'''Wall Collision''':
</div>


::如果玩家撞到 X 轴朝向的墙壁,则助跑部分被取消,<math display="inline">V\displaystyle _{X,t}</math> 仅保留加速度部分。
<div lang="en" dir="ltr" class="mw-content-ltr">
::If the player hits a X-facing wall, then momentum is cancelled and <math display="inline">V\displaystyle _{X,t}</math> only includes acceleration.
::如果玩家撞到 Z 轴朝向的墙壁,则助跑部分被取消,<math display="inline">V\displaystyle _{Z,t}</math> 仅保留加速度部分。
::在这两种情况下,玩家都会停止疾跑。
::If the player hits a Z-facing wall, then momentum is cancelled and <math display="inline">V\displaystyle _{Z,t}</math> only includes acceleration.
::In either of these case, the player stops sprinting.
</div>






:'''可忽略速度阈值''':
<div lang="en" dir="ltr" class="mw-content-ltr">
:'''Negligible Speed Threshold''':
</div>


::如果 <math display="inline"> \left | V\displaystyle _{X,t-1} \times S_{t} \times 0.91 \right | < 0.005 </math>,助跑部分被取消,仅保留加速度部分。
<div lang="en" dir="ltr" class="mw-content-ltr">
::If <math display="inline"> \left | V\displaystyle _{X,t} \times S_{t} \times 0.91 \right | < 0.005 </math> , momentum is cancelled and only the acceleration is left.
::如果 <math display="inline"> \left | V\displaystyle _{Z,t-1} \times S_{t} \times 0.91 \right | < 0.005 </math>,助跑部分被取消,仅保留加速度部分。
::If <math display="inline"> \left | V\displaystyle _{Z,t} \times S_{t} \times 0.91 \right | < 0.005 </math> , momentum is cancelled and only the acceleration is left.
</div>


::在 1.9+,阈值被调整到 0.003。
<div lang="en" dir="ltr" class="mw-content-ltr">
::In 1.9+, they are compared to 0.003 instead.
</div>






<span id="Source_Code"></span>
<div lang="en" dir="ltr" class="mw-content-ltr">
==Source Code==
== 源代码 ==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
[...]
[...]
</div>

Latest revision as of 12:32, 9 January 2024

Other languages:

在每一刻,游戏会进行如下三个步骤:

  1. 将加速度加到玩家的速度中。
  2. 移动玩家(新的位置 = 原位置 + 速度)。
  3. 降低玩家的速度以模拟阻力。

我们将从介绍各种乘数开始,尽力使公式可读性更强。


乘数

移动乘数(参见 45°斜跑



效果乘数(参见状态效果



滑度乘数(参见滑度



直线运动公式

这些简化的公式只适用于直线运动(方向不变)。 尽管这个条件似乎很有限制性,但这些公式对分析常规的跳跃和助跑非常有用。 之后我们将通过引入角度来扩展这些公式。


定义
  • 是玩家的初始速度(正常 = 0)。
  • 是玩家在第 刻的速度。


地面速度


跳跃速度


空中速度


完整公式

让我们引入两个新变量:

  • ,玩家的方向,以度为单位(由玩家按键与旋转角度决定)
  • ,玩家的朝向,以度为单位(仅由玩家旋转角度决定)


实际上,角度并不那样简单,因为有效角的数量是有限的(参见朝向与角度)。

为了简单起见,我们将忽略这一事实。


定义
  • 对应玩家的初始速度。
  • 对应玩家在第刻的速度。

地面速度
跳跃速度
空中速度


运动停止条件

如果玩家撞到墙壁,或者速度小到被认为可以忽略不计,那么水平速度就会被设置为 0。


墙壁碰撞
如果玩家撞到 X 轴朝向的墙壁,则助跑部分被取消, 仅保留加速度部分。
如果玩家撞到 Z 轴朝向的墙壁,则助跑部分被取消, 仅保留加速度部分。
在这两种情况下,玩家都会停止疾跑。


可忽略速度阈值
如果 ,助跑部分被取消,仅保留加速度部分。
如果 ,助跑部分被取消,仅保留加速度部分。
在 1.9+,阈值被调整到 0.003。


源代码

[...]