Movement/zh: Difference between revisions

From DDraceNetwork
No edit summary
(Created page with "=== 斜角掠过 ===")
Line 66: Line 66:




<div lang="en" dir="ltr" class="mw-content-ltr">
<span id="Corner_Skimming"></span>
=== Corner Skimming ===
=== 斜角掠过 ===
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">

Revision as of 09:09, 28 July 2023

此條目仍需進行內容補充,您可以幫助我們編輯和修訂以擴充其內容。

基本移動是 Teeworlds 和 DDrace 的核心操作方式之一。


基礎信息

重力

處於默認重力下的玩家會在豎直方向 Y 軸每遊戲刻增加 0.5 的向下速度。


跳躍

地面跳躍將玩家的豎直速度設置為-13.2 單位。

空中跳躍(二段跳)將玩家的豎直速度設置為-12.0 單位。

跳躍是直接將玩家豎直速度設置為某個值,無視原有的速度。這個特性在用於取消原有的巨大速度時很有效。

待辦: Find the bps value or scaled coefficient for these values (same with the horizontal movement, these values are not in bps)


水平速度變化

  • 在鬆開所有按鍵的情況下:
    • 地面減速公式:每遊戲刻減半velocity.x = velocity.x * 0.5
    • 空中減速公式:每遊戲刻減少 5%velocity.x = velocity.x * 0.95
  • 按下速度相反的方向鍵:
    • 地面轉向公式:每遊戲刻減少 2 個單位,直到變成10個單位的反向速度。
    • 空中轉向公式:每遊戲刻減少 1.5 個單位,直到變成5個單位的反向速度。
  • 按住左或者右(默認為{keypress|A}{keypress|D})的情況下:
    • 地面加速公式:每遊戲刻增加 2 個單位,速度上限為 10。
    • 空中加速公式:每遊戲刻增加 1.5 個單位,速度上限為 5。


按住左右移動時會無視摩檫力,因此高速前進的時候摩擦減速可能比按住反方向移動鍵更多,因為按住按鍵減速是固定值,但是摩檫減速會因速度增加而增大,從而大於這個固定值。


進階特性

速度上限

Max speed: 6000 Sub-tiles/Tick (+speedup in one tick, e.g. gravity, jetpack, explosion).

src/game/gamecore.cpp (在利用速度計算玩家下一個位置前有如下代碼):

if(length(m_Vel) > 6000)
    m_Vel = normalize(m_Vel) * 6000;

其中內嵌了一個歸一化函數重新計算了速度帶來的影響,是豎直速度的瓶頸由來。而水平方向上則有一個ramp曲線因子,導致玩家在速度過快時減速或者停下。在加速時很容易看見這些現象。

速度的精度有每遊戲刻 個單位的向下捨入誤差。

理論上速度超過一定值後,ramp修正因子應該讓速度穩定到一個固定值。例如說想要保持最大速度為 1,在速度小於 1 時不作修正,而速度大於 1 的時候,比如說 50,則因子應該變為 1/50 ,這樣一來速度就不會超過 1。 但是這樣一來速度達到 257 的時候,修正因子理論上應該為 1/257,但是這個數值比單位刻度1/256要小,因此被捨入為 0,這導致實際上玩家水平速度過大時遊戲表現為停下不動。

待辦: * convert sub-tiles/tick into tiles/sec * find max vel und real max vel (from where would a constant function fit) * find speed, where the tee stops moving * write about ramp speed, and add diagram


斜角掠過

A tee is considered on the ground only due to its position and distance to the ground - it does not require the tee to have downwards velocity. So, it is possible for a tee to be "grounded" while traveling upwards, as long as the tee skims the corner of a tile.

Corner skimming:

  • allows a tee to refresh its double-jump (useful when skipping maps such as Impetuous).
  • can apply ground acceleration and max speed to a tee for a short amount of time (assuming the tee's horizontal midair speed is less than the maximum ground speed prior to corner skimming)


Corner skimming is not often intentionally used in map parts (except for maps such as Short and Precise 7), but can be used in short speedruns as small optimizations.

待辦: add gif

Elevated Jump

A ground jump can be performed even if the tee is a few subunits above the ground.