-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Is the "event not consumed" warning spurious? #6596
Comments
I think we should probably just revert this PR: the false positive cost is very high and it adds an extra branching check that will rarely be useful. |
This happens while doing, what I believe, is normal handoff of input from game to egui and back. |
Yep, I ran into exactly that problem. The error can be useful, but it has some nasty false positives, spams hard, and is really challenging to figure out how to silence. |
I'm also getting a large number of these warnings after upgrading to 0.9. The ones that get the highest number of "missed" events seem to be from systems that only run during certain states, and produce warnings with a number of missed events that is higher depending on how long it was since that state was active - sometimes in the 1000s - whenever the state becomes active. Outside of these, there also seem to be some more frequent ones due to deliberately skipping reading events in various systems based on cooldowns or other conditions making them irrelevant for that update cycle. As far as I can tell, all of these warnings are irrelevant and caused by things that are working as intended. I suppose there might, at least theoretically be cases where this warning actually indicates an error, if you accidentally omit reading from an event reader or return early from a system when it was not intended, but as far as I can see, this would be extremely rare and niche compared to the vast number of false positives produced. |
If you miss events for a bit and then read them again, you're going to get the events for this frame and the previous. I'm okay with removing the warning for now though as there's no nice way to handle this currently. |
# Objective - Reverts #5730. - Fixes #6173, fixes #6596. ## Solution Remove the warning entirely. ## Changelog You will no longer be spammed about > Missed 31 `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. when you miss events. These warnings were often (but not always) a false positive. You can still check this manually by using `ManualEventReader::missed_events`
# Objective - Reverts #5730. - Fixes #6173, fixes #6596. ## Solution Remove the warning entirely. ## Changelog You will no longer be spammed about > Missed 31 `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. when you miss events. These warnings were often (but not always) a false positive. You can still check this manually by using `ManualEventReader::missed_events`
…#6730) - Reverts bevyengine#5730. - Fixes bevyengine#6173, fixes bevyengine#6596. Remove the warning entirely. You will no longer be spammed about > Missed 31 `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. when you miss events. These warnings were often (but not always) a false positive. You can still check this manually by using `ManualEventReader::missed_events`
…#6730) # Objective - Reverts bevyengine#5730. - Fixes bevyengine#6173, fixes bevyengine#6596. ## Solution Remove the warning entirely. ## Changelog You will no longer be spammed about > Missed 31 `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. when you miss events. These warnings were often (but not always) a false positive. You can still check this manually by using `ManualEventReader::missed_events`
…#6730) # Objective - Reverts bevyengine#5730. - Fixes bevyengine#6173, fixes bevyengine#6596. ## Solution Remove the warning entirely. ## Changelog You will no longer be spammed about > Missed 31 `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. when you miss events. These warnings were often (but not always) a false positive. You can still check this manually by using `ManualEventReader::missed_events`
Discussed in #6595
Originally posted by nicopap November 13, 2022
Live example: https://nicopap.github.io/bevy_mod_paramap/earth3d.html (open console, drag around the glob by holding middle click down)
Source code is: https://github.com/nicopap/bevy_mod_paramap/blob/7c5d9789ddd3cb05eb1b023cc0bab0aa5cfa021c/examples/earth3d.rs#L232-L308
I'm getting a warning when I'm doing something quite normal. I just do not read the
MouseMotion
event when I don't need to.The error says
This problem is […] due to […] consuming events conditionally
but fails to explain why it is an issue. Looking at theEvents
doc, I don't see much of an argument against reading events conditionally.It feels like a very common false positive. This is very confusing to a new user, especially given most of the warning message doesn't at all match what I'm actually doing in my code. In fact I do often skip reading events when I don't need to read them (for performance!) and I've seen this error in a lot of my projects.
I understand why it can help, but did we not forget to weight the cost of false positives when adding this feature? The likely thing I'll do next time I see this error is to just ignore it, and it might as well not exist in this case.
The text was updated successfully, but these errors were encountered: