Monday, October 8, 2018

Pathfinding Concepts


Pathfinding Concepts:


A* Algorithm:


In Computer Science, A* is a computer algorithm that is widely used in pathfinding and graph traversal, which is the process of finding a path between multiple points, called "nodes". It enjoys widespread use due to its performance and accuracy. In Game Design, most users will use the A* Algorithm to perform their pathfinding methods. While this is seen as the most popular, but this doesn’t that it is the best is best solution for every situation. A* Algorithm’s pathfinding combines the concept of Heuristics with a simple Algorithm to generate a path for the AI to work. A* works on these Algorithms to generate numbers and will take the path with the lowest number being the better route.

In Pathfinding the location, the AI can move to and from is known as nodes. Each node has a cost to it (look at table). To walk from one node to another it has a cost known as the route cost. When starting the pathfinding will use the first algorithm to generate a heuristic cost which is then used in the second algorithm. To further example here’s a quote to explain how the A* Algorithm works. A* has many advantages to it. The main advantage is that due to heuristic function it can quickly recalculate if the goal is moving and will only check nodes that need to be checked making it super responsive and is the reason why it most popular. A* is a super compact pathfinding that will find the best path based on heuristics however this pathfinding has a weakness of that it will always try to find the best route when sometimes you may want the AI to flank round or maybe being sneaky behind a wall instead of trying to get around the wall.


Dijksta’s Algorithm:


Dijkstra's Algorithm (Also called Uniform Cost Search) prioritizes which paths to explore. As opposed to exploring all possible paths, it prefers lower cost paths. It allows for assigning lower costs to encourage moving on roads and higher costs to avoid environments such as forests which could have more obstacles, using higher costs to discourage going into those areas. When movement costs vary this is used in place of Breadth First Search. Dijkstra’s Algorithm works well to find the shortest path, but it wastes time exploring in directions that aren’t promising. Best First Search explores in promising directions, but it may not find the shortest path. The A* algorithm uses both the actual distance from the start and the estimated distance to the goal.

No comments:

Post a Comment