How does it really happen ? (Collison question)

Started by
4 comments, last by CJM 19 years, 5 months ago
What is the perfect way for collision of a player with other objects in an FPS game ? Is the player body made up of small meshes , joined together, and then collision is checked against the AABBs ? Or is there more to it ? I would be grateful if someone could direct me to useful information/explain me how this happens (FPS collision stuff) ?
Advertisement
you don't need to be super accurate when doing player-player or player/objects collisions (exept if you want to check a rocket more accurately). Games use a single AABB for each player and collide the players like that.

You can do limb collisions if you want too, but unnecessary. There are no perfect ways.

for fast moving objects, and rather singular objects (bullets, grenades, rockets), you can model them as a single particle, and essentially do a ray/player mesh collision. a moving box against a mesh is quite costly, so if you can approximate the object to a point the better.

Everything is better with Metal.

Thanks, but wouldn't using a single AABB for a player make it unstable i.e it would trip easily and climbing stairs and stuff would be difficult ?
yes, you have to fudge it. Use some kind of step-up algorithm, which would check if the player can be placed, say, 30 cm above where it should be.

related docs,

http://www.gamasutra.com/features/20010324/melax_01.htm

http://www.fluidstudios.com/pub/FluidStudios/CollisionDetection/Fluid_Studios_Generic_Collision_Detection_for_Games_Using_Ellipsoids.pdf

the second one involves two passes, once without gravity, the other adding gravity. Also, note that it's using ellipsoids, so more forgiving when you encounter a step.

Everything is better with Metal.

Wow! Thanks, the second document answers all my questions.
I remember from somewhere that most games use [nonrotated] capsule shapes for player collision detection. This means that they can step up steps and they can rotate around without getting stuck in walls. Similarly, you don't get stuck to other players if you're all capsules and you can just use distance measurements between centres of the players to determine if you're gonna need to go to sphere collision.

Hope this helps;

//end rant
CJM

This topic is closed to new replies.

Advertisement