Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Learning Environmental Query System for efficient AI

After spending several weeks now designing AI, it was brought to my attention that a lot of the heavy lifting in logic and decision making for AI can be swapped out for queries to the Environmental Query System. Initially I was intimidated due to time constraints, but after spending some time going over several videos I made the decision to start to convert several systems over to use the system.


Adding these 2 queries has improved the efficiency of the perception system heavily. The Behavior Tree logic did not require any changes, however the AI Controllers needed to no longer set the blackboard values for the perception.

The queries are very basic to create and implement, the first being a very simple capture of the player's current location vector:

The next is a very simple replacement for the Hearing Perception functions from the AI Controller to return the Actor Heard:

Last, but not least is the query replacing the Sight Perception functions from the AI Controller to return the Actor Seen:

These are just a scratch into the surface of the system, but as I learn more about it, I will be implementing more functionality to improve the gameplay for AI combat decisions. There are ways to setup queries for the AI to be aware of one another and "take turns" when attacking the player, or flanking and circling them. There are ways to implement dodging and other fun movement elements to the combat. I look forward to exploring the possibilities going forward into the Beta build to improve the overall feel to the combat from the AI side of things.

My biggest hurdle in stepping into the  EQS system was entirely my lack of confidence in my experience with Unreal Engine. I have been pleasantly surprised that the system is relatively intuitive and makes Behavior Trees seem like they will be less intimidating as I move further into developing more interesting AI combat.

author: Clinton Butler
Posted on 5/19/2023

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.