Perception System
Basic info about perception system in AI Tree
Perception System is a system that allows game characters (NPCs or AI) to perceive the environment and react to various stimuli. It simplifies AI development by providing tools for detecting other characters, objects, or sounds, and allows NPCs to make decisions based on these perceptions.
Key Aspects of the Perception System:
Sensing Components:
The core of the Perception System consists of special components added to game characters. The primary component is AIPerception component, which handles perception and collects data about stimuli coming from different sources.
Stimuli Sources:
Stimuli sources are objects or events that can be "perceived" by the AI character. This could be another character in the NPC’s field of view, a sound such as gunfire or footsteps, or a scent left by an object. To be detectable, an object must have the AIPerceptionSource Component added.
Sensing Types:
Sight: One of the most commonly used perception types. AI can detect characters or objects in its line of sight.
Configuring Perception:
For each type of perception, you can configure parameters such as range, field of view angle, perception update frequency, and sensitivity to different types of stimuli. For example, for sight, you can define the field of view angle (e.g., 90 degrees) and the sight range (e.g., 500 units).
Perception Events:
When AI perceives an object, it can trigger an event processed in the game logic. For instance, upon detecting an enemy or hide.
Sense Memory:
NPCs can remember objects or stimuli they perceived earlier. For example, if an enemy goes out of sight, AI can continue tracking the enemy based on the last known location.
Integration with Behavior Tree:
The Perception System integrates closely with Behavior Trees, allowing perception to serve as triggers for initiating or altering AI behavior.
Ease of Use: A user-friendly tool for adding perception to AI, reducing the complexity of development.
Customizability: The ability to finely adjust perception parameters to meet specific needs.
Integration with other systems: Easy integration with Behavior Trees and other AI systems.
Example of Using the Perception System:
Imagine an NPC patrolling a specific area. Using the Perception System, you can configure the NPC to notice enemies entering its line of sight and start chasing them. If the enemy escapes the NPC’s sight, the AI can remember the last known location and continue searching in that area. Additionally, if the enemy makes noise (e.g., footsteps or gunfire), the AI can turn toward the source of the sound and investigate.
The Perception System in AI Tree is a powerful and convenient tool for developing complex, adaptive AI. It allows characters to "see", and respond to stimuli in the environment, providing dynamic and realistic behavior for NPCs in the game.
Last updated