What is a basic structure for Wildlife?

Hey!

I want to create AIs for Wildlife, but I need some help with the basic structure. There will be different animals(deer, wolf, bear, etc.) and some of them will move in groups. So what would be the best way to manage/control a group of same type of animal? My idea is to create an ActorManager, which will have delegates, so an animal can notify the whole group to attack, flee, etc. Am I overthinking this or there is an easier/better way?

About Behaviour Trees, would it be better to create one for every animal? Or just one for animals, which will have the tasks, like roam, attack, flee, etc. and call the specific attack logic from the blueprint? Which is better to do?

I want some features(like attack) to have different logic for each animal (e.g. wolves encircle the target before attack , etc.). How would be the best to achieve this? Maybe different Behaviour tree for attacks? Or override an ‘Attack’ function in the animal’s Blueprint?

You are right to create an Object that manages multiple actors as a group, this way you can implement the group logic like fleeing at the same time or moving complete squads to another position.
You could split up the system into multiple levels though, like one master manager to hold all squads, and squads to manage individual animals. The master manager would then basicly be the ecosystem. With that done, each class (Ecosystem > Squad > Animal) will hold its own tasks and can notify the other when required through delegate bindings. What you might be looking for as well is what’s called an Abstract class (Blueprint classes can also be marked abstract). Abstract can not be spawned or placed in the world on its own, but can hold Abstract functionality to be implemented by a derived class. so you can literally have an unspawnable class “Animal” that hold the basic functionality of an animal (Walk around, Eat, Sleep, Attack) and leave the implementation to deriving classes by overriding protected functions. that’s how I’d do it. haven’t worked with behavior trees myself yet but I’d make AI reusable just like that as much as possible. AI would also best be managed by the Squad class so that group behavior isn’t calculated per animal as that would make it unnessecary complex.