tgstation/-tg-station — pull request #710 by caelaislinn (2013-06-03 08:56:55+00:00)
Title: Adds two optimized pathfinds to replace AStar

Proc 1 is called for distances of 1 tile (I recall some places use AStar to check whether adjacent turfs are reachable?). Proc 2 is a very crude direct-move intended for distances of 2-3 tiles, but can be used in any context which has extremely minimal obstacles.

I didn't take a screenshot of profiling, I tested with ten mobs scattered around security + ten random diseases.

Ordinary AStar: About 0.8 self CPU
New optimized Pathfinding: About 0.04 self CPU

This is an improvement of %2000. This was primarily added as a hotfix to address the extra overhead from the new AStar added in #592, in particular from the excessive lag caused by airborne diseases. I've added this to weekly milestones, as Scaredy's currently running an out of date copy of the code (due to aforementioned diseases lag).