I would like to let the AI know where the players and the flags are, should I use Game State, Blackboard or EQS for this?
The Blackboard was my first choice, but there is no support for an array of player locations or object locations. They say you can create your own class with all the needed information in it. But then I feel like I’m duplicating GameState.
The forums say
To Make Efficient Event-Driven Behaviors Changes to the blackboard
can throw events to change the flow in
the behavior tree without having to
update every frame to check the value.
I’ll have more details about this in a
separate section of Behavior Tree
documentation (and I’ll link from here
once that’s ready).
So… having a Blackboard would be better to prevent polling the location of the flags everytime they change? Or I should just store an array of each object class and work the intelligence of wether the AI knows or doesn’t know this information?
That’s an option, but currentTarget should be in the AIController as well if different AI might target different players on whatever criteria. See the edit for another example in which this might not be a good solution.
On second though while writing it. I do think it’s a much better solution to store all these informations in the AIController and work the behaviour tree diferently.
Hi, couldn’t you store this data in the AI Controller ? You could then choose which player your AI is currently interacting with inside the controller and then set any player as the “currentTarget” in the Blackboard ?
If this doesn’t help, what do you want your AI to do with these players ?
From what I understand of your example, you could still use the Controller. At the start of the game, just populate an array of players / flags references so you can acces their data anytime without having to search for them again. You could also store your currentTarget in it as well as in the blackboard and just fire an event to update it in the blackboard only if its value changes in the Controller.
If this is not what you want then I think I didn’t understand your problem ^^
You are using one blackboard asset but each AI has its own AIController and also its own version of the blackboard. They do not share the informations inside it, each AI will run its own behaviorTree, blackboard etc …
You did. Just correct me if I’m wrong: If I set the target to follow in the blackboard, since all AI have the same blackboard, wouldn’t they all follow the same player? Thus, shouldn’t currentPlayer also go in the controller? Or you’re assuming that each IA has it’s blackboard? If so, why use a blackboard at all?