Remote players synced with TransformView freeze/desync for over a second

My team has been playtesting our current game in groups of <7 players, and occasionally players stop moving for well over a second before teleporting to their correct position. The game is 2D, and the only synchronized variable is player position, using PhotonTransformViewClassic and "Unreliable on Change" on the PhotonView (which should be very minimal network traffic). I have 2 questions for dealing with this problem:

1) How do I debug a problem like this? Some approaches I have in mind are the PhotonLagSimulationGui and analyzing the frequency of players not sending me any serialized data to look for spikes.

2) What could be causing such long periods of no player packets reaching me? Are all the packets being dropped for that long, or is a buffer somewhere overflowing/dropping packets?

Thanks, & looking forward to solving this mystery.

Answers

  • garbage collector?
  • Take some time to learn about the Profiler in Unity. It's really good to check which code is causing stuttering and or freezes. It will also list the garbage collector if that takes long.