Hi All,
When working in a client-authoritative server model, it is common for the server to send world state updates (snapshots) to the clients at certain rate.
We all now about this and how well it works, but I'm facing the following problem and would like to now hot this is solved on other games/what is the best approach.
My simulation runs at 60hz, and the server sends snapshots at a minimum of 20hz. This means that every 3 ticks, a snapshot leaves the server, the problem I face is what to do with inputs (specially shooting a weapon) that get generated in between those snapshots, that information will never reach any clients since there was no shooting at the time the snapshot was generated.
My solution was to accumulate the inputs generated between snapshots and append them before sending, so for each Player in the snapshot there is also an array of N inputs that were generated in-between snapshots.
This works fine but I'm not sure this is the best approach, I don't like having this extra complexity on the snapshot system. Because it means that on the client side, when I interpolate between snapshots I have to extract this information, and it also adds some overhead to the snapshot packet etc etc etc.
As a second problem, which I would also like to have an opinion on; if a snapshot gets lost on its way to a client, and that snapshot carried a “fire” input. The client would never represent that weapon firing… To more in-game terms: imagine you are playing with a friend and he is shooting a weapon every 1 second, you suddenly loose a snapshot package and now you see your friend skipping the firing when in reality he DID fire the weapon. I have NEVER experienced this in any games so the facts that this could easily happen in my implementation raises some questions.
Thanks in advance!