-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Attempting to loop over the full behavior tree #46
Comments
When updating an object's position you have to tell the behavior tree how much time it took. This is called "consuming time". If the same consumed time is returned, the actions will behave as instant. Return the consumed time of what you want to simulate, for example, if you get 0.1 seconds and hit a wall in 0.04 seconds and the action You need a When a loop gets stuck it is likely to be the case that no time is consumed by any action. |
'm returning I am using it a bit different from the sea birds example. I am cloning the state, running the event, Again, thanks for taking the time to look at my issue! let mut state = ai.state.clone();
state.event(e, &mut |action_args| {
send.send(event::Event::Movement {
entity: entity,
dir: match *action_args.action {
Action::Down => dir::Dir::Down,
Action::Up => dir::Dir::Up,
}
});
(ai_behavior::Success, 0.0)
});
send.send(event::Event::UpdateAiState { entity: entity, state: state.clone() }); |
Still trying to wrap my head around how this all works. I've read the blog post, read the gamasutra article, looked at sea birds and also the implementation of the this library. This isn't an issue with the library (thanks for all your work btw!) but likely an issue with how I am using it.
I have the following behavior tree defined which is just a really simple proof of concept.
Action::Down
moves a unit down one square, andAction::Up
moves a unit up one square. I'm looking for a way for the behavior tree to continuously "loop" and have the unit move up and down. I'd like for the root of the tree to always be running, if that makes sense.Are
Sequences
one shot ordeals? I'm assuming that they get reset but they seem to get stuck on the last behavior (in this case continuing to move down).Any help would be appreciated, and again, thanks for all the libraries!
The text was updated successfully, but these errors were encountered: