multiplayer not synching constantly? (PUN)

Options
Hi,

I've run into a synching issue that didn't happen a few months ago. When my multiplayer game is played with more than one player some players "freeze" for a few seconds on other clients screens before continuing to synchronise movement correctly again. This was not an issue before and all that has happened since, is simply more things happening at once, so more RPC's.

All players have a networkMovement script that sends and receive both transform.position and transform.rotation as well as all animations on serialized view and the networkMovement script is observed by the photonView of the player and again, this has worked without any issues before.

Now I'm also using photons transformview component which ia also observed by the photon view but it doesn't solve the problem.

I've tried elevating the PhotonNetwork.sendRateOnSerialize to 250 just to see if that was the issue but that didn't solve the problem. Now it's back to 70.

So how do I synch all players movements?

Comments

  • Tobias
    Options
    A sendRateOnSerialize of 70 will write as many updates per second. This is likely the cause for the problem.
    Use 10 or 20 but not more. Interpolate in between updates.

    Sending position (or any other value about a player / entity) should be done in one place only. Just in case you used both, PhotonTransformView and your own component: Do not do this. This just makes each component send and apply updates for no benefit.
  • Clevereen
    Options
    I have exactly the same issues as Peter since a few weeks. When I instantiate a 100 photonview with their own transformview, it seems that the game is starting to lag like hell and kick the players.
  • Tobias
    Options
    See above. Check your send rate and how much data each PhotonView attempts to send.