-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
🐛 fix interrupt of sequence star/random + improve docs #249
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,12 @@ With composite nodes, you can craft unique and dynamic Behavior Trees for your g | |
|
||
## Restarting a composite | ||
|
||
If a parent node restarts a child node, it means that the parent node will start the child node from scratch the next time it is ticked. This means that any progress made by the child node will be reset, and it will start its execution from the beginning. | ||
When a parent node restarts, it means the whole composite node begins its evaluation again from the beginning. This does not interrupt the child nodes. | ||
|
||
## Ticking again a composite | ||
## Interrupting child nodes | ||
|
||
A sequence may interrupt any `RUNNING` child node in case a child returns a `FAILURE`. The `interrupt` method will be called on all child nodes of the currently evaluated child node. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The interrupt can also happen in other cases, not just when a child returns a failure - for example, if a reactive sequence encounters a running child, that comes before the child that was running last frame, the old running child is interrupted. I'd say this part of the sentence can be left out: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The term child nodes typically denotes only the direct children, i.e. the first-order descendants. For clarity, I'd suggest using the term descendant nodes to denote all descending nodes and say Also, instead of |
||
|
||
If a parent node ticks a child node again, it means that the parent node will immediately tick the child node again on the next frame, without waiting for the current frame to finish executing. This allows the child node to continue its execution from where it left off without resetting its progress. | ||
## Ticking again a composite | ||
|
||
In other words, restarting a child node means that the parent node will give the child node a fresh start, while ticking it again means that the parent node will let the child node continue its execution from where it left off. | ||
If a parent node ticks a child node again, it means that the parent node will immediately tick the child node again on the next frame, without waiting for the current frame to finish executing. This allows the child node to continue its execution from where it left off without resetting its progress. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is this correct? This sounds like the child node is ticked multiple times in the same frame. Isn't each node only ticked at most once on every frame? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Brain fog on my part. I will correct this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I may add one more thing, I'd also maybe elaborate more to clarify that all that ticking again really means is that the parent composite node carries on with its execution from that given child node. Meaning, that it's not only that given child node that is ticked, it is potentially its sibling nodes following it, if the node completes and allows its siblings to be ticked too. |
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.
If I'm not mistaken, there can only be one running node - that is until parallel composites are implemented. But until then, I think the docs should reflect this fact and be clear about it as not to confuse the new users. Therefore, I suggest the last sentence be rewritten as follows:
This does not interrupt the running child node.