Hello, I’m trying to implement vehicle AI that follows traffic rules on a road network in city map, but I’m having some troubles. I’m not sure how to implement the pathfinding for the cars, since navmeshes can’t make the cars stay in their own lane. The internals of the Unreal Engine navigational system isn’t that well documented, so I thought I’d ask for some help.
I have spline based roads and I’m thinking of having each lane have their own one-way waypoints on each spline end, which are then connected to the correct socket on the next road spline. Road network will be modified on runtime. The waypoint grid would probably need to be extended from ANavigationData, and possibly I’ll have to write pathfinding from scratch myself.
Is there a simpler way? Can NavMeshes be built programmatically, if I know which points are connected to which points? Or could Nav Link proxies be used for this? Am I even thinking this from the correct direction? Ideally I’d like to reuse as much Unreal Engine core functionalities as possible. Also, it would be cool if I’ll manage this with the physics engine instead of having vehicles follow the waypoint path like they are on tracks but it’s not necessary.
Any thoughts or input would be appreciated. Either Blueprints or C++ is fine for me, though Blueprints are preferred.