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
Check remaining time before executing an action #51
Comments
One argument against this change: If your update each half second and wait one second, then it will execute the next action in 1.5 seconds. However, if you wait 1.1 seconds it will execute in 1.5 seconds. |
|
The question is whether you need time to run or whether you consume time to stop. If you should have time to run then Currently I'm thinking you should consume time to stop, because the semantics of "update something" implies that you intend to update, even if there is no time. |
This is my use case: let behavior = While(Box::new(WaitForever), vec![Sequence(vec![
Action(Action::Down), Action(Action::Up)
])]); A simulation game where turns are fixed units of time e.g. a tile based game. Actions take a full Is it the responsibility of the Action to check if there is time remaining or should the tree prevent if args.dt == 0.0 {
return RUNNING;
} else {
// move unit up
return (Success, 0.0)
}; My feeling is that it would be nice if the library prevented See the test I hope that makes sense. |
If the action does not check the time, but assumes it will be given a full delta time, then it messes up partial updates. For example, assume you change the UPS so I believe it should be the action's responsibility to check the remaining time. There are two ways you can solve your issue:
|
Thanks for the outstanding discussion! I appreciate the help and work that you've done. |
Closing since this won't be implemented. |
Might solve #46.
Currently, instant actions that does not consume time can execute when there is no remaining time. This might cause problems when an action consumes the whole time interval and trigger an instant action.
The text was updated successfully, but these errors were encountered: