Рух

From DDraceNetwork
Revision as of 18:05, 27 August 2023 by Jurai! (talk | contribs) (Created page with "Максимальна швидкість: 6000 субтілов/тик (+прискорення за один тік, наприклад, гравітація, реактивний ранець, вибух).")
Ця сторінка є заготовлею. Ви можете допомогти нам, покращивши її.

Рух - один із основних аспектів Teeworlds і DDrace.


Основи

Гравітація

Кожний тік до швидкості y (вниз) додається прискорення 0,5, викликане гравітацією.


Стрибки

Стрибки на землю встановлюють швидкість y тии на -13,2, збільшену на значення.

Стрибок у повітря (подвійний стрибок) встановлює швидкість y тройника на -12,0, збільшену на значення.

Стрибок "встановлює" швидкість y, скасовуючи будь-яку попередню швидкість вгору або вниз. Це дуже корисно в сценаріях, де потрібно зупинити великий вертикальний імпульс.

TODO: 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.
    • Повітря: Кожний тік velocity.x = velocity.x * 0.95.

Натискання клавіші у протилежному напрямку:

    • Земля: Кожний такт горизонтальна швидкість зменшується на 2, поки не досягне 10 в протилежному напрямку.
    • Повітря: Кожний тік горизонтальна швидкість зменшується на 1,5 до досягнення 5 в протилежному напрямку.

Збільшення горизонтальної швидкості при натисканні a або d:

    • Земля: Кожний тік горизонтальна швидкість збільшується на 2, поки не досягне 10.
    • Повітря: Кожний тік горизонтальна швидкість збільшується на 1,5, поки не досягне 5.


Тріння ігнорується при утриманні натиснутою клавіші. Таким чином, при великих швидкостях натискання ні на що не сповільнить гравця швидше, ніж рух у протилежному напрямку, оскільки тріння буде мати експоненціальне сповільнення порівняно з лінійним сповільненням a/d.


Додатково

Максимальна швидкість

Максимальна швидкість: 6000 субтілов/тик (+прискорення за один тік, наприклад, гравітація, реактивний ранець, вибух).

src/game/gamecore.cpp (before calculating new position from velocity):
if(length(m_Vel) > 6000)
    m_Vel = normalize(m_Vel) * 6000;
This is the bottleneck in vertical movement. In horizontal movement a “ramp”-Value is multiplied to the horizontal speed. Causing the tee to slow down and stop when getting too fast. This is most commonly observed in speed ups.

The speed is rounded down to a precision of every tick. This is causing the tee to stop moving horizontal when having too much speed.

TODO: * 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


Corner Skimming

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.

TODO: add gif

Elevated Jump

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