Skip to main content
gamedev.net
🔒 Locked

Quake Physics

Started by nto Feb 27, 2007 at 7:54 AM 8 replies 1.2k views
Original Post
nto
nto
Hey everybody! I'm currently working on a project where I use the Quake 3 BSP format as maps. I've begun implementing game physics. So far I'm just maintaining a list of forces affecting the player object, summing them up and adding them to the player position. Gravity and jumping so far works, but I would like jumping to be a bit more "alive". In Quake, it's possible to do the so called "Bunny Jump" where, if timed correctly, you can increase your forward speed by continously jumping. I've been trying to locate how it's done in the quake source code, but I can't seem to find it. Does anyone have any knowledge on this subject; or any ideas as to how I can obtain this functionality? I was thinking of storing the time when a player collides with the ground, and then if the player jumps before, say 0.5 sec, it will add a bit of front speed. I'm hoping that some of you can give me some pointers. :) Thanks in advance, Michael.
nto
nto
Hrm, I wasn't quite sure where to put this. Maybe I should've put it in the Math and Physics section. Sorry about that.
Bob Janova
Bob Janova
As far as I know, it's basically a bug – your forwards velocity is increased by holding forward, and if you jump soon enough it never gets clipped by the walking code. But I'm not intimately acquainted with the Quake source code (and definitely not Quake III; I did participate in a conversion of Quake II to Delphi but I didn't work on that part).
nto
nto
Hey, first off, thanks for replying.

I thought it was quite intentional, since it's been in all versions of Quake so far :-)

I guess I will just have to simulate it somehow.
Bob Janova
Bob Janova
I think it might not be high on their fix list ;).
oliii
oliii
It started off as a bug, then became a feature. Your best bet is to simulate it yourself. YOu could start off by adding a jump feature that not just pushes you up, but in a specific direction (i.e., slightly forward), and play around with the friction code.
Everything is better with Metal.
shurcool
shurcool
As far as I know, it was *originally* a bug in Quake (or something) code that people found out and started "exploiting," but then it got very popular so it was kept in as a "feature." When you bunny hop, you never hold the forward key. Instead, you turn left and right with the mouse as you jump, and always hold the left/right strafe keys.

I'm sure if you Google you can find out more info on how it works, but I don't think you can do it properly unless you copy the entire Quake movement code. So your best bet probably is to just simulate it yourself (like you said, by adding a small forward velocity when the player is jumping up and down, ie. hopping, without stopping).

Edit: Damn it, oliii beat me to it, and said pretty much everything I did in 10 times lower the wordcount. >.<
hymerman
hymerman
It's just as Bob said; you can increase your velocity in the air (there is no air friction), and if you jump quickly enough the friction with the ground won't have enough time to slow you down, as it acts over time. It's not something explicitly written into the game logic, just an odd side effect that people like to exploit :)

EDIT: multi-ninja'd. That'll teach me to leave posts open in tabs for ages.
oliii
oliii
Sniped!
Everything is better with Metal.
nto
nto
Alright, I'll simulate the infamous "feature/bug" :)
I've figured a few more ways that might work on it so I'll try and implement them. I'll let you know how it goes when it's done :)

Thanks for the quick replies! :-)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.