bevy-steamworks icon indicating copy to clipboard operation
bevy-steamworks copied to clipboard

Steam overlay is flickering

Open SDesya74 opened this issue 1 year ago • 3 comments

When I press shift tab to open the stim overlay, it opens but starts flickering very quickly.

Steps to reproduce:

use bevy::prelude::*;
use bevy_steamworks::SteamworksPlugin;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(SteamworksPlugin::new(480))
        .run();
}

This code works and does not cause the overlay to flicker on Bevy 0.11 (and thus bevy_steamworks 0.8).

SDesya74 avatar Feb 18 '24 16:02 SDesya74

I've verified that if you only update bevy and don't change the internals of bevy_steamworks, the flickering persists. The problem is apparently not here, but I don't know how to find where bevy is broken

SDesya74 avatar Feb 18 '24 16:02 SDesya74

I found out that if I call Client::init_app before adding DefaultPlugins, everything works.

To fix bevy_steamworks, we need to move Client::init_app to SteamworksPlugin::new, then it will be possible to initialize stim before RenderPlugin::build, which is the cause of the error. This solution works for me if I add SteamworksPlugin before or together with DefaultPlugins, adding it after does not fix the error.

Or we need to wait for a solution in Bevy, because earlier RenderPlugin::build called delayed initialization and initialization of the Stim client was guaranteed to be called before that.

SDesya74 avatar Feb 23 '24 20:02 SDesya74

Going to leave this open until the ordering issue is resolved. See https://github.com/bevyengine/bevy/issues/1255.

james7132 avatar Feb 23 '24 23:02 james7132