The code behind Quake's movement tricks explained (bunny-hopping, wall-running, and zig-zagging)

Matt's Ramblings
10 Jan 202107:45

Summary

TLDRThis video explores the evolution of player movement techniques in the Quake game series, highlighting three key techniques: zigzagging, wall running, and bunny hopping. These techniques, all stemming from a single piece of code, revolutionized gameplay and influenced the genre. The script delves into the mechanics, explains how players exploit the velocity update rule for speed boosts, and showcases advanced strategies used in tool-assisted speedruns for maximum efficiency.

Takeaways

  • đŸ˜Č Quake's player movement techniques have evolved significantly over the years, impacting the way the game is played.
  • 🔄 The earliest trick, zigzagging, involves rapid alternation of strafe keys while moving forward to gain speed.
  • đŸƒâ€â™‚ïž Wall running is performed by strafing into a wall while running parallel to it, another technique for boosting speed.
  • 🐰 Bunny hopping or strafe jumping is a technique that has evolved and is used to maintain speed during gameplay.
  • 🌐 All three movement techniques originate from the same piece of code, showcasing the game's influence on the genre.
  • 🔑 The 'wishder' is a key concept, representing the player's intended movement direction, formed by combining forward and side vectors.
  • 🔄 The player's velocity in the horizontal plane is updated based on the wishder, with vertical velocity calculated through a gravity model.
  • 🔧 A loophole in the velocity calculation allows manipulation of the current speed, leading to the development of speed techniques.
  • 📉 Friction affects speed, with different handling on the ground versus in the air, influencing how speed techniques are executed.
  • đŸ› ïž Tool-assisted speedruns exploit these mechanics further, using scripting for inputs to achieve record times unattainable by human players.
  • đŸ‘šâ€đŸ’» The video explains the original Quake source code and how it gives rise to these movement techniques, with references for further reading.

Q & A

  • How have player movement techniques in Quake evolved over the years?

    -Player movement techniques in Quake have evolved from simple tricks to elaborate routines, including zigzagging, wall running, and bunny hopping or strafe jumping, which have significantly changed the gameplay.

  • What is zigzagging in the context of Quake?

    -Zigzagging is an early trick in Quake where a player rapidly alternates the strafe keys while running forward to gain a speed boost.

  • What is wall running and how is it performed in Quake?

    -Wall running is performed by strafing into a wall while running parallel to it, allowing the player to maintain a constant wish-to-velocity angle and gain a speed boost.

  • What is bunny hopping or strafe jumping, and how has it evolved?

    -Bunny hopping or strafe jumping is a technique that involves holding a strafe key and turning the mouse to stay in an acceleration zone, and it has evolved to maximize speed in Quake.

  • How is the player's intended movement direction represented in Quake?

    -The player's intended movement direction is represented by a 'wishder', which is formed by adding a scaled forward vector to a scaled side vector and normalizing the result.

  • What is the role of the wishter in updating the player's velocity in Quake?

    -The wishter is used to update the player's velocity in the horizontal plane, while the vertical velocity is calculated according to a simple gravity model.

  • How does the velocity update function work when the player is on the ground in Quake?

    -When on the ground, the velocity update applies friction to scale the speed, and then updates the velocity by adding the wish scaled by an 'add speed' factor, which depends on the current speed and the maximum intended speed.

  • What loophole in the velocity calculation allows for speed manipulation in Quake?

    -The loophole lies in taking the current speed as the scalar projection of the velocity onto the wishter, rather than the length of the velocity vector, allowing players to manipulate the wishter relative to the velocity to make the current speed as large or small as desired.

  • How does zigzagging exploit the velocity update rule to increase speed in Quake?

    -Zigzagging gains speed by changing the strafe direction against the current movement direction, causing the velocity to move towards the wishter and then switching strafe direction to repeat the process.

  • What is the significance of the wish-to-velocity angle in strafe jumping?

    -In strafe jumping, the wish-to-velocity angle is kept close to 90 degrees by holding a strafe key and turning the mouse to stay in the zone of acceleration, allowing for continuous speed increase.

  • How does tool-assisted speedrunning in Quake differ from human speedrunning?

    -Tool-assisted speedrunning uses scripting of inputs to overcome human reaction and dexterity limitations, allowing for continuous selection of the wishter and alternate direction on every frame for maximum speed increase.

