-
Notifications
You must be signed in to change notification settings - Fork 109
Abstract Class Structure and State Exposure #7
base: master
Are you sure you want to change the base?
Conversation
…execution status for building visualization interfaces for trees.
lastExecStatus is Failure by default.
src/TimeData.cs
Outdated
| using System.Text; | ||
|
|
||
| namespace FluentBehaviourTree | ||
| namespace FluentBehaviourTree |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
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 |
… TimeData and BehaviourTreeStatus.
|
Ashley, I've removed all API related to the baking, going back to just using lists for children. Michael |
|
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. |
|
@ashleydavis is there anything I need to do to assist in getting this approved? |
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:
BehaviourTreeStatusof the last execution.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
IBehaviourTreeNodeandIParentBehaviourTreeNodeto 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 inBehaviourTreeNode. Also as part of a todo I added the concept of "baking" nodes. WhenBehaviourTreeNode 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.