Starting Your AI Journey: Building Intelligent Enemies for Your Game
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 for the player, but in our game, the primary challenge comes from the enemies. Imagine an enemy that can sense your presence and strategically plan its attack – this is what we aim to achieve through these AI techniques. Creating challenging and believable enemies can be complex; they must behave like real characters, smart enough to present challenges yet not so formidable as to be invincible. We are going to use basic but sufficient AI techniques to make an AI capable of sensing its surroundings and, based on that information, making decisions on what to do, using Finite State Machines (FSMs), along with other techniques. Those decisions will be executed using intelligent pathfinding.
In this chapter, we will examine the...