-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Ordered OnExit
and OnEnter
#13711
Labels
A-ECS
Entities, components, systems, and events
C-Bug
An unexpected or incorrect behavior
X-Contentious
There are nontrivial implications that should be thought through
Comments
MiniaczQ
added
C-Feature
A new feature, making something new possible
S-Needs-Triage
This issue needs to be labelled
labels
Jun 6, 2024
alice-i-cecile
added
C-Bug
An unexpected or incorrect behavior
A-ECS
Entities, components, systems, and events
X-Contentious
There are nontrivial implications that should be thought through
and removed
C-Feature
A new feature, making something new possible
S-Needs-Triage
This issue needs to be labelled
labels
Jun 6, 2024
Note that the fix with |
@MiniaczQ @alice-i-cecile - working on a potential solution |
This was referenced Jun 8, 2024
github-merge-queue bot
pushed a commit
that referenced
this issue
Jun 10, 2024
…13763) # Objective Fixes #13711 ## Solution Introduce smaller, generic system sets for each schedule variant, which are ordered against other generic variants: - `ExitSchedules<S>` - For `OnExit` schedules, runs from leaf states to root states. - `TransitionSchedules<S>` - For `OnTransition` schedules, runs in arbitrary order. - `EnterSchedules<S>` - For `OnEnter` schedules, runs from root states to leaf states. Also unified `ApplyStateTransition<S>` schedule which works in basically the same way, just for internals. ## Testing - One test that tests schedule execution order --------- Co-authored-by: Lee-Orr <[email protected]>
mockersf
pushed a commit
that referenced
this issue
Jun 10, 2024
…13763) # Objective Fixes #13711 ## Solution Introduce smaller, generic system sets for each schedule variant, which are ordered against other generic variants: - `ExitSchedules<S>` - For `OnExit` schedules, runs from leaf states to root states. - `TransitionSchedules<S>` - For `OnTransition` schedules, runs in arbitrary order. - `EnterSchedules<S>` - For `OnEnter` schedules, runs from root states to leaf states. Also unified `ApplyStateTransition<S>` schedule which works in basically the same way, just for internals. ## Testing - One test that tests schedule execution order --------- Co-authored-by: Lee-Orr <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-ECS
Entities, components, systems, and events
C-Bug
An unexpected or incorrect behavior
X-Contentious
There are nontrivial implications that should be thought through
What problem does this solve or what need does it fill?
Currently
OnExit
andOnEnter
aren't ordered in relation to the state dependency graph.This is a problem when parent state transition prepares e.g. resources for substates, but the
OnEnter(Substate)
runs first.What solution would you like?
OnExit
to run from graph leaf-states to root-states.OnTransition
in arbitrary order.OnEnter
to run from graph root-states to leaf-states.This can either be done by adding
after
conditions during state installation or as part ofStateRegistry
, a separate feature.What alternative(s) have you considered?
None that seem reasonable.
Additional context
This could be considered a bug to some degree.
Working example, entering
Settings
will crash or not, depending on the system order that was decided during startup.The text was updated successfully, but these errors were encountered: