Chapter 4: Implementing Sensors
As we discussed in the previous chapter, a character AI system needs to be aware of its surrounding environment. For example, Non-Player Characters (NPCs) need to know where the obstacles are, the direction the player is looking, whether they are in the player's sight, and a lot more. The quality of the AI of our NPCs depends, for the most part, on the information they can get from the environment. Sensor mistakes are apparent to the player: we've all experienced playing a video game and laughing at an NPC that clearly should have seen us, or, on the other hand, been frustrated because an NPC spotted us from behind a wall.
Video game characters usually get the input information required by their underlying AI decision-making algorithms from sensory information. For simplicity, in this chapter, we will consider sensory information as any kind of data coming from the game world. If there's not enough information, characters might show...