Skip to content

As soon as possible and as late as possible system ordering #4173

@alice-i-cecile

Description

@alice-i-cecile

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

In many cases, users don't particularly care when a given system runs: they just have a vague sense of "early" or "late".

Specifying this within a single stage involves a lot of upkeep and busy work as you need to constantly check and resolve ambiguities.

What solution would you like?

Add another pair of methods to match .before and .after:

  • as_soon_as_possible: runs the system as soon as possible, while respecting any explicit constraints given
  • as_late_as_possible runs the system as late as possible, while respecting any explicit contraints given

Under the hood, what this does is inserts a before / after ordering between this system and any other systems that it would be ambiguous with.

Cases where the other system is also ASAP / ALAP remain ambiguous.

What alternative(s) have you considered?

  1. Use asap and alap as method names. ASAP is a common abbreviation, but ALAP is not. Both are quite hard to parse in lower-case, especially for users that are not native English speakers. Autocomplete is a thing, and it's important to make sure that users don't accidentally typo or misread ASAP vs. ALAP due to the massive difference in effect and difficulty debugging.

Additional context

Raised in #4166 (comment) in the context of ordering exclusive systems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    Status

    Needs Design

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions