-
-
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
Built-in Fixed Update #1683
Comments
FYI, Commands already run after every iteration of a system set with a FixedTimestep run criteria. |
Ok, I did not know that. It could be a good idea to explain that in the fixed_timestep example. I guess the only problem still remaining (after the new change detection is implemented) is events, but there is a workaround for that if you don't update them every frame. |
I'm hoping to get an RFC together for "reliable events" using exactly the same strategy as we do for change detection. Should be landing shortly after 0.5 launches and should solve the remaining difficulties. |
I like the idea of shipping Rendering the interpolated state could be done automatically: User game logic gets added to the fixed update schedule ordinarily, where for example it updates the |
Closing this out; this is tackled nicely in the stageless design. bevyengine/rfcs#45 |
What problem does this solve or what need does it fill?
As most people know, a fixed timestep is important for making gameplay consistent and repeatable. It's currently possible to do it in Bevy by adding a stage with a fixed timestep, but a built-in stage could make things more streamlined and have some extra features to have the stage behave as expected.
What solution would you like?
There should be a built-in stage that runs after
Update
calledFixedUpdate
. The special thing about a built-in FixedUpdate is that it should run commands after every loop. So each run of FixedUpdate would be treated as its own stage. Currently, in a Fixed Timestep, at least the way I understand it, there is no way of knowing when the commands will be processed, since you don't know how many times it will run per frame.I also think the fixed timestep information should be added to the
Time
resource, so it can easily be accessed from any system without using the string key thatFixedTimesteps
currently uses.What alternative(s) have you considered?
I am not sure how to get commands to run after every run of a fixed timestep currently.
Additional context
It seems like the new change detection in #1471 will solve the issue of detecting changes during a fixed timestep, but I don't think there is a way to have events work seamlessly with a fixed timestep and with other stages together. If a built-in fixed update is added, maybe that could also be addressed.
A built-in fixed update would also make it easier to implement interpolation, as proposed in #1259.
Edit: Apparently commands are already run after every update of a fixed timestep.
The text was updated successfully, but these errors were encountered: