Adding Simple Navigation
Welcome to Chapter 13! In the previous chapter, we created a separate octree to enhance collision detection, allowing us to detect collisions between instances and level geometry in a quick and computationally cheap way. Then we added simple gravity to the application to keep the instances on the ground of the map, eventually resulting in the instances walking on the level floor and small hills. Finally, we used inverse kinematics on the feet of the instances to keep both feet on the ground when climbing hills or sloped areas of a map.
In this chapter, we will add pathfinding and navigation. We start with a brief overview of methods used for navigation in computer games, followed by an exploration and the implementation of the A* path-finding algorithm. Next, we will add navigation targets to the application, enabling a simple way to place path destinations in the virtual world. At the end of the chapter, we will implement the navigation toward the waypoints...