Outlines

00:00

🎼 Evolution of Player Movement in Quake

This paragraph discusses the evolution of player movement techniques in the game Quake, from simple tricks to complex routines that have transformed gameplay. It introduces three key movement techniques: zigzagging, wall running, and bunny hopping or strafe jumping. These techniques provide speed boosts and originate from the same piece of code, which has influenced many other first-person shooter games. The script explains the player physics logic, starting with the conversion of key presses and mouse movements into a 'wish der', which is used to update the player's velocity in the horizontal plane. The vertical velocity is calculated using a gravity model. The paragraph also delves into the mechanics of speed manipulation through the loophole in the velocity calculation, which is central to executing advanced movement techniques.

05:00

🔧 Exploiting Velocity Mechanics in Quake

The second paragraph delves deeper into how players exploit the velocity mechanics in Quake to achieve high-speed movement. It explains how techniques like zigzagging, strafe jumping, and wall running are executed, with a focus on the importance of the wish-to-velocity angle. The paragraph provides a detailed analysis of how these techniques are applied in the game, including the use of mouse movements and key presses to manipulate the wish der relative to the velocity for speed gains. It also touches on the use of tool-assisted speedruns, where scripting inputs allow for continuous selection of the wishter and maximize speed increases, resulting in record-breaking completion times. The video script concludes with an invitation for viewers to like, subscribe, and comment with any questions they may have.

Mindmap

Keywords

💡Zigzagging

Zigzagging is a movement technique in the game Quake where players rapidly alternate the strafe keys while running forward. It is one of the earliest tricks discovered and contributes to the speed boost in gameplay. As mentioned in the script, it involves changing the strafe direction against the current movement direction, causing the velocity to move towards the wish direction and pushing the player into a zone of deceleration, which is then followed by a strafe direction change to continue the speed gain cycle.

💡Wall Running

Wall Running is another movement technique in Quake where players strafe into a wall while running parallel to it. This technique allows players to maintain a constant wish to velocity angle by moving into the wall at a steady angle, providing a speed boost. The script explains that collisions with walls are handled by clipping the velocity to be parallel to the wall, which is crucial for the successful execution of wall running.

💡Bunny Hopping

Bunny Hopping, also known as strafe jumping, is a technique that has evolved over the history of Quake. It involves a series of jumps that minimize the time spent on the ground, thus reducing the impact of friction on the player's speed. The script describes how this technique is performed by holding a strafe key while turning the mouse to maintain the wish to velocity angle close to 90 degrees, which is essential for continuous acceleration.

💡Wish Vector

The wish vector, or wish direction, is a concept in Quake's player physics logic that represents the player's intended movement direction. It is formed by adding a scaled forward vector to a scaled side vector and then normalizing the result. The wish vector is crucial for updating the player's velocity in the horizontal plane, as it is used to calculate the speed changes during movement techniques like zigzagging and bunny hopping.

💡Velocity Update

Velocity update refers to the process of adjusting a player's speed in Quake based on their current movement and the wish vector. The script explains that when on the ground, velocity is updated by applying friction and then adding the wish vector scaled by a factor known as add speed. This process is key to understanding how movement techniques can exploit the game's physics to achieve higher speeds.

💡Strafe Jumping

Strafe Jumping is a technique that involves changing the view angle while holding forward and strafe keys to maintain the wish velocity angle in a 'sweet spot' for continuous acceleration. The script illustrates this by describing how players perform a pre-strafe or circle jump to gain initial speed before transitioning to the inner part of the jump, where the wish vector is manipulated to keep the player in a zone of acceleration.

💡Friction

Friction in the context of Quake's player movement is a force that opposes the player's speed, causing deceleration. The script mentions that when on the ground, friction is applied during the velocity update process, which affects how quickly a player can gain or lose speed. Minimizing the time spent on the ground is a strategy to reduce the impact of friction.

