-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Affinitize System Sets to Schedules #9139
Comments
Oops posted this too early by pressing "enter". Bear with me for a sec as I fill it in. |
One problem with this is that some ScheduleLabels are "by value": .add_systems(OnExit(GameState::Playing), teardown)
.add_systems(OnEnter(GameState::GameOver), display_score) |
I was considering something like this. I think it'd be fine to have an opt out |
I don't love the thought of repeating myself like this / remembering to type schedules out in both places. I suspect this confusion is happening specifically as a hiccup of finding 0.11 equivalents to existing configurations. For example, in the renet PR: // main, v.10: Schedule is optional and left unspecified.
app.configure_set(RenetSet::Server.run_if(resource_exists::<RenetServer>()));
// PR, v.11: Schedule required. No equivalent statement to the above exists (in isolation).
// Migration requires the author to understand every schedule this set runs in.
app.configure_set(Update, RenetSet::Server.run_if(resource_exists::<RenetServer>())); Going forward, I think the existing API is reasonably obvious. The schedule-first argument to |
I think it makes sense... |
https://docs.rs/bevy/latest/bevy/app/struct.App.html#method.configure_set
The existing documentation doesn't reflect the Schedule-First changes in 0.11.0 For the current behavior it should be something like
|
What is the reason for them being "per schedule"? Why can't set configuration apply to any schedule a set is put into?
Sounds very reasonable to limit each set to a specific schedule. And if you were to do that, perhaps the add syntax can be simplified to |
For most of the sets I define in my own game, I'm positive that I never want any system in that set unless it's in a given schedule. All my |
I'd like to point out my idea for this in #8353 |
#9792 addresses this problem too, but proposes a different solution. |
What problem does this solve or what need does it fill?
Sometimes people do things like:
Then they get confused when
foo
runs unconditionally inPostUpdate
(because sets are "per schedule" configuration).What solution would you like?
One way to ensure this never happens is to require a specified ScheduleLabel type when implementing SystemSet.
I haven't fully thought this one through yet / I'm not sure we actually want this solution. Just putting the idea out there.
The text was updated successfully, but these errors were encountered: