Environment Query System
The Environment Query System (EQS) allows the AI to find positions in the world, such as roaming spots or tactical cover, and use them for dynamic decision-making.
Overview
The Environment Query System (EQS) provides the enemy AI with a powerful way to evaluate the game world and choose positions based on context. Instead of relying on static waypoints, enemies can run EQS queries to locate suitable destinations — for example, random roaming points, cover spots, or areas near a target.
These queries can be referenced directly from the behaviour tree, giving each enemy type flexible and context-sensitive movement. By customising EQS queries, you can easily adjust how different enemies explore or take tactical decisions, making their behaviour feel less predictable and more engaging for the player.
Roaming
When roaming, the agent uses environment queries from Unreal Engines built in Environment Query System (EQS). Regarding, the roaming query, the EQ is cofigured to select points projected on the navmesh, which are then scored by the distance to the querier. At the end a random point from the top 25% of the queries results is selected.

Other properties of the Roaming Query, such as the minimal or maximal ranges can be configured directly within the enemy config.
Investigating
When investigating a location, the agent also uses environment queries from Unreal Engines built in Environment Query System (EQS). Unlike the Roaming Query, the Investigation Query performs an additional check on possible movement positions. It uses tracing to ensure that the next position is not currently in sight.

This is very useful, since when investigating something, the agent should always strive to explore areas it hasn't yet. Therefore, the agent prefers positions that are currently out of sight. Again, it randomly selects one of the top 25% of positions for the agent to move to.
Environment Query Contexts
To make the AI pathfinding more realistic, we used custom EQS Context (EQSC) assets to provide custom data for our queries before they are performed on the nav mesh. Below, you will find a table listing all contexts, describing what they do and showing where they are used.
EQSC Investigate Center
Provides the origin for an environment query, based on the investigation center set in the blackboard of the performing agent.
EQSC Roam Query Center
Provides the origin for an environment query, based on the roaming center set in the blackboard of the performing agent.
Last updated