I've made simple multiplayer web game but don't like how it works. Here.s video example (captured at 85 avg ping) showing what I have.
What I used:
- Super naive client prediction - called so because there is no reconciliation - most of the time players' strikers can't be moved by anything except players themselves
- Interpolation (it's turned off on the attached video because at the current state of the game in combination with prediction it made things look way worse. Without prediction it looks beter input lag is unacceptably big)
I've read some valve wiki articles, Gambetta's articles and some other not so popular sources, which helped to understand general ideas, but I still lack understanding on how to combine various techniques of minimizing delays for players and some implementation details. So here are the questions:
- What is the best way to sync time on client and server and when to start clocks? It's not very important at the current state of the game but I definitely will need to make it precise for more advanced latency-masking techniques. I should measure average ping and then what? Server sends notifications to clients 'start clocking in X ms' based on ping? Should they even start clocking at the same time?
- How to improve user experience for my game? I guess I should probably use extrapolation for puck and lag compensation to avoid situation like at 0:07.
Is interpolation even needed with 60 tickrate for anything with 60 or lower hz screens? I'm not aiming at e-sports level experience and would rather make it feel nicer for 60 hz phone screens