In this lesson, you will learn how to activate the Environmental Query System (EQS) and configure your project settings to allow your AI agents to perform complex spatial reasoning.
Enabling the EQS Plugin
The Environmental Query System is a powerful tool that allows your AI to "ask" the game world questions, such as "Where is the best hiding spot?" or "Which power-up is closest to me?" Because EQS is technically considered an experimental feature in Unreal Engine, you must first enable it manually.
- Navigate to Edit > Plugins.
- Search for Environmental Query System.
- Check the Enabled box and restart your editor when prompted.
Configuring Project Settings
Once the plugin is active, you need to grant the AI system permission to utilize these queries. Without this setting, the engine will ignore your EQS assets during runtime.
- Go to Edit > Project Settings.
- Search for Environment Query System.
- Check the box labeled EQS Querying Enabled.
This setting acts as a master toggle that tells the AI controller it is allowed to perform spatial data gathering. Once enabled, you can create new EQS assets by right-clicking in your Content Browser and navigating to Artificial Intelligence > Environment Query.
How it Works
Think of EQS as a structured search engine for your game world. When your Behavior Tree runs an EQS query, the system generates a set of candidate points (such as a grid or a circle of points around the AI) and then runs a series of "Tests" on those points.
For example, if you want your AI to find cover, you would configure an EQS asset to:
- Generate: Points in a circle around the AI.
- Test: Trace line-of-sight to the player (filtering out points where the AI can be seen).
- Score: Weight the remaining points based on distance, preferring points closer to a "Cover" tag.
By configuring these settings, you transition from basic pathfinding to true environmental awareness.
Key Takeaway: Enabling the EQS plugin and its project setting is the mandatory first step to transforming your AI from simple navigation agents into intelligent observers that can make decisions based on the geometry of their surroundings.