Hello guys. I'm starting a network based game with a authoritative server. The clients will send the inputs states 30 times/second and the server will broadcast the new game state at 10 times/second.
How do you think is the best way to update the server states with the received inputs?
1 - Each new input the server receives, it updates that player state (position, rotation....) and before broadcast the new states, run the collisions. (the problem here is that the physics will not run at fixed time steps because it can receive more than one input from the same client before the physics runs).
2 - Queue all the inputs received from clients and run only one client update each player for each physics update/broadcast. (The problem here is that the updates can go out of sync because the queues. At each physics step at average the queues will have three client inputs but it can accumulate more and go out of sync).
For me the best is the second option with a simple trick: if the queues get more than 3 inputs I can run more than one physics step before broadcast to get the queue back in sync. Maybe it works...)
What are your opinions?
Thanks. Gregory.