-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Events can be missed or double-counted by fixed time step systems #7691
Comments
The cheatbook has a page on this problem, and some suggested workarounds: https://bevy-cheatbook.github.io/patterns/manual-event-clear.html |
I've tried to make a small game using The following problems need to be ironed out. I don't think any of them necessarily need to be "fixed" and they can all be worked around rather easily, which speaks to the strengths of Bevy, I think. But barring fixing them, we really need a page in the book or elsewhere dedicated to these problems, ways to work around them, and best practices with #7691 (this issue) My vote is they all get addressed in a way that makes for the easiest developer experience, which is sometimes antithetical to performance. For example, updating |
It would be great if |
It would be great if there were at least a workaround for built-in events. For example, I am trying to create a fully deterministic game with bevy and bevy_rapier. However, bevy_rapier uses As far as I can tell, to make this deterministic, I would have to set a custom runner that calls |
This is now resolved: Events now integrate with the fixed update. |
Bevy version
Bevy 0.9 (and will still exist for Bevy 0.10)
What you did
What went wrong
Events are sometimes missed, and sometimes double counted.
Additional information
This occurs because events are only double-buffered, and a clean up system is run each frame via Events::::update_system.
If there are many passes of
CoreSchedule::Update
for each pass ofCoreSchedule::FixedUpdate
(due to short frame times), events will be missed. If the opposite is true, events will be double-counted.#6183 is closely related, but not entirely the same, as the same problem occurs with the
Input
andAxis
resources.The text was updated successfully, but these errors were encountered: