Skip to content

Ergonomic pause functionality #1353

@alice-i-cecile

Description

@alice-i-cecile

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

We can disable systems using run criteria (or StateStages) to pause the game. Unfortunately, if you simply disable the systems using StateStage, any events (and change detection) changes that are currently in flight are lost.

What solution would you like?

A pair of methods to pause and unpause a system set, activated via commands. Under the hood, this should implement the work-around listed below, automatically caching any events and changes that the systems in the system set consume.

Under the hood, this might makes sense to be a State, and use the enter / exit logic to handle this.

What alternative(s) have you considered?

To get around this, you could write some logic to handle system entry and exit, but then you need to repeat it for every relevant event type, and also muck around by manually caching component flags (but only the ones that are used by the paused systems?) and then reloading them

Additional context

This relates to #68, #1157 and #1297. This issue was created in response to this comment in #1345 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    Status

    Needs Design

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions