Gathering information with sensors
An AI works first by gathering information about its surroundings and then analyzing that data to choose an action. At this point, the chosen action is executed. As you already know, we cannot do anything without information, so let's start with that. There are several sources of information our AI can use, such as data about itself (life and bullets) or maybe some game state (winning condition or remaining enemies), which can easily be found with the code we've looked at so far. However, one important source of information is the AI's senses. Based on the needs of our game, we might need different senses such as sight and hearing, but in our case, sight will be enough, so let's learn how to code that.
In this section, we will examine the following sensor concepts:
- Creating Three-Filters sensors with C#
- Creating Three-Filters sensors with Visual Scripting
- Debugging with Gizmos
Let's start by learning...