Skip to content
This repository was archived by the owner on Sep 9, 2018. It is now read-only.

Conversation

@thebeardphantom
Copy link

In my attempts to use Fluent-Behaviour-Tree on a Unity project I found myself actually wanting to be able to see the state of the Behaviour Tree in a meaningful way, via a graphical visualizer. Unfortunately all of the state of the Behaviour Tree was closed off and private. Being able to visualize a tree required three things:

  1. Exposing the name of each node.
  2. Storing and exposing the BehaviourTreeStatus of the last execution.
  3. Allowing for read-only iterating through the children of a Parent node.

Adding this behavior to Fluent-Behaviour-Tree made it obvious that the framework had outgrown its usage of interfaces, as duplicate implementation details would be repeated even moreso than before. Because of this I switched IBehaviourTreeNode and IParentBehaviourTreeNode to be abstract classes (and renamed them as such). I then implemented their functionality in a way that would make future implementation clear. I exposed the required state information in BehaviourTreeNode. Also as part of a todo I added the concept of "baking" nodes. When BehaviourTreeNode Build() is called it then bakes all information in all nodes in the tree. This was primarily for making parent nodes bake their child lists into arrays.

src/TimeData.cs Outdated
using System.Text;

namespace FluentBehaviourTree
namespace FluentBehaviourTree
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose for changing this file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops. This and the src/BehaviourTreeStatus.cs changes were just my IDE removing unused using statements. I'll add those back in.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's no probably really. Was just wondering why.

@ashleydavis
Copy link
Owner

Hi Michael,

Thanks for your interest in this project and your contribution.

In principle I'm keen to take these changes from you, although I'm not certain the baking is necessary and I'd prefer to keep things simple and possibly leave that out. What do you think?

Cheers
Ash

@thebeardphantom
Copy link
Author

thebeardphantom commented Sep 12, 2016

Ashley,

I've removed all API related to the baking, going back to just using lists for children.

Michael

@thebeardphantom
Copy link
Author

thebeardphantom commented Sep 12, 2016

Also if you're curious, opening up the state in this way allows for this sort of visualization (small test project) https://youtu.be/JmdsTGinQ7s?list=PLvJqXPgqBQ-tg6Zkuu_ruPRs_EvN3oQlB

The visualization is on the right side.

@thebeardphantom
Copy link
Author

@ashleydavis is there anything I need to do to assist in getting this approved?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants