Random disconnects and high ping

Hi,

We here at Critical Force Entertainment are working on a new multiplayer action game and have run into some trouble. We got our game already running pretty well, but we have occasionally very random disconnects, with our log stating the cause being sometimes server timeout and sometimes client timeout. This happens mostly on our iOS devices and sometimes on our Android devices.
What happens is, we have our game running steadily, ping being around 60 ms. Then out of a sudden it peaks up to >300 ms or even 4500 ms disconnecting our client(s). To my knowledge, everything should be working fine:
We set messageQueueRunning to false before using Application.LoadLevel and then set it back to true in OnLevelWasLoaded. This is because we found that it gives us faster loading than with Photons LoadLevel.
We use OnPhotonSerialize to send unreliable data to players and only reliable calls/data is sent via RPCs, and we don't seem to have a very high usage over the network.
We have tried playing around with SendRate and SendRateOnSerialize, having tried values between 10 and 30 but seeing no help considering the disconnects.
We set automaticallySyncScene to true, even though it shouldn't matter I guess, since we don't load new levels in the middle of the game (players join game, play three rounds, get back to lobby).
I have also tried setting the MTU value to the lowest (576) and calling PhotonNetwork.networkingPeer.Service() manually in the game's update but haven't seen any improvements. Just to clarify, the disconnects happen only in the middle of the game, not on connect.
So any help would be appreciated and thanks in advance!

- Saltycheeze

Comments

  • It seems you already ruled out a lot of the common issues. This might be tricky.

    Which PUN version are you using?

    Did you notice this happening more on WLan or on 3G connections?
    Some customers found their WLan connections could break when there are several at the same time and more stuff might be going on. It makes sense to check if one or two players can play on an otherwise not used wlan can play ok.

    Do you send a lot of data at any point in the game?
    You can usually improve things if you use unreliable synchronization. This has no resending and might skip updates if they get lost but this also recovers better in those cases. Use it for data you replace / refresh often.
  • Thanks for the reply.

    We're using PUN 1.22 I think, the package you supplied in the Windows Phone 8/Windows Store thread since we're also aiming for those platforms. Could it have some problems in it?

    This has happened when we have players connected to the same WLAN. Do you have any data/experience how many players are safe to be connected to the same WLAN at the same time? Or is it just something that happens, that players might disconnect because there are so many similar messages going through?

    Our objects are all set to unreliable and we have a very low usage over the network altogether, so we shouldn't have a problem there. We're using the free 20 CCU plan now that we're still in development. Does it have some restrictions that disconnect our players from time to time? I noticed that there's apparently a 500 msg/s limit. What counts as a message? Every OnPhotonSerializeView call and all RPCs? If so, then our problem might lie there I think. Thoughts?

    And again, thank you in advance.

    - Saltycheeze
  • Ah, you are using a the Win 8 preview.
    I think by now you should be able to update to the "official" releases in the Asset Store again. I included Win 8 support in it.
    That might actually help. I figured out a better way to keep connections while loading levels / assets. Maybe this helps. In any case, it isn't bad.
    Make sure to backup first and check out the changelog.

    Every RPC, Instantiate, Destroy and the 10x "OnPhotonSerializeView" updates/sec are all messages (we use one msg for each group of "observed" objects/scripts). Each counts once for being sent and is received per other player in the room. This should be the bulk of messages you send/receive and the major influence here is the number of players.
    The message limit itself is not a problem but the number of packages going around might be. If you send an awful lot but ... I doubt you do.
  • Hi,

    Thanks for the suggestion. We were totally unaware that you guys had the official release in the asset store. We got to test it yesterday and so far so good. We couldn't test it for long though, so I'll report back if we encounter the same problems later on.
    Thanks Tobias!

    - Saltycheeze
  • "We were totally unaware that you guys had the official release in the asset store."
    I didn't announce it in the Unity group as we got almost no feedback from there, so I wasn't aware who would be using it.
    From now on, new releases should include a Win 8 package.