Mira has been doing a significant amount of work on the pathfinder across several pull requests, such so that it deserves its own blog post :-).

Technically speaking: The pathfinder is no longer a static class and is now adapted to the actual map size, which opens the door for larger maps without issues. Neighbour pre-computation reduces repeated calculations during each search.

A fast path was introduced for common cases to skip unnecessary work. Dead-end handling was improved so units do not get stuck as often. Octile distance is now used for more accurate diagonal movement cost estimation, which means units choose better routes.

A number of edge cases were also fixed along the way: avoiding diagonal movement in tight spaces, handling unreachable cells more gracefully, and protecting against path buffer overflow.

With all this, it is noticeably faster, more clever and performant!

Thanks Mira!

No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to support? Please consider donating via Kofi.