Well done for reaching the end of this chapter. The pathfinder is one of the core elements present in an RTS game, one thing that we must have in our game, and now it is working fully. The units can move freely on the map, avoiding obstacles, and even large groups can move through rocks and trees without being blocked by them, always trying to find the best path to the destination.
In this chapter, we learned what the pathfinder algorithm is, and we saw the theory and base concepts behind the most common implementations, from the relatively simple Greedy Best-First to the complex A*. We ended up looking at the NavMesh, the data structure most used in the games industry, and how to use the AI Navigation package in Unity and implement it in our RTS game.
The Dragoncraft game continues to expand, and we are building more features on top of those developed so far in this book. It is very rewarding to see the game taking shape and the scripts we developed are flexible enough...