Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comment nodes #357

Open
Wichamir opened this issue Sep 19, 2024 · 0 comments
Open

Add comment nodes #357

Wichamir opened this issue Sep 19, 2024 · 0 comments

Comments

@Wichamir
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Sometimes it's nice to have comments inside your tree to clarify what some branches do, especially when your trees get bigger and more complex.

Describe the solution you'd like
We could use a name of a node inside the BT hierarchy as a comment.
There are a few implementations I can think of:

  • add a separate BeehaveComment node which would be completely ignored by the BT logic
  • make BT ignore nodes not inherited from BeehaveNode, thus you could put a basic Node inside tree hierarchy without causing an error
  • add some fourth state (like PASS/IGNORE/NONE) to the existing SUCCESS, FAILURE and RUNNING so the nodes in BT would ignore nodes returning this state and continue execution as if they were not there - then you can for example return this state from basic BeehaveNode by default (this could break some compatibility though)

Describe alternatives you've considered
You can put an AlwaysSucceed or AlwaysFail decorator so it just gets skipped over by certain composites, but you have to always keep in mind under what composite you put it. For example, if you change selector to sequence, then you have to change all comment decorators from AlwaysFail to AlwaysSucceed. You also have to put an additional dummy node under said decorator anyway, so this gets bloated and ugly quickly.
Alternatively you can just use a built-in editor_description property, but it isn't so readable and clearly visible in your tree hierarchy.

Additional context
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant