0
\$\begingroup\$

How can I perform state synchronization using client/server networking in an RTS similar to Starcraft 2 and Planetary Annihilation?

I'm assuming the server has to do some sort of rewinding time to apply the updates received by each of the clients. But for an RTS game, that sounds like a lot of separate copies of the game world. How do you resolve interactions between units belonging to different players who have different latencies?

For the clients, do they need to use their latency (RTT) in order to know how far behind the server they are, to apply future updates that arrive from the server at the right time?

How do you keep time in sync when latency could fluctuate and server updates may not arrive at fixed intervals?

\$\endgroup\$
2
  • \$\begingroup\$ For additional confusion, the GDC talk about Overwatch netcode, mentions that the client is always ahead of the server. I'm guessing the server has to tell the client how far ahead to be periodically, so that client updates arrive when the server is about ready to use them? This sounds like it's up to the client to do the rewinding when receiving updates. I'm confused how this scales for an RTS though... \$\endgroup\$
    – Nairou
    Commented Nov 2, 2020 at 1:36
  • 1
    \$\begingroup\$ I don't expect you'd need to use rewinding in an RTS. Because of the input model, all the player's actions are asynchronous anyway. I'm not aiming and pulling the trigger, I'm issuing a high-level order "I want you to attack that unit" - so if the unit ends up in a slightly different place a few ms later due to a mis-prediction, the order is still valid to continue executing. I don't need to rewind time to the moment it was issued to check if my raycast hit its updated trajectory - the intention is preserved. So, I think you may be overcomplicating this, and simpler solutions will suffice. \$\endgroup\$
    – DMGregory
    Commented Nov 5, 2020 at 15:12

0

You must log in to answer this question.

Browse other questions tagged .