-
-
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
Use a finite State
machine instead of a stack
#5458
Conversation
Kinda spooky that it didn't break CI at all... |
There's a half-dozen issues this will close; check the stageless board for a list. |
I think we need combinable run criteria before merging this, so the behavior of having multiple states active can be retained. |
Would that not be as easy as checking two states in the same run criteria? |
It's probably not worth the effort to do that, honestly. We can just make run criteria loopless in a separate PR (after fixing issues with fixed timesteps), then come back to this one. |
I haven’t followed the stageless discussions very closely and i’m just starting to catch up. With regards to this PR in particular, and not the design choice behind, in my opinion the Migration Guide here should include how to substitute |
So, the "easy" solutions (from the engine-dev perspective) is to tell users to reimplement a state-stack model in 3rd party code if they want it. However, that's far-and-away the clearest and most compelling use-case of the more advanced functionality that I've seen. Can you explain the pattern in depth, and perhaps link to your repo? Initial questions:
|
I have a colony sim game. Most of the time the game is in As per the answers:
(3 and 4 should be implied in the rest of the answer) If you want to talk more in depth feel free to ping me on Discord ( Edit: ah no i see |
Very helpful! Okay so three possible designs come to mind:
I think I'm opposed to 1 due to clarity and correctness concerns. 3 probably solves your particular problem, but I'm nervous that it's not strong enough. 2 seems like an elegant move towards the direction of #1597, but will add a bit of complexity back in. |
Thank you for looking into this! I really appreciate it. I do agree that 2 sounds better, I think I could make it work. From my point of view, the ideal scenario would be that a first party solution, whichever you land on, ships with the release that yeets the push / pop methods, and it's documented in the migration guide. That would be amazing. |
Objective
Solution
State
overhaul in Stageless.Changelog
State
transition methods no longer return an error when trying to transition from to a duplicate state.Migration Guide
All
State
methods relating to the previous stack-based implementation have been removed. The only operations areset
andoverwrite_set
. The only associated run criteria areon_update
,on_enter
, andon_exit
.