💡Acceleration Zone

The acceleration zone refers to the angle between the wish vector and the velocity where the player can gain speed. The script explains that to stay in this zone while strafe jumping, players must keep the wish to velocity angle close to 90 degrees, allowing for continuous acceleration despite the limitations imposed by the game's physics.

💡Tool-Assisted Speedruns

Tool-Assisted Speedruns are a type of speedrun that allows the use of scripts to input commands, overcoming human reaction and dexterity limitations. The script describes a world record run that completes the game significantly faster than any human record, achieved by using joystick-like inputs to continuously select the wish vector and maximize speed increases.

💡CL Forward Speed and CL Side Speed

CL Forward Speed and CL Side Speed are variables in Quake that adjust the length of the forward and side vectors in the wish direction. The script mentions that these variables can be used to fine-tune the player's movement speed and affect the execution of movement techniques such as zigzagging and strafe jumping.

Highlights

Quake's player movement techniques have evolved significantly over the years, impacting the game's playstyle.

Early tricks like zigzagging were discovered, involving rapid alternation of strafe keys while moving forward.

Wall running technique involves strafing into a wall while running parallel to it.

Bunny hopping or strafe jumping has seen its own evolution in the history of Quake.

All three movement techniques provide a speed boost to the player.

The techniques originate from the same short piece of code, influencing the design of many first-person shooters.

The player physics logic converts key presses and mouse movements into a wish vector for intended movement direction.

The wish vector is formed by adding scaled vectors and normalizing the result, influenced by directional keys and speed variables.

A loophole in the velocity calculation allows manipulation of the current speed, leading to speed boosts.

Zigzagging gains speed by alternating strafe direction against the current movement, demonstrated with slow motion analysis.

Strafe jumping involves a pre-strafe or circle jump to gain initial speed beforeç©șäž­ transitioning to the inner part of the jump.

Wall running is performed by running along a wall while strafing into it, with velocity clipped to be parallel to the wall.

In-air velocity update is similar to ground, with no friction and a reduced nominal maximum speed.

Strafe jumping requires keeping the wish-to-velocity angle close to 90 degrees for continuous acceleration.

Speed runners tap forward when approaching the ground to momentarily reduce the wish-to-velocity angle and maintain acceleration.

Tool-assisted speedruns exploit joystick-like inputs for continuous selection of the wish vector, maximizing speed increases.

The video explains different ways Quake's player movement and acceleration are exploited for speedrunning.

Transcripts

play00:01

over the years quake's player movement

play00:03

techniques have evolved from simple

play00:04

tricks

play00:05

through to elaborate routines that have

play00:06

completely changed the way the game is

play00:08

played

play00:10

one of the earliest tricks discovered

play00:11

was zigzagging a rapid alternation of

play00:13

the strafe keys while running forward

play00:16

next came wall running which is done by

play00:18

strafing into a wall

play00:19

while running parallel to it finally

play00:22

there is bunny hopping or strafe jumping

play00:23

a technique that has gone through its

play00:25

own evolution over the history of quake

play00:27

all three give the player a speed boost

play00:29

and amazingly all three are born from

play00:31

the same short piece of code

play00:34

being the progenitor of a vast family of

play00:35

first-person shooters

play00:37

quake's player movement dna can be found

play00:39

in many other games across the genre

play00:41

for example any other game that features

play00:43

strafe jumping of some kind

play00:44

likely has the same short piece of code

play00:46

or something very similar

play00:48

at its heart we have explored strafe

play00:50

jumping

play00:51

specifically related to quake 3 in

play00:53

another video linked here

play00:55

in this video i'm going to dive into the

play00:57

original quake source and explain how a

play00:59

relatively small piece of code gives

play01:01

rise to all three of these techniques

play01:04

rather than showing the c code directly

play01:05

i've translated it into pseudopython for

play01:07

clarity

play01:08

however i've also included references to

play01:10

the c code if you wish

play01:12

to read further the player physics logic

play01:15

starts by converting key presses and

