Skip to content
TECHNICALLYARTIST
FAB

Behavior Tree

The minion’s loop runs on a Behavior Tree. The plugin ships BT_Extract_Resource (with blackboard BB_Extract_Resource), wired to call the Gatherer Component functions in the right order. You assign the tree per order in the Assignment Definitions data asset, so different orders can run different trees.

BT_Extract_Resource walks the minion through one full trip:

  1. Set the home location so the minion knows where to haul resources back to.
  2. Find the nearest matching resource within the search radius that the minion can navigate to.
  3. Move to that resource.
  4. Try to extract it, then wait for the timed harvest to finish.
  5. Spawn the carried resource and attach it to the minion’s hand socket.
  6. Move home.
  7. Drop the carried resource so it settles on the pile.

Then the tree loops and the minion goes back for the next one.

Each step maps to an included task and a Gatherer Component function:

TaskCallsPurpose
BTT_Set_Home_Locationsets the homeRecords where harvested resources are hauled.
BTT_Find_Resource_LocationTry Find Closest Resource ActorPicks the nearest reachable matching resource.
BTT_Try_ExtractTry Begin Extracting Overlapping ActorStarts the timed harvest and waits for it to complete.
BTT_Try_Spawn_Extracted_ResourceTry Spawn Extracted Resource And Attach To CharacterPuts the carried resource in the minion’s hand.
BTT_Drop_Extracted_ResourceDetach Extracted Resource From CharacterDrops the resource onto the home pile.

The BT_Extract_Resource behavior tree: a Sequence running Find Resource Location, Go To Resource, and Try Extract

You have two ways to change behavior:

  • Edit the tree. BT_Extract_Resource is an ordinary Behavior Tree; add decorators, services, or extra branches (idle animations, patrols, reactions) around the existing tasks.
  • Swap the tree per order. Because each assignment names its own Assignment Behavior Tree, you can write a completely different tree for a given order and point that entry at it.

Either way, the Gatherer Component exposes every step as a callable function, so your custom tasks can reuse the same building blocks the included tree does.