Hi there. I am trying to learn the EQS to improve my AI further. It’s probably one of the most confusing systems I have come upon while learning to make better AI. The documentation is good but not beginner friendly at all. So I decided to turn to the forums to guide me on the right direction.
Basically I have some AI using Behavior Trees and I need to implement a way of checking if path to target is valid because I am trying to implement an evade system like in World of Warcraft, where if the player gets into/onto some object for his/her advantage and fights the AI unfairly, the AI will change stances (not receive any damage, regenerate, etc.).
Currently I read a bit about Tests in the EQS and tried it out, and it kinda feels like where I can solve this problem. However what I’m struggling to understand is - how would I check the result of the EQS query? For example, if the player gets on top of an object/mesh and the EQS query was to fail, how would I use that as a condition in my behavior tree? Appreciate any insight/help!
First of all, EQS tend to be expensive. I would approach your problem by actually creating a custom Behavior Tree node that checks whether there’s a path from actor to actor. Something like this (the node checks if Find Paths return a partial path; in that case, it means there’s no full path between the two actors, and so it returns false):
Then you can use that as a first node in a sequence – if it succeeds the actions specified in your following nodes will be executed, otherwise the whole sequence will abort. Something like: