#I made a Behavior Tree package for Unity

1 messages · Page 1 of 1 (latest)

supple tide
#

Hey guys, I just finished creating a package for Unity for Behavior Trees. It's MIT-License/ Open source, and there's very extensive documentation that I custom made for it. It has a visual node-based editor and supports copy-pasting, subtrees (for organizing), dictionary (blackboard) serialization, and has all the typical node types you'd expect. It's free, I just want to share it and hope people find it useful.

https://github.com/Sterberino/open-behavior-trees/

https://sterberino.github.io/open-behavior-trees-documentation/docs/getting-started.html

GitHub

"A collection of behavior tree scripts for developing game AI." - GitHub - Sterberino/open-behavior-trees: "A collection of behavior tree scripts for developing game AI."

slim rampart
#

Can i assign values in the blackboard, for each object that is using the behavior tree, in the inspector?(like how you can assign properties for monobehaviors)

#

Also can you create custom variables types for the blackboard? Like if i have my own custom class, can i add it?

supple tide
# slim rampart Also can you create custom variables types for the blackboard? Like if i have my...

So the answer is yes, you can assign values to the blackboard in the inspector and they will persist. It makes use of an interface called

ISerializationCallbackReceiver

and basically in the background takes the keys and values of the dictionary and serializes them to lists. My understanding is that at Runtime, this doesn't happen and it's just a regular old dictionary.

As for custom variable types, the answer is also yes, but only if the class is serializable using JsonUtility, since that's how the ISerializationCallbackReceiver methods are handled. That being said, I haven't yet added a generic way of drawing all fields in custom classes, so it will show up as myCustomClass instance and there will be a button to debug the values as json.

#

It's pretty hard for me since I'm not like an EditorGUI wizard but I think I will be able to add generic inspector serialization somewhat soon?

slim rampart
#

Thank you :)
All the free bt assets and packages i found either didn't have a visual editor, or you couldn't assign values in the inspector, or... didn't have a blackboard at all! Yours,even has the ability to add icons for nodes! Thank you for this.

supple tide
#

Of course man, I just want to make software people enjoy. I want to warn you though I am about to rework the BehaviorTreeNode class to support caching the last node result and some other stuff, so wait until like tomorrow before going ham with it lol

#

(oops, sorry)
basically going to wrap the evaluate method in a Tick method, which calls evaluate, caches and returns the result, and invokes an onTick event if not null.