Hello, after days of nearly going crazy with Behavior Trees i decided its best to post here
Anyway. All the behavior and functionality im trying to achieve is for a Simulation game, clearing that out of the way so its easier to understand later on
Im trying to create a behavior tree for my Customers ( Simple AI Bots with a character and AI Controller class ) in which they will:
Once Spawned go to the tavern, Try to find a available seat, if found go to said seat and then order a drink and do absolutly nothing else
If no seat was found, randomly wander in the tavern and eventually engage on a fight with a customer that has a seat
I got all the code and tasks written down but my main issue is with the layout of the tree itself . and So i currently have my Behavior Tree like this
Not the cleanest but so far its mostly working, Once a customer is spawned it runs the Move To The Tavern and wander sequence ( Set blackboard key , move to said blackboard key vector, random chance to wander)
Then Take a seat and order a drink is called since the sequence was succesfull (Get avaiable seat, if succesful move to it and order a drink, else fail the sequence and move into Wander and try to pick a fight )
Now this is functional up until i want my pawn to leave the Wander and try to pick a fight sequence, since when a fight has ended the pawn is still looping on the Wander and try to pick a fight sequence, Also i had to loop this sequence once the player enters becouse if not when BTTask_TryToPickAFight has ended it “fails back” to the selector .
Essentialy im trying to lock the Customer into the Wander and Try to pick a fight sequence when certain conditions are met (Doesnt has a seat, cant find an available one ) and Force him out of said sequence when other conditions are met (If a seat is available, go to the take a seat and order drink sequence )
I tried using blackboards, services etc but i still cant nail a right layout for my tree. Closest i got to a “Only go trough this sequence if X is met” was using a blackboard decorator and abort my sequence if the condition wasnt met instead of just "Dont go trough here "
Any help is always appreciated!