Attack behavior Update
I've spent the past 2 weeks improving the combat behavior tree. I added another Selector to check if the character is in a new location before running an EQS. This was previously causing inconsistency because the EQS was running multiple times in the same cover location. Having a selector makes sure that I can call the same location to shoot from every time until he moves. The AI character will now also aim at the player during transitions to make it look more realistic.
Finally I added another branch to pursue the player once they are a certain distance away. If line of sight is broken, a ghost character will be created to represent the last known location and the AI will head towards where it "thinks" the player is. When the AI gets to a last know location and can't find the player I will add the "caution" state after this point to make all the AI search the area.
Distance check
To check the distance from the character I got the location of both the AI minus the location of the player. This is then converted to get the vector length as a Float value and used as the first check in the combat selector. If the AI is more than 1000 units away he will chase the player.
After that there is a spiders web of Bool checks to determine if the character is in cover and can see the player to select the other tasks.The selector is fired using AI Tick so I have broken each state change into an event with a Do Once node to stop them firing out of turn. This has taken a lot of debugging but seems to work pretty well now.
Behavior tree progress
Update video
I still have a few issues to fix with the movement and I need to add actual shooting to the combat, but I aim to have it done by this week so that I can move on to Caution and finish up the AI. The debugging is slowing me down a lot as there is so much that can go wrong with a complicated system like this.