Why can I run diagonally in games faster than forward or sideways?

Feb 24, 2001
14,513
4
81
Always been a noggin knocker for me. I do 0 programming.

But it seems as far back as 3d games go (first person games, Doom, etc.) that a speed "trick" is to run diagonally.

It seems more pronounced in some games than others. Is this just an optical illusion due to the limitations of a flat projecting surface? Or is there some computery reason why moving diagonally is quicker than moving straight forward?
 

irishScott

Lifer
Oct 10, 2006
21,562
3
0
When I saw the thread title, I was thinking of old 2D RPGs and whatnot. Never noticed it in FPSs.
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
It is a real phenomenon. In id software games, people generally call it strafe jumping, whereas in Counter-Strike, it (at least was) called bunny hopping. It has to do with the way the velocity vector is rounded off. For example, if I am moving 2 units/s "forward" and 1.5 units/s "right", the true velocity would be the square root of 2^2+1.5^2, which is 2.5. However, due to the limited precision of the computations performed by the game's engine, that may be rounded to 3, so your speed is artificially increased by 3/2.5-1=0.2, or 20%. id software has known about this "bug" and could have fixed it, but the players of its games had essentially decided it was a feature rather than a glitch, so they left it in.
 

BrownTown

Diamond Member
Dec 1, 2005
5,314
1
0
Yes, its not supposed to happen, its either a bug or poor programming, I know with all the half life games alot of effort was taken to reduce the different ways to travel faster, but still some remain (although not nearly as bad). I played half life mods alot, and you could get speed boosts running along walls, bunny hopping or strafe jumping, back in the day bunnyhopping was at least twice as fast as normal walking if done right.
 

Cogman

Lifer
Sep 19, 2000
10,284
138
106
If I remember correctly, one of the other big reasons for the speed boost when hopping was due to the fact that air friction was 0, it allowed accel. due to gravity to speed the player up.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I agree with CycloWizard that it is probably the result of using integer calculations for positioning, and/or not properly accounting for the size of the coordinate unit rectangle when moving relative to both x and y axes.
 

CycloWizard

Lifer
Sep 10, 2001
12,348
1
81
Wiki's article on strafe jumping

Not all of the information I see there is correct. For example, in Quake 3, I could easily get up to 650 ups by strafejumping. There used to be a site that explained exactly how it worked, but I can't find it anymore. Anyway, my previous post is an oversimplified version of it.
 

PlasmaBomb

Lifer
Nov 19, 2004
11,636
2
81
I thought that bunny hopping was mainly used to prevent headshots, rather that for a speed advantage in CS:S, although I haven't played it so am ready to be proven wrong :D