← All namespaces

eqs

AI & gameplay Experimental

Author Environment Query System assets: generators, tests, contexts.

What it’s for

The Environment Query System (EQS) is how Unreal AI answers spatial questions at runtime: "where is the nearest cover?", "which of these points can see the player?", "where can I stand that is close but not too close?". Each answer comes from an EQS Query asset that generates candidate points or actors, then filters and scores them. This namespace builds those assets from your assistant, so you can describe the query in plain language instead of clicking through the EQS editor.

You use it to create a query, add a generator (the source of candidate items), stack tests on that generator to filter and rank the results, and point the generator and tests at the right context classes (the "from what" of a query, such as the querier or a target actor). Filter and scoring details on each test are set separately, so you can tune how harshly a test rejects items and how it weights the survivors.

Keep eqs.* to query-asset authoring. The behavior trees that actually run these queries, via the Run EQS Query task, are built with behavior_tree; reach for that sibling namespace when you want to wire a finished query into an AI's decision logic.

This area is experimental. It works today for the common generator, test, and context authoring flows, but the surface and some field shapes are still changing, and a few options (such as scoring curves) are rejected on UE 5.6. Expect rough edges and check results after each change.

Examples

Create a query that scores points by distance

Stand up a fresh query, add a grid of points around the querier, and rank them by how near they are.

You: Make an EQS query that scans a grid around the AI and prefers nearby points.

  call("eqs.create", {name:"EQS_FindNearby", path:"/Game/AI/EQS"})
    → {ok:true, queryPath:"/Game/AI/EQS/EQS_FindNearby"}
  call("eqs.add_generator", {queryPath:"/Game/AI/EQS/EQS_FindNearby",
        generatorType:"SimpleGrid"})
    → {ok:true, generatorIndex:0}
  call("eqs.add_test", {queryPath:"/Game/AI/EQS/EQS_FindNearby",
        generatorIndex:0, testType:"Distance", purpose:"score", save:true})
    → {ok:true, testIndex:0}

Done. EQS_FindNearby generates a grid and scores it by distance.

Tune how a distance test weights results

Set the scoring equation and factor on the test so closer points win, and clamp the range.

You: On that distance test, prefer closer points and cap the score range.

  call("eqs.set_test_scoring", {queryPath:"/Game/AI/EQS/EQS_FindNearby",
        generatorIndex:0, testIndex:0,
        scoring:{equation:"InverseLinear", factor:1.5, clampMin:0, clampMax:2000},
        save:true})
    → {ok:true}

Done. Nearer points now score higher, clamped to 0–2000.

Filter out points that fail a range test

Add a test purely as a filter and give it a numeric range, so out-of-band points are discarded.

You: Reject any point closer than 200 or farther than 1500 units.

  call("eqs.add_test", {queryPath:"/Game/AI/EQS/EQS_FindNearby",
        generatorIndex:0, testType:"Distance", purpose:"filter"})
    → {ok:true, testIndex:1}
  call("eqs.set_test_filter", {queryPath:"/Game/AI/EQS/EQS_FindNearby",
        generatorIndex:0, testIndex:1,
        filter:{kind:"float_range", min:200, max:1500}, save:true})
    → {ok:true}

Done. Points outside 200–1500 units are filtered out.

← Back to all namespaces