Behaviour tree for multiple targets

Hi everyone,

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?


Anyone? I’m quite stuck on this. I’ve looked into the parallel node but that seems to stop as soon as the main task finishes, or waits for the alternative task to stop running before running again entirely. That’s not what I need. I need the two weapons to work completely independent from each other.

So I noticed you can hack around the issue but putting all the functionality of the task in a service, but this does not seem to be the way forward. Is this really the only way to execute two tasks simultaneously and independent from each other?