Behavior Tree User Guide

This document will cover the most common workflows encountered while working with Behavior Trees.

Creating Behavior Tree Assets

Creating a Behavior Tree

You can create a new Behavior Tree by using the Content Browser.

newBT.png

  1. In the Content Browser, left-click the New button.

  2. Select Behavior Tree in the Miscellaneous category.

Creating a Blackboard

You can create a Blackboard Asset using the Content Browser.

newBB.png

  1. In the Content Browser, Left-click the New button.

  2. Select Blackboard in the Miscellaneous category.

Or, if you have started to edit a Behavior Tree (or simply want a new Blackboard for the Behavior Tree), you can click the New Blackboard button in the Behavior Tree Editor (while in Behavior Tree Edit Mode).

NewBBinBTE.png

Creating a Task (Blueprint)

  1. Click the New Task button in the Behavior Tree Editor (while in Behavior Tree Edit Mode).

  2. Choose a Behavior Tree Task class to inherit from, BTTask_BlueprintBase is the default "blank" class.

  3. The new Task Blueprint will be created in the same folder as your Behavior Tree asset.

Creating a Decorator (Blueprint)

  1. Click the New Decorator button in the Behavior Tree Editor (while in Behavior Tree Edit Mode).

  2. Choose a Behavior Tree Decorator class to inherit from, BTDecorator_BlueprintBase is the default "blank" class.

  3. The new Decorator Blueprint will be created in the same folder as your Behavior Tree asset.

Creating a Service (Blueprint)

  1. Click the New Service button in the Behavior Tree Editor (while in Behavior Tree Edit Mode).

  2. Choose a Behavior Tree Service class to inherit from, BTService_BlueprintBase is the default "blank" class.

  3. The new Service Blueprint will be created in the same folder as your Behavior Tree asset.

Editing a Blackboard

You can edit a Blackboard by either Double-clicking it in the Content Browser to open it in the Behavior Tree Editor:

BBAsset.png

Or by switching a currently opened Behavior Tree Editor to Blackboard Edit Mode:

blackboardMode.png

Add Keys

  1. Click the New Key button.

  2. Select the type of Key to add.

  3. Adjust the name of the Key.

Remove Keys

  1. Select the Key you wish to remove.

  2. Press the Delete key.

Renaming Keys

  1. Select the Key you wish to rename.

  2. Right-click and select Rename (or press F2).

  3. Enter a new name for the Key.

Object Key Specifics

Object Keys are special in that you can change their specific type. This enables you to store any type of data that inherits from Object (such as Actors) in them.

As some Decorator and Service functions require Actor Keys, this is how you change an Object Key into an Actor Key.

  1. Select an Object Key

  2. In the Details Panel, expand the Key Type property.

  3. Change the Base Class property to the desired Object Type.

Editing a Behavior Tree

You can edit a Behavior Tree by either Double-clicking it in the Content Browser to open it in the Behavior Tree editor:

btAsset.png

Or by switching a currently opened Behavior Tree Editor to Behavior Tree Edit Mode:

btMode.png

Setting the Blackboard Asset to Use

  1. Select the Root node of the Behavior Tree (or deselect all nodes)

  2. In the Details Panel, set the Blackboard Asset to the desired Blackboard.

settingBB.png

Adding a Node (Composites and Tasks)

  1. Right-click in the Behavior Tree Graph area to bring up the context menu.

  2. Select the node you wish to add from the context menu.

newNode.png

Removing a Node

  1. Select a node by left clicking it.

  2. Press the Delete key.

Connecting Nodes

Connecting nodes in a Behavior Tree is much like connecting pins in a Blueprint. However, the primary difference is direction of the connection matters: you can only connect an output pin to an input pin.

To connect nodes:

  1. Left-click and hold on output bar.

  2. Now drag the cursor to an input bar.

  3. Release the left mouse button.

connectNodes.png

Breaking Connections

  1. Right-click on a connection bar to bring up the context menu.

  2. Select "Break Link(s)"

context1.png

Or

  1. Alt + Left-click on a connected bar.

Editing Node Properties

  1. Left-click to select a node.

  2. Adjust the node properties using the Details panel.

Adding Decorators and Services to Nodes

newDecSer.png

  1. Right-click a Composite or Task node to bring up the context menu.

    Right-clicking on the left or right edges works the best.

  2. Select a Decorator or Service you want to add to the node.

Removing Decorators and Services from Nodes

  1. Select a Decorator or Service on a node by Left-clicking it (the Decorator or Service will gain a redish outline).

    selectDec.png

  2. Press the Delete key.

Editing Decorators and Services

  1. Select a Decorator or Service on a node by Left-clicking it (the Decorator or Service will gain a redish outline).

    selectDec.png

  2. Adjust the Decorator or Service properties using the Details panel.

    details.png

Composite Decorator Specifics

Double-click a Composite Decorator to bring up the Composite Decorator's graph.

The Composite Decorator graph works like a simple Blueprint, but only deals with the True/False returns of the various Decorators available to the Behavior Tree.

compositeEdit.png

Editing a Task (Blueprint)

You can Double-click a placed Task node in the Behavior Tree editor to open it in the Blueprint Editor.

Or you can Double-click the Task in the Content Browser.

Editing a Service (Blueprint)

You can Double-click a placed Service in the Behavior Tree editor to open it in the Blueprint Editor.

Or you can Double-click the Service in the Content Browser.

Editing a Decorator (Blueprint)

You can Double-click a placed Decorator in the Behavior Tree editor to open it in the Blueprint Editor.

Or you can Double-click the Decorator in the Content Browser.