Concept

Introduction to BtEngineSDK

1. Overview
2. Behavior Tree
3. Behavior Forest
4. Behavior Tree Engine

1. Overview

BtEngineSDK is a general purposed behavior tree engine development tool kit implemented for game designers who want to utilize the behavior tree concepts to model AI characters or reactive decision-making systems in Unity engine through scripting. The SDK contains the following software components:

Bt Studio a standalone visual editor application that provides GUI utilities to design and edit behavior tree and forest diagrams with node attributes, which can be saved as XML files
Bt Unity Menu a Unity Editor plugin that provides embedded Unity Editor menus to generate and setup all the required node game objects, node script components, and behavior tree structures from the generated XML files from Bt Studio
Bt Engine Scripting API a Unity plugin that provides a uniform scripting API to manage, control, and access all run time behavior tree and forest instances and properties in Unity Engine

The steps to create and run custom behavior trees in Unity Engine with BtEngineSDK include designing behavior tree and forest diagrams in Bt Studio, generating and setting up node game objects and node script components in Unity Editor through Bt Unity Menu, implementing node specific operations in each node’s script component through scripting, and finally invoking individual tree’s or group trees’ operations through scripting with the Bt Engine API. For more details, please refer to the Tutorial and Demo pages.

2. Behavior Tree

The concept of the behavior tree model used in BtEngineSDK implementation is based on the standard behavior tree node components that include Selector Node, Sequence Node, Parallel Node, Decorator Node, Condition Node, and Action Node. A Tree Root Node was added to represent the entire behavior tree and can be considered as the top level task that the whole tree accomplishes. Based on the implementation of Parallel Node, synchronization issues of multi-thread executions on Parallel Node’s child sub-trees were taken into consideration carefully. Terminologies were defined to explain synchronization and how the system works.

3. Behavior Forest

Based on BtEngineSDK implementation, the concept of a behavior forest is a group of behavior trees that share same operations and properties. All of the trees in a forest are managed to run within separated threads concurrently.

4. Behavior Tree Engine

The behavior tree engine, Bt Engine, is the top level of the entire behavior tree engine system that manages and controls the synchronization of multiple threads to perform tree execution, interruption, and property querying operations, and that provides a uniform scripting API to invoke and access individual tree’s or group trees’ operations and properties.