Quake physics questions

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
daemonicky
Posts: 185
Joined: Wed Apr 13, 2011 1:34 pm

Quake physics questions

Post by daemonicky »

AFAIK Quake physics is simple. :D

Bodies just move at a velocity they are given. Velocities are clamped; therefore there is maximal velocity (in absolute value); maybe velocity is set to zero when it is too small (I infer this from some Doom code which AFAIR handled 0 health somehow strangely and Quake had some floating point rounding at several places). Friction and bouncing changes velocity; QuakeC too.

IFAIK collision is separated into two parts; collisino between bodies and bodies and collisions between bodies and world. I think Quake does not do this algorithm - search for nearest collision time and move everything to that time, handle collisions and repeat until you solved every collision for given delta time - but I may be wrong; I might have seen some algorithm in Quake similar to this one but I am really not sure.

Collisions between bodies. I am not sure about this but I have feeling that friction and bouncing is unified in Quke engine because when body touches plane it gest some Y velocity (bounce part) and X velocity (friction part) vis http://www.desktopclass.com/wp-content/ ... ror348.jpg . I think I have seen it somewhere in Quake 3 code, there were attributes to Y and X part so I infered this unification :) . If there is no bounce, then Y is 0; of course one moves body so it does not intersect with the plane.

Collisions with level. There is some algorithm to get thing out of collision (it is some get all planes which it collides with and move colliding object by average of their normals; or by some amount at each normal it finds; or by how much it penetrates). I think they mostly project velocities for monsters and player because I dont remember any bouncing when I hit the wall (sliding on a wall works because of projection out of wall I think); grenades are bounced.

Am I correct?

I found this video of Unreal game Deus Ex which could not handle 100 rockets http://www.youtube.com/watch?v=4YfIwV2Z ... re=related . I would be a Question about Unreal, and not so much about Quake, but why does it lags so badly? I presume the computer he recorded it on was not very old and well, 100 of moving bodies is quite nothing.
My guess why it is slow is : algorithm for computing physics tries to find nearest collision by O(N^2) tests because rockets are in the same area; then it tries to resolve collision and rockets bounce only slightly and nearest collision is in next frame again so it almost does not move at all ...
Think, touch, movetype, solid, traceline ...
Post Reply