Introduction
This chapter will show you how to add a bit of intelligence into your game. However, this does not mean that your game characters will be able to behave like real-life people. Instead, they will be able to handle specific situations with a predefined set of rules. This adds a realistic-looking behavior to the game characters.
The earlier games used a simple mechanism with static environment and static movement paths. Nonplayer characters or NPCs could move only along certain paths and couldn't handle changes in the game environment. You could see this in the Super Mario Bros series.
The next step in artificial intelligence was introduced in 3D action games such as Doom. NPCs always try to approach the player character after they've been alarmed about the player's presence. But still, they can't handle the simplest obstacles. A certain level of intelligence is emulated with special skills to make the games more challenging.
Modern games use a static or dynamic set of paths to move...