Understanding pathfinding
As you are aware, Unreal Engine uses pathfinding for moving an agent around a level; in this section, I will go a bit deeper into detail on how things work under the hood. Unreal Engine takes advantage of a generalized version of the A* algorithm, a widely employed graph traversal and pathfinding algorithm in computer science. Known for its completeness, optimality, and efficiency, its main goal is to determine the shortest path between a designated source node and a specified goal node in a weighted graph.
This graph is a node-based representation of the level, where nodes represent walkable areas that are interconnected and have information on neighbor nodes and traversal costs to reach them.
A* uses a heuristic function to estimate the cost from each node to the target location; this trial-by-error system helps guide the search toward the most promising paths, improving efficiency.
During the pathfinding process, the algorithm maintains two lists...