I have a building in my game that is responsible for extracting minerals from nearby rocks. Technically, it’s an actor that has a MiningComponent attached that is responsible for spawning the beams and extracting the minerals from the rocks. The behaviour tree for this actor is very simple:
The service and the task are called on the actor which implements a Targetable interface to provide access to the MiningComponent. Now I want to add some defensive capabilities to the miner. I have a ProjectileLauncherComponent that is capable of spawning bullets and dealing damage to attackers that get too close. Suddenly, the behaviour tree needs to deal with two separate turrets that have different targets and operate completely independent from each other. How can I capture the behaviour for both in the tree? What would be the best way to approach this problem?