Giter VIP home page Giter VIP logo

sterberino / open-behavior-trees Goto Github PK

View Code? Open in Web Editor NEW
20.0 1.0 1.0 549 KB

"A collection of behavior tree scripts for developing game AI."

Home Page: https://sterberino.github.io/open-behavior-trees-documentation/index.html

License: MIT License

C# 100.00%
ai artificial-intelligence behavior-tree decision-trees game-ai game-design game-development game-logic unity unity-asset unity-framework unity-package unity-plugin unity3d game-ai-framework

open-behavior-trees's Introduction

OpenBehaviorTrees

A collection of behavior tree scripts for developing game AI.
More extensive documentation created using DocFX can be found here.

How to Get Started

The first thing to do is add the behavior tree component to a GameObject

Behavior Tree Component

You will be presented with a button that allows you to create a new tree from a Behavior Tree Root node

Create New Tree

Once you have created your new tree, you will be presented with the option to open it.

Open Tree

The Node Editor Window

You will be presented with a node editor window for managing and editing Behavior Trees. In the node editor, you can zoom using the scroll wheel, move around using the mouse, and select nodes for inspection. You can also select multiple nodes simultaneously by holding shift.

Open Tree

Multi-Drag

You can also copy and paste nodes by right-clicking to open a context menu:

Copy-Paste

Nodes List

You can view all placeable nodes by opening the Nodes List sidebar. All non-abstract node types will be visible in this window, including any nodes that you create that inherit from the BehaviorTreeNode class. Also in the window will be any existing behavior trees you have created, which can be placed as a sub-tree. This helps with modularity and readibility of trees. You may search for nodes using the searchbar at the top of the nodes list view.

Nodes List

Inspector

The Inspector window works exactly like the Unity's built-in inspector window. You may also set an icon for a Node type, which will be visible in the project window and on the nodes in the Node Editor Window.

Inspector

Final Notes

  • Any changes made to the tree will only be applied by using the save button.
  • Standard behavior tree node types are available, such as Selector, Sequencer, Inverter, Always Fail, and more.
  • Also available is a UtilitySelector node, for implementing Utility AI/ GOAP behaviors. Children of UtilitySelector must inherit from UtilityEvaluator.
  • Scripts are contained in the OpenBehaviorTree namespace.
  • More Information about the blackboard can be found Here
  • More detailed documentation can be found here

open-behavior-trees's People

Contributors

sterberino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

mishterkirby

open-behavior-trees's Issues

NullReferenceException whenever trying to save a blackboard in Unity 2023

When using Open Behavior Trees under Unity 2023.3.0b2, the following output gets generated when clicking save on a behavior tree blackboard

NullReferenceException: Object reference not set to an instance of an object
OpenBehaviorTrees.BehaviorTreeEditorUtilities.GenerateAssetCopy (OpenBehaviorTrees.BehaviorTreeNode currentNode, OpenBehaviorTrees.BehaviorTreeNode parent, System.Collections.Generic.Queue`1[T] order) (at ./Library/PackageCache/com.sterberino.open-behavior-trees/Editor/BehaviorTreeEditorUtilities.cs:231)
OpenBehaviorTrees.BehaviorTreeEditorUtilities.GenerateAssetCopy (OpenBehaviorTrees.BehaviorTreeNode currentNode, OpenBehaviorTrees.BehaviorTreeNode parent, System.Collections.Generic.Queue`1[T] order) (at ./Library/PackageCache/com.sterberino.open-behavior-trees/Editor/BehaviorTreeEditorUtilities.cs:215)
OpenBehaviorTrees.BehaviorTreeEditorUtilities.GenerateAssetCopy (OpenBehaviorTrees.BehaviorTreeNode currentNode, OpenBehaviorTrees.BehaviorTreeNode parent, System.Collections.Generic.Queue`1[T] order) (at ./Library/PackageCache/com.sterberino.open-behavior-trees/Editor/BehaviorTreeEditorUtilities.cs:224)
OpenBehaviorTrees.BehaviorTreeEditorUtilities.GenerateTreeFromNode (OpenBehaviorTrees.BehaviorTreeNode node) (at ./Library/PackageCache/com.sterberino.open-behavior-trees/Editor/BehaviorTreeEditorUtilities.cs:110)
OpenBehaviorTrees.BehaviorTreeEditorWindow.Save () (at ./Library/PackageCache/com.sterberino.open-behavior-trees/Editor/BehaviorTreeEditorWindow.cs:1071)
OpenBehaviorTrees.BehaviorTreeWindowHeader.Render (UnityEngine.Rect position, System.Single sidebarWidth) (at ./Library/PackageCache/com.sterberino.open-behavior-trees/Editor/BehaviorTreeWindowHeader.cs:63)
OpenBehaviorTrees.BehaviorTreeEditorWindow.OnGUI () (at ./Library/PackageCache/com.sterberino.open-behavior-trees/Editor/BehaviorTreeEditorWindow.cs:235)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.