Questions Concerning AI Motion Jerkiness

Started by
3 comments, last by Julian Spillane 18 years, 9 months ago
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
Advertisement
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.
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.
Turring Machines are better than C++ any day ^_~
Hi,

You should check out steering behaviors.

Hope this helps

Eric

Thanks a lot! This paper was exactly what I needed.

:)

This topic is closed to new replies.

Advertisement