Using EQS in Behavior Trees

I’m looking for a way to incorporate my EQS tests into my Behavior trees but am having a bit of a problem grabbing some of the data related to the character performing the test. I have made my variable in the EQS test able to be set via a named value, Specifically Team.

UPROPERTY(EditDefaultsOnly, Category = Team)
FEnvIntParam Team;

But when I go to actually use the test in a behavior tree, It expects a literal value. Is it possible to set this to a blackboard value or call the eqs test from within another task or service? Assuming this is even possible, Would I have to create a custom generator to pass a blackboard value to the ActorsOfClass generator? Specifically Radius so I can set it to the AI’s vision radius?

As an addition to this is it possible to call this EQS call as a service rather than a task? My task is specifically looking for enemies within range and choosing the closest one so having it as a “background process” would be best as it would allow targets to be updated every 0.5 seconds or so as well as allowing path-finding weights to be adjusted at the same time in case an ally is blocking the path (assuming the PathLength from querier test includes avoidance).

If you need team information while performing test why not grab it directly from the querier during the actual RunTest call? Or am I missing something?

Reading AI senses properties, blackboard values and what not will be possible with EQS’ upcoming change.

Regarding running EQS queries in a Service rather than a task, sure you can do that, but you’ll need to implement that service yourself. Or wait for us to do it (should be really easy, I might be able to squeeze it in soon).



I got the Targets team but didn’t think to get the querier’s team. I guess that would solve the issue. We are only working on release builds so I’ll look into creating the service EQS call for now.

What’s changing in EQS that would make it impossible to read blackboad and AI senses? Something like sight radius ties in so nicely. I guess we could always hard-code checks in to the c++ but it seems a bit more limiting.

Reading AI senses properties, blackboard values and what not will be possible with EQS’ upcoming change.

I meant whatnot :slight_smile: That will totally be possible. And easy!

Just as a quick follow up, the context helpers confuse me a bit. What are they for? My first thought was to call QueryInstance.Owner.Get() and cast it. But I see you using a UEnvQueryContext_Querier.

Query instance’s owner doesn’t have to be a pawn, or even an actor. It’s someone or something (like an AI subsystem) that asked EQS to process the query, and is probably interested in the results, but it doesn’t have to be the “querier” which in EQS terms means it’s the actor that’s the logical “center” of the query, as if it was that actor that asked the question.