Next up, we'll implement the A* algorithm in a Unity environment using C#. The A* Pathfinding algorithm is widely used in games and interactive applications even though there are other algorithms, such as Dijkstra's algorithm, because of its simplicity and effectiveness. We've briefly covered this algorithm previously, in Chapter 1, The Basics of AI in Games, but let's review the algorithm again from an implementation perspective.
A* Pathfinding
Revisiting the A* algorithm
We briefly touched on the A* algorithm earlier in the book, so let's review the basics before we dive into our implementation. For starters, we need to create a grid-based representation of our map. The best option for this is a...