Game Developer jourverse, who is currently working on a tutorial series focused on building a traffic system in Unreal Engine 5, shared a demo project file for this procedural road network integrated with vehicle AI for obstacle avoidance, using A* for pathfinding.
The developer explained that both the A* algorithm and the road editor mode are implemented in C++, with no use of neural networks. Vehicle AI operations like spline following, reversing, and performing 3-point turns are handled through Blueprints. The vehicle AI navigates using two paths: the green spline for the main route and the blue spline for obstacle avoidance. The main spline leverages road network nodes to determine the path to the target via A* on FPathNode, which includes adjacent road nodes.
For obstacle detection, the vehicle employs polynomial regression to predict its future position. Upon detecting an obstacle, a grid of sphere traces is generated to map the obstacle’s location, and another A* algorithm is employed to create a path around the obstacle.