Sunday, April 5, 2009

Moving to Havok

well, the day has come and i realize that nvidia physx isn't good enough for my game play physics, so i started to read havok physics sdk and i really like it, its not simple as physx but gives better control over things like character controller, ragdolls, ray casts etc.
why i'm doing it right now and not waiting after i release a demo?
the things is the physics is very important part of the game especially the character controller, so i prefer doing it before and have solid system than say: "i cant do it now, its a lot of work".
few things i found physx is very bad at:
1. filters, not enough and not general so i could filter collision detecting between objects and such, for example: i want to the bot to shot but i dont want it to collide with its ragdoll! i solved it via bits filtering but limit to only 32 bots.
2. character controller! smooth collision nice handling with different shapes (box, sphere, capsule) but very very bad in interacting other physics element, the thing is that this character controller (cct) is placed outside the physical system and perform sweep test against the world to do sliding and stairs handling.
so interacting with other rigid bodies is done via collision callback that tells you which bodies the cct collide with and allows you to add forces to do the pushing effect, but what about other rigid bodies that pushing the cct? well this is not possible! because the cct is a kinematic object which means its static! and have high priority over other none kinematic objects.
so doing moving platforms that allows the cct to stand and moving with them isn't possible! you can do it by doing dirty hacks and maybe you get the right results but it will jitter a lot and wont perform very well.
those are 2 things i can't compromise and because of them (mostly because the cct) i move to havok, which have great cct and let you chose the one which fits better to your game, they have rigid body cct and proxy cct which acts like physx cct (placed outside of the physical system and do sweep test and such), when you choose rigid body cct it means it part of the physical system and everything works! meaning you can push things, things can push you, moving platform become very easy to do.
they also have very generic filtering system and ragdoll support, they even have animation support which works with ragdoll physics and ik so you can do animation with ik and enable ragdoll physics when you want.
there alot of things i didn't mentioned but i think that if you need good physics system and you dont want to compromise you should select it very carfull or you end up changing it like me :)
so in two words: Havok Rocks!
cya until next time...

if you have any question feel free to ask