Skip to content

Ambiguous system order and Changed<Component> #1551

Closed
@sdfgeoff

Description

@sdfgeoff

Bevy version

source = "git+https://github.com/bevyengine/bevy?branch=main#d9fb61d474518eba06d0c3dce5cb81db9f7ed66a"

Operating system & version

Linux

What you did

Updated from bevy 0.4.0 to latest main and played my game

What you expected to happen

That my systems would continue to run as before

What actually happened

Many of my systems became unreliable - they weren't executing or were executing late (causing timeouts on a networking system). Different builds adding dbg!() commands changed behaviour etc. etc.

After some digging, I discovered this is likely due to the change: #1144

This change means that systems no longer execute in the order you declare them in. Coupled with the fact that the original Changed issue explicitly states that order independance is a non goal: #54 (comment)
This means systems with Changed appeared unreliable.

Additional information

Technically this isn't a problem. The program is doing as documented: Changed<component> states it only works when systems are in order, AppBuilder explicitly states that systems aren't added in any sort of order. Both of those rules are fine. The issue is that the interaction between them is non-obvious to first-time users.

A minimum solution could be documentation on Changed<> noting this interaction and suggesting that any use of it requires explicit system order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-DocsAn addition or correction to our documentationC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions