SkillAgentSearch skills...

SimpleBT

SBT is a basic graph view tool to develop behaviors for AI focused on easy shareable behaviors with JsonUtility.

Install / Use

/learn @RuDevOfficial/SimpleBT
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

SimpleBT - Simple Behavior Tree for Unity 6

SBT is a basic graph view tool to develop behaviors for AI focused on easy shareable behaviors with JsonUtility.

Note: This is a tool developed as a final assignment for University in 2025. This asset comes with a minimal set of features.

What are Behavior Trees?

Behavior Trees (shortened as “BTs”) are trees of hierarchical nodes that control the flow of decision making of an AI entity. Compared to FSMs these do not require programmed transitions between states, but rather flows from one node to another in a branching tree fashion.

This flow is decided by the interaction between the composite nodes, decorator nodes and execution nodes. Composite nodes can branch and determine the order in which their child nodes are executed, decorator nodes alter the result of their child node and execution nodes run actions (like moving to a new position) or conditions (checking if something is true or not).

Ticking is an essential part of this model, and every time the behavior ticks (updates) it has to return 1 of 3 states: Success, Failure or Running.

For further information you can read Michele Colledanchise and Petter Ögren's Behavior Trees in Robotics and AI An Introduction here: https://arxiv.org/pdf/1709.00084

How to Install the Package

  1. Head over the "releases" section and download the unity package.
  2. Open your Unity 6 project and then open the package
  3. Select all files and import.

Creating a Behavior

First, open the window located at the top bar called SimpleBT->Window.

SBTEditorWindow

Once open you can write a new name for the behavior and start adding nodes by pressing space or right-clicking->Create Node. A search window will show up.

Note:

  • It is required to create a Root node first before any other, and there cannot be more than 1. If you try to add another you'll get a popup
  • Behavior names can only contain numbers and '_' characters

SBTSearchWindow

Populating the Behavior

At any point you can press the button Save to save the behavior onto a JSON file which will be located in Assets->SimpleBT->GraphData.

To load the behavior you can:

  • Type the name manually first (Not recommended)
  • Select the JSON File (.simple) (Recommended)

Using the Blackboard

To create a new variable press the + icon, you can rename it by double-click. Modify its value type or content by accessing the expanded section (">" icon on the left).

Blackboard

To delete a variable select the respective field and press delete (not backspace).

Currently Supported Types

| Type | Syntax | Blackboard Method | |------------|----------------------------------------|-----------------------------------| | int | 3 | GetValue<<Type>int> | | float | 3.2 | GetValue<<Type>float> | | bool | True | GetValue<<Type>bool> | | string | something | GetValue<<Type>string> | | Vector2 | 3, 3.9 | GetValue<<Type>Vector2> | | Vector3 | 21.1, 3, 90 | GetValue<<Type>Vector3> | | GameObject | Tomato, Untagged, 391290 (Instance id) | GetComplexValue<<Type>GameObject> |

Note: Currently supported types in the SBTBlackboardGraph, any type can be stored on the Blackboard's dictionary at behavior runtime.

Generating the Tree and Blackboard

To generate the tree select a GameObject and then press "Generate". If the behavior has changed you can press "Save & Regenerate". If you want to get rid of the components you can press "Remove Components".

Generation

Available Nodes (In Sections)

<details> <summary>Ungrouped</summary>

| Name | Description | |----------|-----------------------------------------------------------------------| | Root | Acts as the tree root <br/> Must be added first before any other node | | Behavior | References a different behavior. Used for behavior nesting. |

</details> <details> <summary>Blackboard</summary>

| Name | Description | |--------------------------|----------------------------------------------------------------------| | Invert Numerical Value | Inverts a numerical blackboard value and stores it | | Remove Key | Removes a key from the dictionary. | | Store Random Position 3D | Stores a random position given a distance, layer. Stores the result. |

</details> <details> <summary>Action</summary>

| Name | Description | Section | |---------------------------------|--------------------------------------------------------------------------------------------------------|----------------------| | Destroy GameObject | Self explanatory | GameObject | | Get Random Child from Parent | Self explanatory | GameObject | | Send Message | Sends a message to all methods | GameObject | | Send Message with Value | Just like message, but with values inside parameters | GameObject | | Set Active | Self explanatory | GameObject | | Set Active (Toggle) | Self explanatory | GameObject | | Set GameObject Parent to Null | Self explanatory | GameObject | | Override Tag | Self explanatory | GameObject | | Parent GameObject to Self | Self explanatory | GameObject | | Move Navmesh Agent to Target 3D | Self explanatory | NavMesh | | Any Action | Action that can transform to any other given the correct name and values | Movement/General | | Stop | Self explanatory | Movement/General | | Flee 2D | Self explanatory | Movement/2D | | Follow 2D | Self explanatory | Movement/2D | | Go to Position 2D | Self explanatory | Movement/2D | | Linear Move 2D | Self explanatory | Movement/2D | | Flee 3D | Self explanatory | Movement/3D | | Follow 3D | Self explanatory | Movement/3D | | Go to Position 3D | Self explanatory | Movement/3D | | Override GameObject Position 3D | Self explanatory | Movement/3D | | Look At Target | Self explanatory | Rotation | | Rotate Degrees 2D | Self explanatory | Rotation/2D Specific | | Rotate Constantly 2D | Self explanatory | Rotation/2D Specific | | Rotate Degrees 3D | Self explanatory | Rotation/3D Specific | | Rotate Constantly 3D | Self explanatory | Rotation/3D Specific | | Wait X Seconds | Self explanatory | Time

Related Skills

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated9mo ago
Forks1

Languages

C#

Security Score

77/100

Audited on Jun 22, 2025

No findings