-
Notifications
You must be signed in to change notification settings - Fork 42
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 rollback systems with app.add_system(system.in_schedule(GGRSSchedule))
#51
Conversation
More example usage: #[derive(Debug, Hash, PartialEq, Eq, Clone, SystemSet)]
#[system_set(base)]
pub enum RollbackSet {
Pre,
Update,
}
app.get_schedule_mut(GGRSSchedule)
.expect("no ggrs schedule, add ggrs plugin first")
.configure_set(RollbackSet::Pre.before(RollbackSet::Update))
.set_default_base_set(RollbackSet::Update)
// "core" rollback systems
.add_systems(
(tick_frame_count, update_action_state_from_ggrs_input)
.in_base_set(RollbackSet::Pre),
); in another plugin: let rollback = app
.get_schedule_mut(GGRSSchedule)
.expect("No ggrs schedule added");
rollback.add_systems((
update_character_state,
update_character_facing_dir,
// todo: remove?
set_torque,
));
// after update_character_state
rollback.add_systems(
(
character_jetpack_movement,
activate_terminals.before(propagate_actuation),
character_run
// mutually exclusive since characters can't run while flying
.ambiguous_with(character_jetpack_movement),
character_jump
// arbitrary ordering for determinism
.after(character_run)
// mutually exclusive since characters can't jump while flying
.ambiguous_with(character_jetpack_movement),
)
.after(update_character_state),
); |
I've been testing johns bevy-0.10-refactor branch and created some integration test in it. Here is the branch with integration test and the GitHub actions checks passing. |
Thats super cool, thank you! I am currently in the process of rewriting the whole plugin on this branch, but I would be glad to have the integration tests in that new version. I'll let you know once I arrived at a satisfactory state of my rewriting attempt :) |
* Add .idea to IDE gitignore * Add integration test
I'll probably be using this branch for my game until #52 is ready, so I guess it could serve as the "final" reflect-style bevy 0.10 compatible branch for anyone else wanting to use bevy 0.10 immediately? |
Builds on #50
This moves the schedule building functions over to
App
instead.This means regular Bevy
Plugin
s can now easily add systems GGRS schedule in theirbuild
function.I'm wondering: would you consider changing your naming scheme so it could be GgrsSchedule? My brain is kind of struggling a bit with
GGRSSchedule
.