projectharmonia / bevy_replicon

Server-authoritative networking crate for the Bevy game engine.
https://crates.io/crates/bevy_replicon
Apache License 2.0
352 stars 31 forks source link

Replication conditions #331

Open Shatur opened 1 month ago

Shatur commented 1 month ago

Sometimes it's useful to replicate not every change, but with some frequency. Maybe we could have some replication conditions to allow this.

Shatur commented 1 month ago

When designing the API, we need to let clients evaluate it. This could be used by rollback crates. So basically lets say we replicate a component with the policy of "Send once", a rollback crate needs the ability to check "Would this tick even have a valid authoritative value?". Same thing for something like "Only send once per second". Basically if an entity can be confirmed, without that value matching the server, it needs to be possible to check for that. Otherwise we'll see issues like "Well every previous value is confirmed so Position(0, 0, 0) must still be valid, when really the intended way to network it is: send the starting position, use deterministic replication afterwards.