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

suggestion: is it possible to use TimestepMode::Interpolated instead of limiting fps to 60? #31

Open
soupslurpr opened this issue Dec 11, 2023 · 1 comment

Comments

@soupslurpr
Copy link

soupslurpr commented Dec 11, 2023

From what I see from experimenting with it in a simple test game (not this example) the physics collider seems to update to the dt that is set but visually it is interpolated to the current fps? Also thanks for this really cool example :)

@cscorley
Copy link
Owner

Hmm, maybe. I used to think this was the cause of some of my very early desync issues, but perhaps it was all derivative of other fixes I've implemented since. Just a brief check using the below value instead seems to work. However, I am cautious of doing anything outside of the Fixed timestep mode, just because I know there is special handling for Interpolated in the engine. I think it may cause desync issues on two different machines (I only tested locally with simulated lag), but I'm not entirely familiar with the feature. It may be working by accident of how GGRS handles time with Time -- and the time that Rapier is calculating (I am woefully unclear on how various Time mechanisms work in Bevy).

timestep_mode: TimestepMode::Interpolated {
    dt: 1. / FPS as f32,
    substeps: 1,
    time_scale: 1.0,
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants