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

Run systems in First after Time set #562

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

ChristopherBiscardi
Copy link
Collaborator

If we accept that (#4669) Res is jittery then

  1. Time is updated in the TimeSystem set
  2. No work should happen before the Time is updated in a frame

This doesn't fix the upstream jitter issue, but we can reduce bevy_ecs_tilemap's potential impact on the issue by making sure any work we do in First is done after time is updated.

Solution

  1. Create a new TilemapFirstSet SystemSet
  2. Add bevy_ecs_tilemap First systems to TilemapFirstSet
  3. Order TilemapFirstSet systems after the TimeSystem.

bevy_mod_debug_dump

system scheduling in First before change:

screenshot-2024-09-15-at-10 15 37@2x

system scheduling after change:

screenshot-2024-09-15-at-10 18 23@2x

Migration

This shouldn't require end-user migration, but if you want to run system in First after bevy_ecs_tilemap's work, then the new SystemSet should be used.

If we accept that [(#4669) Res<Time> is jittery](bevyengine/bevy#4669) then

1. Time is updated in the [TimeSystem set](https://docs.rs/bevy/0.14.2/bevy/time/struct.TimeSystem.html)
2. No work should happen before the Time is updated in a frame

This doesn't fix the upstream jitter issue, but we can reduce bevy_ecs_tilemap's potential impact on the issue by making sure any work we do in `First` is done *after* time is updated.

\## Solution

1. Create a new `TilemapFirstSet` SystemSet
2. Add bevy_ecs_tilemap `First` systems to `TilemapFirstSet`
3. Order `TilemapFirstSet` systems after the `TimeSystem`.

\## Migration

This shouldn't require end-user migration, but if you want to run system in First after bevy_ecs_tilemap's work, then the new SystemSet should be used.
Copy link
Collaborator

@rparrett rparrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine. Also seems like it would probably be fine to dump these in PreUpdate.

@ChristopherBiscardi ChristopherBiscardi merged commit 42b74a3 into StarArawn:main Sep 16, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants