HouraiTeahouse / backroll-rs

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

Bevy plugin does not create a checksum for the state anymore #20

Open james7132 opened 3 years ago

james7132 commented 3 years ago

As of 014fd15da35a74a3fed620f44d0f5bd68a506f48, bevy_backroll is now saving the provided state without any hashing/checksum. This could lead to silent desyncs as no checksum checks will fail in these cases. We should look for a generic way of handling this without reintroducing the Hash bound on Config::State.

ValorZard commented 3 years ago

A jank way we can do it is maybe giving all possible data a unique id? So like, hitbox transform is 25 or something. And then we add it all together for a checksum? That probably wouldn't work though...

ErnWong commented 3 years ago

Just to bounce some more ideas around...

Perhaps we could introduce a BackrollChecksum trait, which is a weaker version of the Hash trait that is automatically implemented for objects that implement Hash, but allows us to extend it to generate checksums for common bevy data structures that are not covered by Hash.