All told, we must design a system that has the following requirements
- Renders a frame every 16ms, where objects positions vary continuously and smoothly
- Clients can easily communicate with each-other even when there may be huge latencies due to hardware or network troubles
- Player can see each other move smoothly and respond to each others actions
- Servers is the source of truth and can authoritatively run game and trigger game-events
- Is fun
I am not sure if I can help with the last point, but the other four are possible with modern systems even if we have to cheat a bit. We have a few tricks we can use to make this system buttery smooth:
- Allow clients to render predicted in-between frames filling in data between server syncs.
- Clients predicts the game state ahead of time, guessing what it thinks the server will say, cutting down perceived latency but leading to jittering when wrong.
- Lots of smoothing by averaging positions and baking in offsets that make jerky movements smooth and continuous
- We run client-side AI systems that simulate other players responses to client actions
Interesantan pogled na tehničku kompleksnost mreža koje se koriste u video igrama a zahtevaju efikasnu komunikaciju između velikog broja klijenata sa različitim kvalitetom signala. Ceo tekst distupan i na linku: https://scribe.rip/geekculture/how-do-video-games-stay-in-sync-an-intro-to-the-fascinating-networking-of-real-time-games-e923e66e8a0f