Closed
Description
Implicit dependencies were replaced with explicit ones in #1144. While this is a great choice, it's resulted in numerous flaky behaviors in the engine due to ambiguous system ordering.
So, I think we can probably get away with 6 (PreUpdate, Update and PostUpdate + the startup stage equivalent) core stages total for 0.5 honestly.
You only need more stages when you need to process chains of systems that rely on command processing to work, and I would be surprised if we have very long chains of that anywhere yet.
So, as an overall strategy:
0. Label all of the systems.
- Place the systems that generate commands.
- Place the systems that consume entities / components that would be generated by these commands in the stage after they're made.
- Toss all of the other systems in Update, since this allows users to run systems in stages before / after them without needing to make new stages.
- Resolve all of the ambiguities, either with a dependency or a permitted ambiguity (this functionality would have to be built out on at least a pairwise basis).
- Ensure that change-detecting systems come after things that can generate changes for them if we haven't solved System-order-independent ECS change tracking #68.