Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BTFGO - Behavior Tree for GameObjects

Simple behavior tree system for unity with a viewer.

Viewer

BTFGO comes with a behavior tree viewer that utilizes unity's experimental GraphView which is still supported in Unity 6. If unity removes GraphView in future versions I will update this project to use an alternative ui system.

The viewer works in edit time as well as at runtime. During edit time, it shows your current tree and updates live as you make changes. During run time, nodes are color coded to show the current evaluation status of each node.

The viewer can be accessed clicking "Tools" > "Behavior tree for gameobjects" or by clicking "Open Tree Viewer" in the inspector for any "Behavior" component.

Design Philosohpy

This project is designed specifically for unity and tries to work with it instead of around it. There is very minimal abstraction and the Node class is just a monobehavior. This means you can use any monobehavior functions in any node.

This also means nodes are just gameobjects that you add in the inspector.

Simple and concice codebase, very minimal and careful use of inheritance so you don't have to dig through 54 layers of classes to understand or modify the code. There is only one layer of inheritance that you have to work with, the Node class.

I initially wanted the project to be completely component based but opted for the current design instead because it allows users to add custom actions and features by simply inheriting from Node. With the composition design, users had to reference the node component and then assign a function to its "NodeEvaluateFunction" delegate. Not good.

To Do

Features

  1. Allow assigning exact number of children instead of just max child limit
  2. Warn/Error for when the child count doesn't match the assigned limits
  3. Focus on gameobject in hierarchy when clicking associated Visual Node

Bugs to fix, don't look here

  1. When moving branch on X axis based on branch width, only the root of the branch and the children are moved. The input branch of the root should be moved as well.

About

flexible and simple behavior tree system for unity that utilizes gameobjects. Extremely simple to modify and not buried in 10 layers of inheritance.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages