Ai and Havok

Ai and Havok

Hi,

I need help designing my AI/Physics interaction in my game.

I want mybots tofind their way using my Ai engine, while colliding and interacting with the environment using Havok.

The problem is I cant find a proper way to do that using havok. While the AI engine gives me the coordinates the character should be inthis frame, havok, as far as I can tell, does not allow me to set the position of the character controller at each frame, but rather the direction and speed.

And even if Itake the direction and speed from the AI Engine, Havok would behave differently due to undesired friction and sliding.

I used to do that with other physics engines, simply by setting the chaaracter controller's position, but I can't do that in Havok

Please help

Thank you in advance.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi sanfir,

I would suggest using the character proxy if you are not already. You can take a look at the CharacterProxy demos.

If you were using the hkpCharacterRigidBody then it just uses the physics system to move around. The Character proxy, on the other hand uses the velocity information to do linear casts so that you don't run into anything. Then it sets the position.

If you take a look at the demos for the character proxy, I don't think you will see any friction or sliding. Although, you can override the character states to give any kind of behavior you want and that is to be expected.

I hope that helps.

Thanks,
Sean

Developer Support Engineer Havok www.havok.com

Quoting - sanfir

Hi,

I need help designing my AI/Physics interaction in my game.

I want mybots tofind their way using my Ai engine, while colliding and interacting with the environment using Havok.

The problem is I cant find a proper way to do that using havok. While the AI engine gives me the coordinates the character should be inthis frame, havok, as far as I can tell, does not allow me to set the position of the character controller at each frame, but rather the direction and speed.

And even if Itake the direction and speed from the AI Engine, Havok would behave differently due to undesired friction and sliding.

I used to do that with other physics engines, simply by setting the chaaracter controller's position, but I can't do that in Havok

Please help

Thank you in advance.

The key to efficient AI/Physics interaction in your game is to to focus on collision avoidance. In a nutshell, you want your characters to avoid collision as much as possible (via path planning, sensors, etc.). In the event that they do collide, you're not taxing Havok too much with collision points (although Havok is very fast and very efficient!).

Have a look at Craig Reynold's OpenSteer (http://opensteer.sourceforge.net/). His work is very helpful with this kind of thing.

Good luck!

Leave a Comment

Please sign in to add a comment. Not a member? Join today