Sign in to follow this  
Julian Spillane

Questions Concerning AI Motion Jerkiness

Recommended Posts

Hello all, I am currently enduring a severe headache as a result of a problem that I cannot solve. I am currently hard at work on the AI logic for our cartoon racing game, and am having issues with the smoothness of its motion. The logic is fine. We are using a physics simulator and are providing the car input values for turning based on the next waypoint (we are using a system of waypoints for navigation). The problem is, as is probably self-evident, that the car will turn to face a waypoint, drive to it, turn, drive, turn, drive, producing very jerky, angular behaviour. I was thinking of introducing a Catmull-Rom spline into the whole thing, but I'm not really sure how I would go about doing it. I know that I need a smoother motion, I'm just not sure how to obtain it without generating thousands of waypoints. If you require some code snippets, I'll post whatever is needed. Thanks a lot. This problem is driving me insane. Best Regards, Julian Spillane

Share this post


Link to post
Share on other sites
Instead of using splines, try using a more simple method:
Every frame (or when ever the AI is updated) have the cars turn towards the waypoints by a small amount.

For example, if the cars turn a few degrees towards the waypoint every ten frames, the motion will appear much more smooth.

Share this post


Link to post
Share on other sites
This is more of an "easy" solution, but why not drive along the path defined by the current location and the next two waypoints so that the path is along a circle? The equation for such a circle is here. Just make sure you are using only way points away from the AI, if you keep using a waypoint once it is nearby you will get eratic behaviour with this.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this