HouraiTeahouse / backroll-rs

A (almost) 100% pure safe Rust implementation of GGPO-style rollback netcode.
ISC License
351 stars 18 forks source link

Make framerate / TPS configurable #14

Open ErnWong opened 3 years ago

ErnWong commented 3 years ago

See:

https://github.com/HouraiTeahouse/backroll-rs/blob/3c6bdc08a17d2f4e87524595a935d7f28de8e7a4/backroll/src/protocol/mod.rs#L38

which is used for estimating the remote player's frame for timesyncing purposes:

https://github.com/HouraiTeahouse/backroll-rs/blob/3c6bdc08a17d2f4e87524595a935d7f28de8e7a4/backroll/src/protocol/mod.rs#L740-L753

On an unrelated note, it that calculation correct? The comment seems to suggest round_trip_time.as_secs() / 2.

james7132 commented 3 years ago

For most 60FPS games this is likely OK, but this should really be configurable.

This was directly ported from GGPO. The calculation does seem to be off. We should have a divide by two there.

james7132 commented 3 years ago

The RTT computation should be fixed now as of #15.