There's more...

In the current implementation, the value member variable is an oversimplification. We know we could have several member variables with fuzzy values to determine diverse relevance points for every waypoint.

In that case, it's a good idea to synthesize all those calculations in an overall value, as presented here, or work in a better heuristic for determining the relevance of a waypoint over the others in the Compare implementation, so the sorting algorithm can work as expected.

Get Unity 2018 Artificial Intelligence Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.