Skip to content

set_runner doesn't work like it did in 0.11 after updating to 0.12 #10385

Closed
@ilyvion

Description

@ilyvion

Bevy version

0.12

What you did

I have a Bevy plugin crate for using Bevy (mainly the ECS, although I also make use of the Bevy App to orchestrate the whole thing) with another game engine.

In order to support this, I'm using a custom runner, which up until 0.12, would always run before anything else, and so I could do some very early initialization safely there.

if app.plugins_state() == PluginsState::Ready {
// If we're already ready, we finish up now and advance one frame.
// This prevents black frames during the launch transition on iOS.
app.finish();
app.cleanup();
app.update();
}

👆 Thanks to these lines added between 0.11 and 0.12, I'm now getting panics, because systems get to run (thanks to the call to app.update()) before my custom runner gets to do its required initializations.

What went wrong

This change was very unexpected to me. I thought the runner would be in charge of everything, including running systems at all, but now this privilege has been taken from me, and it breaks everything.

Is there a way to make it so I can turn this new code off in later Bevy releases? I don't care about iOS support and want to be in total control over calls to app.update().

Additional information

If you're interested, this is my custom runner:

https://github.com/alexschrod/bevy_doryen/blob/140d7eb7a84a1ef9b8f064918d83f39e1f4d9508/src/lib.rs#L348-L381

And the reason it's important that only I get to call app.update() is that this needs to happen before and after each such call:

https://github.com/alexschrod/bevy_doryen/blob/140d7eb7a84a1ef9b8f064918d83f39e1f4d9508/src/lib.rs#L258-L260

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AppBevy apps and pluginsC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions