This is sample Behaviour Tree and Blackkboard for Game AI. Download G-AI.unitypackage
G-AI Documentation
G-AI
Contents
1.Getting Started 3
-
Key Features 3
-
Install 3
-
Creating New Behavior Tree 3
-
Create Node 4
-
Action Nodes 4
-
Composite Nodes 4
-
Decorator Nodes 4
-
Behavior Tree Node Reference 5
-
Composite Nodes 5
- Selector 5
- Sequence 5
-
Decorator Nodes 6
- Bool Selector 6
- Repeater 6
-
Action Nodes 7
-
Blackboard 7
-
Create Blackboard 7
-
Assign Blackboard To Behavior Tree 7
1.Getting Started
G-AI is a tool used to create behavior tree and blackboard. Tool can be used to create artificial intelligence (AI) for non-player characters in your projects. While the Behavior Tree asset is used to execute branches containing logic, to determine which branches should be executed, the Behavior Tree relies on another asset called a Blackboard which serves as the "brain" for a Behavior Tree.
- Key Features
- It’s free and open-source
- Fast and simple to use
- Create quick ai
- Create own node
- Use blackboard
- Install
After the G-AI package is downloaded from the Github, import into project. That’s it!
- Creating New Behavior Tree
To create a new Behavior Tree in the project, go to Create/AI/Behavior Tree. This will create a new Behavior Tree. Double click on asset and open Behavior Tree Editor.
- Create Node
To create a node in behavior tree, click the right button and open context menu. This Context menu includes all class derived from BehaviorNode.
If you want to open search panel, press the Spacebar and open it.
- Action Nodes
Action Nodes have a input but it don’t have output. It used for action (Move Target, Attack e.g)
- Composite Nodes
Composite Nodes have a single input and multiple output. It used for selector or sequence.
- Decorator Nodes
Decorator Nodes also known as conditionals. These attach to another node and make decisions on whether or not a branch in the tree, or even a single node, can be executed.
- Behavior Tree Node Reference
The node that serves as the starting point for a Behavior Tree is a Root node. This is a unique node within the tree, and it executed every frame when tree is enable. It can have only one connection.
- Composite Nodes
Composite nodes define the root of a branch, and the base rules for how that branch is executed.
- Selector
Selector Nodes execute their children from left to right. If current child returns fail, execute the other child.
- Sequence
Sequence nodes execute their children from left to right. They stop executing when one of their children fails. If a child fails, then the Sequence fails.
- Decorator Nodes
Decorator nodes also known as conditionals. These attach to another node and make decisions on whether or not a branch in the tree, or even a single node, can be executed.
- Bool Selector
Bool Selector compares two boolean and if it’s true, nodes execute the child.
- Repeater
Repeater nodes execute child n times. It can changeable on inspector.
- Action Nodes
These are the leaves of the Behavior Tree, these nodes are the actionable things to do and don't have an output connection.
- Blackboard
A blackboard is a simple place where data can be written and read for decision making purposes. A blackboard can be used by a single AI pawn, shared by a squad, or used for any other purpose where it’s convenient to have a central place to look up relevant data. Blackboards are commonly used with behavior trees, but you could use them separately from behavior trees for convenience or you could make a behavior tree with no need of a blackboard.
- Create Blackboard
To create a new Blackboard in the project, go to Create/AI/Blackboard. This will create a new Blackboard.
Second way is, create a c# file and inherit from Blackboard class.
- Assign Blackboard To Behavior Tree
When selected the Behavior Tree, Inspector shows some settings. You can select blackboard from popup.