Bevy version
0.6 off of crates.io
Operating system & version
Windows 10.
What you did
- Wanted to make system execution order (more) deterministic.
- Did this by assigning systems to stages with
app.add_system_to_stage
- Got a white screen and the program froze on load with the warning
WARN bevy_ecs::schedule::graph_utils: Chain(bevy_ecs::schedule::state::State<time::game_flow::GameState>::on_enter::{{closure}}, bevy_ecs::schedule::state::should_run_adapter<time::game_flow::GameState>) wants to be after unknown label: DriverLabel(TypeId { t: 3089577881103655877 })
- Added a driver system set (don't understand how this works at all) with
app.add_system_set_to_stage(CoreState::First, State::<my custom state enum>::get_driver())
- That worked for
CoreState::First
- Want to do the same for
CoreState::Last with state run criteria, repeat 3-4 for the new stage
- Doesn't crash, but the run criteria never passes. Removing the run criteria the system runs every tick (want it to run on entry to a state)
- Switched order of
...::get_driver() commands,
- Systems in
CoreStage::Last work, systems in CoreStage::First with run_criteria don't
What you expected to happen
Expected all systems to run
What actually happened
Systems get executed based on the order of the added stages. Only impacts systems with further run criteria and doesn't impact ones that always run in a stage.
Additional information
Snippet from the plugin that adds the state:
.add_state(GameState::PreRound)
.add_system_set_to_stage(CoreStage::Last, State::<GameState>::get_driver())
.add_system_set_to_stage(CoreStage::First, State::<GameState>::get_driver())
Usage:
.add_system_to_stage(
CoreStage::First,
update_clock
.with_run_criteria(FixedTimestep::steps_per_second(constants::FPS as f64))
.label(TimeSystemLabel::UpdateClock),
)
...
.add_system_to_stage(
CoreStage::Last,
text::update_timer
.with_run_criteria(State::on_update(GameState::Combat))
.label(UISystemLabel::Timer),
)
Bevy version
0.6 off of crates.io
Operating system & version
Windows 10.
What you did
app.add_system_to_stageWARN bevy_ecs::schedule::graph_utils: Chain(bevy_ecs::schedule::state::State<time::game_flow::GameState>::on_enter::{{closure}}, bevy_ecs::schedule::state::should_run_adapter<time::game_flow::GameState>) wants to be after unknown label: DriverLabel(TypeId { t: 3089577881103655877 })app.add_system_set_to_stage(CoreState::First, State::<my custom state enum>::get_driver())CoreState::FirstCoreState::Lastwith state run criteria, repeat 3-4 for the new stage...::get_driver()commands,CoreStage::Lastwork, systems inCoreStage::Firstwith run_criteria don'tWhat you expected to happen
Expected all systems to run
What actually happened
Systems get executed based on the order of the added stages. Only impacts systems with further run criteria and doesn't impact ones that always run in a stage.
Additional information
Snippet from the plugin that adds the state:
Usage: