Shortest Path Algorithm - In Blueprints!

Hi All,

First post real on here, so please be kind :). I have been learning UE4 for about 10 months and in last couple of months come up with a project I want to create.

Just wanted to share one part of it I have been working on for the last week or so…

In short my game has Roads, and AI cars drive around these roads by following splines. Each spline has a reference to the following spline(s) it connects on to.
The AI currently reaches the end of a spline picks its next route at random from the Splines that this one is connected to then follows that.
I wanted to allow the AI to have a predefined destination to find its way to and also for the Gamer to also have a predefined destination with waypoints (satnav) to follow

*A Shortest Path algorithm **

So for the last week iv been studying the A* Shortest Path algorithm, which is a variation on Dijkstra’s algorithm, that makes use of a ‘heuristic’ to weight the direction in which to search first; hopefully making it more efficient, particularly from a gaming perspective.

Currently I have to manually tell it what my start and end points are, and it only spits out a PrintScreen of the order of the path. But it seems to be working, i got so excited I wanted to share!!!
Over the next week or so I hope to implement:
-Pick closest Spline as Start Spline (AI already does this in order to move around)
-Pick closest Spline to a destination (Destination will be initially some sort of StaticActor Gamer can cycle through and the AI will pick one at random)
-AI will follow routed path then select a new destination to route to
-A waypoint system for the Gamer to follow to the destination.
-Refine the algorithm to support:
-Neaten up the nodes and better annotate them
-Calculate Road Route in opposite direction to Closest Spline to see if it is quicker
-Ensure that it is producing the more efficient path (early testing seems good, but more roads I build will test it better on a larger scale)
-If there is no route to the destination find the closest Spline we can route to (Currently just returns “NO ROUTE”)

I hope to release this out to everyone that would find this useful; once I am happy with it.

Structured criticisms, feature requests I could add and any other comments are most welcomed!

Here are a couple of Screens of the BP so far and the output(Not exciting ScreenPrint)

I will update this thread as I hit milestones

Thanks for reading!

20161124-AStarOutput.PNG

Hey, any update on this?