play01:17

mouse movements into what's known as a

play01:19

wish der

play01:20

as the name suggests this gives the

play01:22

player's intended movement direction

play01:25

it's formed by adding a scaled forward

play01:26

vector to a scaled side vector

play01:28

and then normalizing the result which

play01:31

components are included depends on the

play01:33

directional keys that are being pressed

play01:35

in addition the length of the forward

play01:37

and side vectors can be adjusted with a

play01:39

cl forward speed and cl side speed

play01:41

variables

play01:42

we'll come back to these later

play01:46

the wishter is used to update the

play01:48

player's velocity in the horizontal

play01:49

plane

play01:50

the vertical velocity is calculated

play01:52

according to a simple gravity model

play01:55

when on the ground the velocity update

play01:57

looks like this

play01:59

first of all some friction is applied

play02:01

which scales the speed

play02:02

the rest of the function updates the

play02:04

velocity by adding on the wish to

play02:06

scaled by some factor which i've called

play02:07

add speed

play02:09

the amount of speed to add depends on

play02:11

the current speed and the developer

play02:12

intended maximum speed

play02:15

so far so good however it's in the

play02:17

calculation of the current speed that

play02:19

the loophole lies

play02:21

rather than taking the current speed as

play02:22

the length of the vowel vector it is

play02:24

taken as the scalar projection of the

play02:26

velocity onto the whisper

play02:29

by using the keys and mouse to

play02:30

manipulate the wish der relative to the

play02:32

velocity

play02:33

you can make current speed as large or

play02:35

as small as you like

play02:36

the add speed is then just the

play02:38

difference of the current speed and the

play02:39

nominal maximum speed

play02:41

clipped to be between zero and a

play02:42

constant intended to limit the player's

play02:44

acceleration

play02:46

whenever the add speed is being limited

play02:48

by the max acceleration constant you can

play02:50

make the speed on the next step faster

play02:52

by bringing the whistler closer to the

play02:53

velocity's angle

play02:56

fully exploiting this bug then usually

play02:58

requires having the current speed lag

play03:00

behind the max speed by this

play03:01

acceleration limit

play03:05

let's see how this theory can be

play03:06

exploited in the game with some slow

play03:08

motion analysis of a few speed running

play03:10

tricks

play03:12

since the speed increase for a given

play03:13

frame depends only on the wish angle

play03:15

relative to the velocity

play03:16

we can make a plot of hypothetical speed

play03:19

increases

play03:20

the blue bar here corresponds with the

play03:22

selected wister

play03:23

so the point where it crosses the curve

play03:25

gives the actual speed increase

play03:28

the technique shown here is known as

play03:29

zigzagging which gains speed by changing

play03:31

the strafe direction against the current

play03:33

movement direction

play03:35

the velocity then moves towards the

play03:37

whistler pushing us into a zone of

play03:38

deceleration

play03:39

but then the player switches strafe

play03:41

direction changing the whistler relative

play03:43

to the movement direction once more

play03:45

and so the process repeats with the

play03:47

player gaining speed

play03:48

until the speed gained by manipulating

play03:50

the angle is balanced out by the speed

play03:52

lost through friction

play03:54

strafe jumps usually start with a move

play03:55

on the ground where forward and a strafe

play03:57

key are held while swinging the mouse

play03:59

known as a pre-strafe or circle jump

play04:02

this gains some initial speed before

play04:04

transitioning to the inner part of the

play04:06

jump

play04:07

like zig zagging the whistler is

play04:09

continually changed to keep the wished

play04:11

velocity angle in the sweet spot

play04:13

although this time it's done by changing

play04:15

the view angle rather than the keys

play04:17

here's an illustration of wall running

play04:19

which is performed by running along a

play04:20

wall while strafing into it

play04:22

collisions with walls are handled by

play04:24

clipping the velocity to be parallel to

play04:26

the wall

play04:27

this means that the wish to velocity

play04:28

angle can be kept constant

play04:30

simply by moving into the wall at a

play04:31

steady angle as with the other

play04:33

techniques

play04:34

