Jumping

From ZDoom Wiki
Jump to navigation Jump to search
DoomWiki.org
For more information on this article, visit the Jumping page on the Doom Wiki.

Jumping is not present in vanilla Doom and Heretic, but implemented in Hexen and Strife. Jumping can be selectively enabled or disabled through MAPINFO map definitions and through the gameplay options menu. The console variables sv_allowjump and sv_nojump govern whether jumping is possible, possible if not disallowed by the map, or impossible.

Jumping height

Jumping works by giving the player an upward vertical velocity amount equals to their Player.JumpZ value. Each tic, the player will be moved upward by that velocity, then the velocity is decreased by the gravity factor (by default, 1). The player will keep raising as long as their upward velocity isn't decreased to 0 or less by gravity, and as long as they do not collide with an obstacle, such as the ceiling or a flying enemy. Jumping does not prevent climbing up to the player's MaxStepHeight (24 by default for most games, except Strife where it is 16), so a jump height of 36 and a step height of 24 mean that a player can climb over an obstacle up to 60 units tall.

On the following table, the default gravity and the default player jump speed for (9 for Hexen, 8 for the other games) are highlighted. Other values are provided for illustration.

Jump height by speed and gravity factor
JumpZ 0.1 0.5 1 2 3 5 10
0 0 0 0 0 0 0 0
1 5.5 1.5 1 1 1 1 1
2 21 5 3 2 2 2 2
3 46.5 10.5 6 4 3 3 3
4 82 18 10 6 5 4 4
5 127.5 27.5 15 9 7 5 5
6 183 39 21 12 9 7 6
7 248.5 52.5 28 16 12 9 7
8 324 68 36 20 15 11 8
9 409.5 85.5 45 25 18 13 9
10 505 105 55 30 22 15 10
11 610.5 126.5 66 36 26 18 12
12 726 150 78 42 30 21 14
13 851.5 175.5 91 49 35 24 16
14 987 203 105 56 40 27 18
15 1132.5 232.5 120 64 45 30 20
16 1288 264 136 72 51 34 22
17 1453.5 297,5 153 81 57 38 24
18 1629 333 171 90 63 42 26
19 1814.5 370,5 190 100 70 46 28
20 2010 410 210 110 77 50 30
21 2215.5 451.5 231 121 84 55 33
22 2431 495 253 132 92 60 36
23 2656.5 540.5 276 144 100 65 39
24 2892 588 300 156 108 70 42

On a flat area (landing sector has the same height as jumping sector), with constant gravity, and if the jump isn't obstructed by collision with an obstacle, the player's landing speed should be approximately the same as the jump speed. (Not exactly the same, because if the player reaches a vertical velocity of exactly 0 at the jump's apex, which may not happen depending on the gravity factor, the downward velocity from gravity will be doubled for that tic.) This means that a high jumping speed can potentially result in falling damage. This can also happen if during the jump the player moves in a sector with a lower floor height, or a stronger gravity factor.