Skip to content

Add remaining State Chart functionalities to States #1597

Closed as not planned
Closed as not planned
@alice-i-cecile

Description

@alice-i-cecile

What problem does this solve or what need does it fill?

State charts are a popular and powerful abstraction for working with complex state machines. The State implementation created in #1424 is quite good, but there's still a few missing gaps that will present issues with more complex logic and hinder learning for users familiar with other state charts.

What solution would you like?

From my initial understanding of #1424 and the link above, we're missing the following features:

  1. Better nested states, including history states
  2. State guards
  3. Delayed transitions

State guards should be fairly trivial, and delayed transitions can likely just be sugar written in terms of state guards.

What alternative(s) have you considered?

Discover and document alternate patterns to work around these patterns.

Additional context

Integration with XML specs of state charts seems like a non-goal.

We could consider adapting some of the formal state chart jargon as well (e.g. Activity instead of on_update) but I don't think it's worth the clarity loss.

Eventually it would be lovely to have a tool to visualize (and eventually manipulate) state charts used in Bevy, but that's out-of-scope for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useS-Needs-Design-DocThis issue or PR is particularly complex, and needs an approved design doc before it can be merged

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions