We use cookies on this site to enhance your user experience

Pathfinding Algorithms

Pathfinding Algorithms

Aug 29 2019, 9:17 AM PST 5 min

In scripting, pathfinding algorithms are used to…

Best-First Search

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.

Manhattan Distance

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 four cardinal directions.

  • lua
  • algorithm
  • pathfinding