A-star debug overlay

#2300 by @JamesDunne rebased and the revert commit squashed.