Skip to content
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

Separate Sub(Nested)StateMachine and StateMachineGroup processes #6130

Closed
TokageItLab opened this issue Jan 20, 2023 · 2 comments
Closed

Separate Sub(Nested)StateMachine and StateMachineGroup processes #6130

TokageItLab opened this issue Jan 20, 2023 · 2 comments
Milestone

Comments

@TokageItLab
Copy link
Member

TokageItLab commented Jan 20, 2023

Describe the project you are working on

3D character game

Describe the problem or limitation you are having in your project

StateMachines can be grouped. But SubStateMachine i.e. a nested StateMachine has a state separate from its parent StateMachine.

For example, if we have StateMachine A and StateMachine B, B exists as a state "sub" within A. While StateMachine A is in state "sub", StateMachine B runs, but the state of StateMachine A can be changed without regard to the state of StateMachine B.

This leaves StateMachine B in a stuck state, which causes problems when resuming as godotengine/godot#68986 and godotengine/godot#62576.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

For StateMachineGroup, disallow abort until End State. Or, as mentioned in godotengine/godot#62576, disallow a StateMachineGroup to have a separate State. It ensures that there are no stuck states.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I am considering whether to flag StateMachineGroup as a bool value in the parent StateMachine or make it a separate class.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No.

Is there a reason why this should be core and not an add-on in the asset library?

AnimationStateMachine is core.

@TokageItLab
Copy link
Member Author

I was thinking a little about the details of the implementation, so I'll leave a note for myself.

Implement the bool grouping property. Default is true.

If the grouping property is true, internal seek to 0 means transition to the Start state.

If the parent of a grouping StateMachine is also a grouping StateMachine, it is prohibited from seeking the playback of the child grouping StateMachine.

Instead, make the parent grouping StateMachine's playback available to the child grouping StateMachine's path.

@TokageItLab
Copy link
Member Author

Closed by godotengine/godot#75759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant