Tracking simulation steps with interpolation for determinism #465
Labels
A-Integration
very bevy specific
C-Bug
Something isn't working
D-Difficult
Needs strong technical background, domain knowledge, or impacts are high, needs testing...
P-High
arbitrary important item
S-not-started
Work has not started
I am currently building an application where I would like to use interpolation as well as keeping track of inputs to achieve determinism in replays.
In the following code snippet there is no sophisticated way to track the amount of iterations the loop has taken. I looked into the rapier physics pipeline and it does not have a fitting feature either.
bevy_rapier/src/plugin/context.rs
Lines 242 to 281 in c6bcce4
This problem does neither occur in fixed time steps since there the simulation is always only stepped once nor is it a problem in variable time steps since determinism is not a thing there.
A solution would be to either have a counter that is exposed and keeps track of the number of iterations in each schedule cycle or some sort of event / callback that is called whenever a step is taken. Since I don't really see any need for individual callbacks and there also is no additional meaningful information to be delivered, the counter solution does seem more reasonable. The counter could then also be implemented for the other time steps as a constant one for consistency.
A possible implementation could be:
The text was updated successfully, but these errors were encountered: