Skip to content

Environment Queries

import { Aside } from ‘@astrojs/starlight/components’;

The Environment Query System (EQS) lets AI characters query the world for locations or actors that satisfy spatial and gameplay conditions. BlueprintAI can create EQS query assets, add generators and tests, and configure their properties.

Create an Environment Query called EQQ_FindCover in /Game/AI/EQS

Generators produce the set of candidate locations or items that tests will filter.

Add a Points: Grid generator to EQQ_FindCover with a grid size of 1000 and spacing of 150 Add an Actors of Class generator targeting BP_CoverPoint

Common generators: EnvQueryGenerator_SimpleGrid, EnvQueryGenerator_ActorsOfClass, EnvQueryGenerator_PathingGrid, EnvQueryGenerator_Donut, EnvQueryGenerator_CurrentLocation, EnvQueryGenerator_OnCircle.

Tests score or filter the candidates produced by generators.

Add a Trace test to check line of sight from the querier to each candidate Add a Distance test that scores closer candidates higher with a max distance of 2000 Add a Dot test to prefer candidates in front of the querier

Common tests: EnvQueryTest_Trace, EnvQueryTest_Distance, EnvQueryTest_Dot, EnvQueryTest_Overlap, EnvQueryTest_Pathfinding, EnvQueryTest_GameplayTags.

Set the scoring factor on the Distance test to 1.0 Set the filter type on the Trace test to Minimum (discard items that fail) Set the scoring equation on Distance to InverseLinear