ordering startup systems #2728
Unanswered
m-mueller678
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I would use If you have an state enum like this: pub enum AppState {
Step1,
Step2,
} You set the state to You could have your
And the |
Beta Was this translation helpful? Give feedback.
1 reply
-
Run criteria have no influence on execution order, and execution order has no influence on whether systems run. If |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to order startup systems so their dependencies are respected (eg. load config files -> load textures from configured locations -> wait for asset loading -> build texture atlas)
I do not want to manually set a fixed sequential order for all startup systems, as that seems tedious and error-prone, and I don't know how to combine this with plugins.
I tried using
after
andbefore
, but this does not work well with run criteria. For example, I am using run criteria to determine if all textures are loaded and the texture atlas can be built, but systems that depend on it will run regardless.Example: I expected s2 to run only after s1 has run, but that is not the case.
Another option I considered is creating a State for every startup system that is set to Completed when the system has finished. This would allow running systems after a system they depend on. But this again seems very tedious, and I can't figure out how to create dependencies like
before
using this. For example, a large number of systems might need to load textures before the texture atlas gets built, adding all of them as dependencies to the texture atlas system seems much less clear than addingbefore
dependencies to those systems, especially if they are spread across multiple plugins.Also, both approaches seem to require all initialization to happen in a single frame, which feels like I'm going against how Bevy is meant to be used.
How would I best go about doing this?
Beta Was this translation helpful? Give feedback.
All reactions