Vehicle AI avoidance

I’m making a racing game for a school project. I implemented a decent vehicle AI using waypoints and such. Basically it’s working fine, except when there are multiple vehicles. They just collide with one another. What I want is to have them avoid/overtake each other as much as possible, just like in real racing.

How do I go about doing this? I’m using Blueprints, btw.
Thanks!

You could try a NavModifier for your Cars. If you increase the entering cost to something really high they will move around them unless there is no other way. You add those under the components tab and decide which type of Area modifier they have. Implement a new one suiting your needs and select it.

This will only cause your cars to not crash anymore. If you want cool races with somewhat intelligent drivers you will need to do a whole lot more work on the AI itself.

I hope this helps.

Cheers

Hi Erasio, thanks for the reply. Sorry but do NavMeshes work for vehicles? I tried adding a nav mesh and nav modifiers but the vehicle isn’t navigating around the obstacle or car for that matter.

…wait… how are your cars moving right now?

I expected you to use a nav mesh (which is very much possible for cars as well). You will need to tweak the settings quite a bit and do a bit additional work but in general the navmesh is nothing but an area which is set up for an AI on top of that to use. Basically indexing the area and saving all points one could walk on. What the AI does on top of that is implementation dependent.

I have target points laid along a track and my cars just move to those points accordingly. I didn’t use nav meshes as I was under the impression that they only worked for character pawns.

Thanks for the insight. I’ll look into using nav meshes for my vehicles.
Marked as correct answer for now. Thanks!

I know this question is pretty old, but this blog post gives a good overview of how to accomplish what Erasio is talking about.