You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this intended? What I'm seeing is that following this logic, the Repeater as soon as one of the children is in running phase, will return INVALID as it's status.
This will in turn go back to the base class Behavior that will see that the status != RUNNING, and terminate the behavior.
Since the implementation of a basic Repeater has an empty ::onTerminate seems like nothing is effected if that's a top level node. However the side effects show as soon as it is used to repeat a set of actions further down the tree.
Shouldn't it return a RUNNING state instead?
Maybe I'm misinterpreting the intended behavior, as we want the action to be repeated quickly in the same frame / context?
One of the examples from the aigamedev paper says "shootPlayer" 3 times. If that is a sequence in itself, (like imagine an old sniper rifle: reload, aim, shoot, reload, aim, shoot..) each phase may have a short running period.
If that's not how it is intended ok, but otherwise I see that as a potential problem.
Thank you
The text was updated successfully, but these errors were encountered:
// Inside Repeater::tick() method
for (int i = 0; i < repeatCount; ++i) {
// Execute the child node
Status childStatus = child->tick();
if (childStatus == BH_RUNNING) {
// If the child is still running, return BH_RUNNING
return BH_RUNNING;
} else if (childStatus == BH_FAILURE) {
// Handle failure (e.g., repeat or exit)
return BH_FAILURE;
}
// Handle success (e.g., repeat or exit)
}
// All repetitions completed, return BH_SUCCESS or BH_FAILURE based on the logic.
btsk/BehaviorTree.cpp
Line 205 in 8124c3e
Is this intended? What I'm seeing is that following this logic, the Repeater as soon as one of the children is in running phase, will return INVALID as it's status.
This will in turn go back to the base class Behavior that will see that the status != RUNNING, and terminate the behavior.
Since the implementation of a basic Repeater has an empty ::onTerminate seems like nothing is effected if that's a top level node. However the side effects show as soon as it is used to repeat a set of actions further down the tree.
Shouldn't it return a RUNNING state instead?
Maybe I'm misinterpreting the intended behavior, as we want the action to be repeated quickly in the same frame / context?
One of the examples from the aigamedev paper says "shootPlayer" 3 times. If that is a sequence in itself, (like imagine an old sniper rifle: reload, aim, shoot, reload, aim, shoot..) each phase may have a short running period.
If that's not how it is intended ok, but otherwise I see that as a potential problem.
Thank you
The text was updated successfully, but these errors were encountered: