Bunnyhopping is a movement technique where the player can increase their speed by constantly jumping whilst air-strafing. It's the main movement method for GoldSrc Engine, Old Source Engine and Portal 2 speedrunning. It is also found in many other games outside of the Valve universe.
When bunnyhopping, it's very important to time your jumps correctly, or else you will lose speed if you stay on the ground long enough for the game to apply enough friction to slow you down. Since timing a jump via the spacebar can be difficult it's recommended to bind jump to your mouse wheel. Each “step” while scrolling the mouse wheel is an input, this enables you to send many jump commands in a short period of time allowing for more leeway in your timing. While this method is not completely perfect, it's the best one for scriptless speedruns. If you want to get perfectly timed jumps you can use tools such as autojump or an looping alias script, however, speedruns using that fall into the scripted run category.
Bunny Hopping was discovered around 1997-1998 in Quake as an adaption of zig-zagging where being airborne did not cause any speed loss and additional jumps could increase the player's speed towards the engine limit. The first run to use bunny hopping was Quake done Quick Lite in September 1998. Since Half-Life is based on Quake 1 Engine, this movement glitch has been carried over to GoldSrc Engine.
In order to bunnyhop in Half-Life and its expansions, you must strafe using the A/D keys while turning the mouse in that direction, i.e. if you strafe right, you turn your mouse right. By doing this, you will gain speed upon every successful jump. It’s important not to hold forward, or it will not work. The amount of speed you gain increases if your framerate is higher.
In the WON versions of the game, up to version 1.1.0.8, you can gain speed until you reach maxvelocity, which is 2000 units per second. In later versions, including the Steam version, bunnyhopping speed limit is capped to 544 ups. If you exceed that speed, the game will simply slow you down to 320 ups on your next jump. A way to bypass that is to use Duckroll as the ducking speed is not capped in the engine.
In Half-Life 2, bunnyhopping is a whole lot different from the GoldSrc style. The main speedgain comes from the game applying additional speed to the player on every jump. Therefore you no longer need to airstrafe, instead it's enough to hold W (forward) and jump continuously. This type of bunnyhopping is often refered to as “Forward Bunnyhopping”.
Bunnyhopping is patched on the OrangeBox Engine, so Accelerated Hopping is being used instead.
In Portal 2, bunnyhopping is quite similar to the GoldSrc style; the main difference is that you lose the ability to turn in the air at about 300 units per second (ups). This is because of Portal 2's sv_airaccelerate value. You can still gain linear speed through well synchronized strafes and mouse movements. If you need to turn whilst at a speed over 300 ups, it's best to delay your jump in order to lose some speed (or redirect your velocity by circle jumping).
Another main difference is that the most advantageous method for strafe synchronization in Portal 2 is slightly different from the most advantageous methods in other (Gold)Source games. More specifically, one will not properly accelerate if strafe key presses are exactly correspondent with the direction of mouse movements.
Prestrafing, also sometimes refered to as Circle jumping or Acceljumping is a way of gaining a lot of speed while on the ground before jumping. By doing a prestrafe, you can get 480+ ups on your first jump, compared to 320 ups, the speed of a normal jump initiated while walking forward.
To perform a prestrafe, you need to combine both forwards walking (W) and strafing (A or D), while also turning your mouse. At it's peak speed, a jump is made to continue gaining speed while bunnyhopping. Imagine walking a curve and then jumping at the end of it. Make sure you don't turn your mouse too fast or too slow as that will only slow you down.
This technique is the same in Source Engine, except in Half-Life 2 you can also combine the sprinting mechanic to get even more speed out of it. Again, the speed you can get from a circle jump in GoldSrc increases with higher FPS values. The circle jumping technique in Portal 2 involves the same mouse movements, but only holding one strafe key (i.e. you only press W to gain initial speed. You do not hold it whilst performing the mouse movements.)
In the Orange Box engine you cannot perform normal circlejumps, because whenever you jump the ABH mechanic slows you down. However if you perform a circlejump backwards and release the S key just before jumping you get accelerated backwards. You can get even more speed by starting to walk right before you jump. All of this combined can give you 700+ ups on your first jump.
Another way of gaining speed on the ground is to Wallstrafe, however you need to be close to a wall in order to perform it, which often makes it useless.