After an abortive attempt at my own method of path-finding, I began to understand why these things are worked out by cleverer people than me, so I took a step back and implemented A-star properly. And for the most part it seems to work, although it does seem to get confused sometimes and goes into an...