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

Double-counting of mouse motion and mouse wheel events #285

Closed
alice-i-cecile opened this issue Nov 13, 2022 · 3 comments · Fixed by #418
Closed

Double-counting of mouse motion and mouse wheel events #285

alice-i-cecile opened this issue Nov 13, 2022 · 3 comments · Fixed by #418
Labels
bug Something isn't working

Comments

@alice-i-cecile
Copy link
Contributor

alice-i-cecile commented Nov 13, 2022

Version

#284

What you did

Run the mouse_motion example.

What actually happened

The console is flooded with messages:

2022-11-13T19:35:54.363800Z WARN bevy_ecs::event: Missed 345 bevy_input::mouse::MouseMotion events. Consider reading from the EventReader more often (generally the best solution) or calling Events::update() less frequently (normally this is called once per frame). This problem is most likely due to run criteria/fixed timesteps or consuming events conditionally. See the Events documentation for more information.

Workaround

Silence these notifications by replacing your DefaultPlugins with:

DefaultPlugins.build().set(LogPlugin {
  filter: "wgpu=error,bevy_ecs::event=error".to_string(),
  ..default()
})

Huge thanks to Martin for nailing this down: https://discordapp.com/channels/691052431525675048/1034547742262951966/1043564180306919514.

Additional information

This is due to bevyengine/bevy#5730, as discussed in bevyengine/bevy#6589.

I suspect we're also double-counting events.

@alice-i-cecile alice-i-cecile added the bug Something isn't working label Nov 13, 2022
@alice-i-cecile
Copy link
Contributor Author

This should only occur with mouse motion and mouse wheels. The other types use Input, and so aren't affected.

@alice-i-cecile alice-i-cecile changed the title Constant spam about missed events Double-counting of some events Dec 3, 2022
@alice-i-cecile alice-i-cecile changed the title Double-counting of some events Double-counting of mouse motion and mouse wheel events Dec 3, 2022
@alice-i-cecile
Copy link
Contributor Author

Spam is gone with Bevy 0.9.1, but the underlying double counting is still there.

@Inspirateur
Copy link

The issue seems to have gotten worse with bevy 0.12.1 !
I'm quoting Ira (devil_ira) on discord here

Turns out leafwing input manager isn't using eventreaders internally as it should. So it was double counting events before, but with some changes 0.12.1 it could be re-reading the same events tens of times

I'm using it for camera panning (exactly as the leafwing example does it) and after updating to bevy 0.12.1 i'm getting crazy values in the thousands from DualAxis::mouse_motion() even when my mouse is not moving at all :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants