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

ReplicationMode::SinceLastSend doesn't work in all situations #740

Open
cBournhonesque opened this issue Dec 27, 2024 · 0 comments
Open

Comments

@cBournhonesque
Copy link
Owner

There are 2 modes of replication:

  • SinceLastAck: we keep sending updates for a component if the component changed since the last tick that was acked.
    • This means that we will consistently send too many updates.
    • For example: tick 1 = C1A-update. tick 2 = C1A send. tick 3 = C1A send. tick 4 = receive ack, stop sending C1A.
  • SinceLastSend: we send updates for a component if the component changed since the last tick that we sent. Since packet loss is low (<1%), most of the times that's valid
    • For example: Tick 1 = C1A-update. send_tick = 1. Tick 2: stop sending C1A.

If a packet is loss, the send_tick goes back to the ack_tick for the replication group, so we send all component updates since the last ack.

However let's consider this scenario in mode SinceLastSend:

  • tick 1= C1A-update. send_tick = 1
  • tick 2 = C1B-update. send_tick = 2 -> this packet gets lost
  • tick 3 = C2-insert. send_tick = 3
  • tick 5: receive ACK1. ack_tick = 1
  • tick 6: receive ACK3. ack_tick = 3
  • tick 10: receive NACK2. send_tick = ack_tick = 3

This is not what we want, we would like C1 on the receiver to have the value C1B, but it will stay at C1A.

Solution:

  • keep the send_tick/ack_tick per entity/component?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant