2
\$\begingroup\$

I'm starting to create a multiplayer online game, with an authoritative server. As it is, the clients send inputs to the server which do the simulation and then send back to clients the updated state. The game is a top-down shooter, so it's fast-paced and input lags are not allowed here, so to avoid this I'm doing the simulation on the client too, and when the server update come back I compare the local simulation with the server response. If they are compatible everything is fine, otherwise, the client version is corrected.

I was expecting that the client simulation desync at some point, because of all of the variables on physics, floating points, network etc... But this happens much more than I thought.

Just by sending the inputs and simulating on the server, the results are very different, even on simple movements, like forwards and backwards on a clear space.

Green is local, red is server response

Green is local, red is server response

I need help on this step, a way of keeping, at least this kind of simple movement, consistent on the server and the clients.

\$\endgroup\$
3
  • \$\begingroup\$ Can you show us your code for processing/transmitting player input and moving these objects? \$\endgroup\$
    – DMGregory
    Feb 12, 2019 at 20:03
  • \$\begingroup\$ did you use transform photon view component? please add more detail as @DMGregory mentioned please share your code.any way this article will help you \$\endgroup\$ Feb 14, 2019 at 15:52
  • \$\begingroup\$ why was this closed as offtopic? \$\endgroup\$
    – scape
    Dec 15, 2020 at 19:41

0

Browse other questions tagged .