Search Unity

Other than internet lag, what causes sync issues?

Discussion in 'Multiplayer' started by evan_ohara, Nov 30, 2016.

  1. evan_ohara

    evan_ohara

    Joined:
    Oct 28, 2016
    Posts:
    35
    Just curious. This isn't a live action game that requires constant syncing, however, one player takes his turn and sends every action he took and the order/time he took them, why would positions of objects in the game get slightly more and more out of sync? Does this have to do with difference in updates per second? It seems like it might be a summation of rounding errors that can make or break it. Do I have to occasionally sync every object in the game?

    Thanks!
     
  2. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    292
    Well, your description is pretty high level, but to start with, if your positions are floats, and that is what you are sending over the network, you are probably going to get some loss there, just because floats are ... difficult. You could quantize your positions on both sides to some fixed point accuracy, and send ints. You limit your "precision" but i bet your players would only see maybe 1/100th of a unit difference, so you could just multiply all your position values by 100, round to int, send that over the network, then divide by 100 and use that as your values - sure to be accurate across the network. Or something like that ;) Could be all kinds of things, and this is only one of them!