Chapter 19: Implementing Game AI for Building Enemies
What is a game if not a great challenge to the player, who needs to use their character's abilities to tackle different scenarios? Each game imposes different kinds of obstacles on the Player, and the main one in our game is the enemies. Creating challenging and believable enemies can be complex; they need to behave like real characters and must be smart enough not to be easy to kill, but also easy enough that they are not impossible to kill either. We are going to use basic but good enough AI techniques to make an AI capable of sensing its surroundings and, based on that information, make decisions. These decisions will be executed using intelligent pathfinding.
In this chapter, we will cover the following topics:
- Gathering information with sensors
- Making decisions with FSM
- Executing FSM actions
By the end of the chapter, you will have a fully functional enemy capable of detecting the player and...