I’ve improved navigation system for vehicle AI. Now I’m building path to the waypoint by using NavMesh data, if it’s possible. It means that vehicle can avoid different objects in level. It’s not support dynamic path rebuilding, which means if path to the waypoint was builded, then vehicle will try to go there even if level structure was changed.
To fix that, I’ve added some logic to avoid objects dynamically.
I’m not using linetrace for that, because I don’t know final form and size of the vehicle(due to modularity). Instead of this, I have smart movement checks. For example, if vehicle going stuck, I’m trying to change vehicle direction. There is a lot of different parameters to customize vehicle movement logic.
In video you can see work of current navigation system. Because current vehicle is rather big, it’s harder to set proper acceptance radius for waypoints(big value will be better for plain landscapes and low values for cities for example). Still need to adjust some timing parameters to react faster on collision with other objects, but it’s better than nothing and I will try to improve it later. White spikes are navigation points of current path to waypoint(they were added for debug purposes). It will be great, if somebody can advice me some tricks on how to improve navigation for vehicle.