In scripting, pathfinding algorithms are used to…
The best-first search is a pathfinding algorithm that uses heuristics to reach its goal. Given both an open and closed set, it explores the node with the least cost first.
There are different heuristics that can be used for a best-first search. Usually you’ll want to adapt the chosen heuristic based on the type of map you’re using.
This heuristic takes the full distance along the X axis and adds it to the full distance along the Y axis in order to go from point A to point B. It should usually be used when the AI can only move in the four cardinal directions.