We have been discussing AI and have 2 options of sharing variables across multiple AI with different blackboards. Our AI will be wandering around waiting (Flocking) or coming straight for the player. Can be up to 10 groups x 10 enemies scattered around per level that will be active at one time for arguments sake. Each AI Character will have Local Variables to reference their group.
Each group will need to share the following variables for different behaviors:
- Vector: TargetLocation
- Bool: PlayerSeen
- Bool: HasLeader (Used for different types of flocking behaviors)
- Bool: CanFlee
First option is having is having each AI Character having their own Local variables of each of these. To share the information we will have each AI character iterate in their behavior tree through their local group array and look for each variable they need at any given time. This will of course need to have cast to the BaseEnemy to search for the variable.
The other Option is to have each AI character use a blackboard. So the same as option one they will need to search through their array but in this case they wont need to cast to BaseEnemy, but in turn have to search each actors blackboard and find the variable through the LiteralSearch option.
We don’t really know the ins and outs of UE4 engine and how it works so working out which is faster is a little difficult. Any help will be greatly appreciated.
Hopefully that all makes sense!