Yet another optimization of my normal Breadth-First Search (BFS) pathfinding:
https://flowlab.io/games/play/2812295
It has all the features of version 3, plus many improvements to it, including a guarantee that the pathfinding will stop as soon as all the enemies have found a path to the closest player (which ensures max performance), a more flexible and streamlined behavior system for adding / removing target objects (the players in this case), better handling of enemy movement when very far away from targets (they won’t stutter as much or move slower), and diagonal enemy movement that no longer can get stuck when corners look like this:

This version is also simpler than version 3, so hopefully the code will be easier for people to understand . . . feel free to ask questions or give feedback!