Half Life 2 Bunny Hop Script

We're building a new wiki, so information on this page may be out of date.

We'd love for you to help us out!

Aug 19, 2016 This page will store all the scripts used or useful for Half-Life speedruns. If you want to use any script, simply copy-paste it to your userconfig.cfg file using a text-editor like Notepad. While in-game use this command in console: exec userconfig.cfg and the scripts should load. NOTE: Since Half-Life Beta Update (2013-05-16), the special. Autohotkey Script Files USE THIS AT YOUR OWN RISK AS NOW IN 2018 PEOPLE ARE GETTING VAC BANNED FOR USING THIS SCRIP. Bunny Hop only works with old versions of the Half-Life games (all Half-Life engine games) and with modern mods that allow the BH (often advertised as such.) The mods also allow bunny hop on source games, although the same effect can be achieved with about 750 gravity.

Discoverer(s) Hlook
GamesHalf-Life 2

Half-Life 2: Episode One
Half-Life 2: Episode Two
Portal

EngineOrangeBox Engine
Used inPDP

PDP-er
HL2EP2DQ
DWaHMoVHL2EP1DQ-er

Accelerated Back Hopping (ABH for short) is a Glitch, and it's the main method of movement on OrangeBox Engine-based games. ABH replaces Bunnyhopping, which was fixed in the OrangeBox Engine. It is also significantly faster than bunnyhopping.

  • 2Explanation
    • 2.1Summary
  • 3Variants
    • 3.1Accelerated Forward Hopping (AFH)
    • 3.2Accelerated Side Hopping (ASH)

How to

Jump forward, turn around in the air and jump right as you land. It's recommended not to hold S or W (or your respective keys for moving forwards and back) while ABHing. Binding +jump to mouse wheel or using a jumping script is recommended as it makes timing jumps a lot easier.

Explanation

Cached

ABH works due to Valve not accounting for the direction of the player's speed when capping it, thus leading to the directly opposite result of accelerating the player even further.

Summary

Bunnyhopping is capped if your speed on your jump exceeds a certain threshold. When your speed is over the limit, by default the game assumes you are always moving forward so the game accelerate you backwards to reduce your speed down to the threshold. However if you are moving backwards when the game bounds your speed, the game will try to slow you down by adding backward speed, consequently accelerating you.
As mentioned above, the amount of backward speed the game applies on you is based on your speed when you jump, so the faster you go, the more speed you'll get.
Because of this, you can accelerate extremely fast, much faster than bunnyhopping.

ABHing and Bunnyhopping comparison chart, shows the speed gain on each jump (no sprint).

The speed threshold is based on the state of the player when you jump. The table below will show those thresholds and first ABH speeds if you sprint jump then enter the conditions listed and frame-perfectly do ABH's. Note that some conditions will not give you speed because of how the speed is calculated.

Conditions Speed limit First possible ABH speed
With suit Without suit With suit Without suit
While crouching 209 165 495 285
While walking 225 n/a 479 n/a
While running 285 225 419 n/a
While sprinting 352 n/a n/a n/a

Ducking while doing ABH is recommended since it has the lowest speedcap of all states at 209 UPS.

Equation

Bunny hop scripts

Compounding all the flaws shown below, we can calculate our next speed after an ABH (given that the jump is perfect and there is no angle change) with the equation below:

Substitute flMaxSpeed with the Speed limits from the table above and you will have your new speed.


How the game calculates and bounds your speed when bunnyhopping

The game goes through a few steps to decide how much to add to player speed and whether to subtract instead.

  1. Calculate flSpeedBoostPerc to figure out the multiplier for calculating the additional speed and maximum speed for bounding it.
  2. The game calculates flSpeedBoostPerc based on the state of the player when they jump, so when we are crouched or we are sprinting, it chooses 0.1; for other states like running or walking, it chooses 0.5.

  3. Calculate the initial flSpeedAddition which is the amount of speed to add onto the player's existing speed.
  4. The way the game calculates the addition speed is to take the absolute value of the product of mv->m_flForwardMove and flSpeedBoostPerc

    mv->m_flForwardMove is the normal speed you move in the state you jumped in, so when you do a sprint jump, it is 320; a running jump is 190;...

  5. Calculate the maximum speed flMaxSpeed for bounding the player's speed later on.
  6. Calculate the player's initial new speed flNewSpeed
  7. It does this by simply take the flSpeedAddition and adding it to the player's initial speed when they jump.

  8. Check if the player's new speed is higher than the maximum. If it is too high, calculate the new amount of speed to apply onto the player using an equation.

After all the steps above, the game takes the newly acquired flSpeedAddition and apply it onto the player's speed.

The Flaw

Normally an ABH is done by doing a backward sprintjump, crouch in midair, land and continue jumping without holding any directional keys. In the calculations below, we'll assume that inputs are frame-perfect without any loss of speed.
When the player sprints and then jump backwards, their speed will be negative and when they land and crouchjump, our speed will be 352 UPS. Ideally mv->m_flForwardMove should be 190; but because we are not holding any directional keys, it is 0 instead. This means our additional speed we get will also be 0.

This means our new speed will also be the same as the old which would be

Because your speed is over the threshold when landing (we land at 352 UPS which is higher than the 209 UPS threshold when crouching), the game does the speed bound routine. But since our flSpeedAddition is 0, this will come out as negative.

And since you're moving backwards and your speed is negative, your new speed will be increased. Our new speed in this case is 495. After 2 another jumps, the speed increase will be massive



Variants

There are some ways to gain speed similar to ABH:

Accelerated Forward Hopping (AFH)





How To Bhop In Hl2



Half Life 2 Bunny Hop Script
How-to

Once you've gained some speed while ABH-ing, you can turn around and start pressing S every time you jump, allowing you to see where you're going.In games with relatively high air acceleration like Half-Life 2, the more precise your S-taps are. the more speed you'll preserve since the longer you hold S the more you decelerate yourself while in the air. On the other hand on games like Portal with lower air acceleration, you can simply hold S to do AFH's.

Explanation

Summary
When you're flying forwards and land, if you press or hold S and press Space, the game will assume that you are moving backwards and thus it will try to 'decelerate' you by applying speed the opposite direction, consequently accelerating you.
Detailed
When you're holding S, mv->m_flForwardMove is negative, which shouldn't interfere in the speed capping as the function uses its absolute value. However at the very bottom there's the following bit of code:

Which effectively turns the speed reduction amount from being negative to positive, thus accelerating you.


Accelerated Side Hopping (ASH)







Accelerated Back Hopping - SourceRuns Wiki

How-to

To execute this, start an ABH but instead of turning around in the air, adjust your view slightly to the left (or right) and hold S and D (or S and A) to gain speed. Unlike AFH, if you are ASH-ing close to the ground, you can hold your inputs and adjust your aim accordingly to consistently do the trick. However, if you're in the middle of a launch, releasing your inputs is recommended in order not to disturb with your jump and to allow better maneuverability while you're in the air.

Half Life 2 Bhop Mod

Explanation

Like with AFH, when you hold down S and a strafe key, mv->m_flForwardMove would also be negative, consequently the speed 'reduction' is reversed and added on top of your original speed.Turning your view slightly to the left or right depending on which strafe key you wish to hold is necessary to preserve speed, although some speed is lost.

Half Life 2 Bunny Hop Script

Retrieved from 'https://wiki.sourceruns.org/w/index.php?title=Accelerated_Back_Hopping&oldid=4776'