doing this at just the right angle gives

play04:35

a speed boost note that when looking at

play04:38

the wall

play04:38

extra friction is applied so wall

play04:40

running is best performed by strafing

play04:42

into the wall

play04:43

rather than running into the wall with

play04:44

just the forward key

play04:47

when in the air the velocity is updated

play04:49

in a very similar way to on the ground

play04:51

the only differences are that no

play04:52

friction is applied and that the nominal

play04:54

maximum speed is only 30 units a second

play04:58

reducing the nominal maximum speed means

play05:00

that to accelerate

play05:01

the player's wish to velocity angle must

play05:03

be close to 90 degrees

play05:05

much less and current speed exceeds the

play05:07

new limit and therefore add speed is set

play05:09

to zero by the lower bound in the clip

play05:10

call

play05:12

much more and wish the points back on

play05:14

vel enough that the total vector does

play05:16

not get longer

play05:18

when strafe jumping the angle is kept

play05:20

close to 90 degrees by holding a strafe

play05:22

key while turning the mouse to stay in

play05:23

the zone of acceleration

play05:25

to stay on a straight path the strafe

play05:27

direction and turning direction can be

play05:29

changed which places the angle near the

play05:30

sweet spot on the opposing side

play05:33

typically the player will chain together

play05:34

a series of these jumps minimizing time

play05:37

spent on the ground and subject to

play05:38

friction

play05:39

nevertheless there is still exactly one

play05:41

frame between each jump when the ground

play05:43

physics apply

play05:47

this means that the acceleration zone

play05:49

briefly moves to a more moderate angle

play05:52

to deal with this the best speed runners

play05:53

will tap forward when approaching the

play05:55

ground

play05:56

momentarily reducing the wish to

play05:57

velocity angle

play05:59

the exact angle is determined by the

play06:01

ratio of the cl forward speed and cl

play06:03

side speed variables

play06:06

default values work pretty well provided

play06:08

that the always run option isn't used

play06:09

which doubles just the forward speed

play06:12

instead the run key should be held or

play06:14

plus speed issued at the console

play06:16

which increases the forward speed and

play06:17

side components in the same ratio

play06:21

this covers all the ways that people

play06:22

have exploited the velocity update rule

play06:24

in quake

play06:25

but is there another technique to move

play06:26

faster it turns out there is

play06:29

but it's only exploited in tool assisted

play06:30

speedruns that is

play06:32

speedruns that permits scripting of

play06:34

inputs to overcome limitations of human

play06:36

reactions and dexterity

play06:38

here's a clip from the current tool

play06:40

assisted world record which completes

play06:42

the game in 9 minutes and 35 seconds

play06:44

over 2 minutes faster than the human

play06:46

record there's no side to side movement

play06:49

as you'd normally see with strafe

play06:50

jumping

play06:51

yet nevertheless the player is still

play06:53

gaining phenomenal speed

play06:54

what's actually happening is joystick

play06:56

like inputs are being used rather than

play06:58

keyboard inputs

play06:59

using inputs like this allows continuous

play07:01

selection of the wishter

play07:03

the script driving this run can then

play07:05

select the wish to velocity angle on

play07:07

each frame to maximize the speed

play07:08

increase

play07:10

being computer controlled the script can

play07:11

alternate direction on every frame

play07:13

resulting in a virtually straight path

play07:16

unlike a regular strafe jump the view

play07:18

remains stable as the mouse is no longer

play07:20

required to influence the whistle

play07:23

i hope this video has helped to explain

play07:25

the different ways in which quake's play

play07:27

or acceleration is exploited

play07:29

if you liked it please click like and

play07:31

consider subscribing

play07:32

as always if you have any questions

play07:34

please leave a comment below

Rate This
★
★
★
★
★

5.0 / 5 (0 votes)

Étiquettes Connexes
Quake MovementFPS EvolutionZigzaggingWall RunningBunny HoppingStrafe JumpingSpeed TricksGame MechanicsPlayer PhysicsVelocity ControlSpeedrunning
Besoin d'un résumé en anglais ?