There's more...

There is an easy-to-implement improvement over the algorithm, which leads to the P-A*mbush variation. Simply order the lurkers' list, from the closest to the farthest, and we should have a better result at almost no extra cost in computation. This is due to the fact that the ordering operation is handled just once, and could be easily implemented via a priority queue, retrieving it as a list to the main A*mbush algorithm with no additional changes.

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.