Search Unity

Question UNet room disappears and all clients disconnect after a while for no apparent reson

Discussion in 'UNet' started by Sound-Master, Jul 1, 2020.

  1. Sound-Master

    Sound-Master

    Joined:
    Aug 1, 2017
    Posts:
    48
    Hello,

    We are running a version of the Google ARcore CloudAnchors example. The project is setup with multiplayer and all seems to be working correclty.

    Apart from that the room disappears after a couple of minutes if more than 4 phones are conected to the game.

    The first client clicks a button to create the match with

    Code (CSharp):
    1. m_Manager.matchMaker.CreateMatch(m_Manager.matchName, m_Manager.matchSize,
    2.                                            true, string.Empty, string.Empty, string.Empty,
    3.                                            0, 0, _OnMatchCreate);
    Then all other clients connect automatically calling

    Code (CSharp):
    1. m_Manager.matchMaker.JoinMatch(match.networkId, string.Empty, string.Empty,
    2.                                          string.Empty, 0, 0, _OnMatchJoined);
    We have the maximum players set to 20. we have th eUnity free version and we are using Uuity 2019.3.4.

    Is there anything which has changed in UNet since it has been deprecated? Any resrtrictions on number of players in a match? Is there any chance that we are exceeding some kind of data limit / threshold as we have the free plan? How can we get more information on the disconnection?

    This is how the Network Manager is setup


    And this is what LogCat returns. I can see the disconnection of the clients but it is not clear why.


    @unitydevs can anybody help with this?

    Many thanks

    Michele
     
    Last edited: Jul 1, 2020
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You're not just using Unet, but it also looks like you are using the deprecated Unity Multiplayer Service which is scheduled to be shut down completely in spring 2022. You should not be just now writing a new game for it.

    That said, the Unity Multiplayer Service enforces strict bandwidth and connection limits on games which have not yet gone live. Once you tell Unity to go live with your game, I believe those restrictions are lifted and instead you are charged for all bandwidth used. Though I'd be surprised if Unity were still allowing games to go live since they are already planning to shut it down.

    This information is probably still accurate:
    https://forum.unity.com/threads/relay-server-bandwidth-explanation.364594/
     
  3. Sound-Master

    Sound-Master

    Joined:
    Aug 1, 2017
    Posts:
    48
    Thanks @Joe-Censored this is extremely useful. You are indeed right, we are using the Multiplayer Service. We started the project a while ago and it is too late now to rewrite the networking side of the project but with though we would be ok as support is granted until 2022 and the project is not going to have a life beyond 2021.

    Having said that, the bandwidth issues may as well be what we are experiencing. However it is really strange that it is not flagged anywhere.

    We receive a timeout error in logcat. Network Error 6. How is it possible that we get a timeout error for a bandwidth issue?

    Is there a way of knowing for sure? If we had the Pro version of Unity would that allow us to test without bandwidth limitations? @unitydevs

    Many thanks for your help!
    Michele
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I believe the bandwidth limit is enforced by disconnection. That could result in timeout errors.
     
  5. Sound-Master

    Sound-Master

    Joined:
    Aug 1, 2017
    Posts:
    48
    Thank you @Joe-Censored I understand. Still, it would be useful if the real reason popped up somewhere..

    I spent more time looking on forums but I am still not sure what the way forward would be!
    • All we need is for 6 players (Android apps) to be able to connect to a match and share their position, rotation and send a few RPCs for 4 hours a day for 2 days.
    • We don't need to release the game and it's a very controlled scenario for a specific event.
    • I was looking at Unet Live Mode. Is that the only way to lift the bandwidth limitation? Or do we have to publish the app as well on the Android store?
    • Does this mean we need to get a Unity Plus/Pro subscription and then we will be allowed to lift the bandwith limitation and pay for the usage?
     
  6. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Plus/Pro just provides for additional CCU when in development mode, not higher bandwidth per user. I believe setting your game to live mode removes the per user bandwidth cap and replaces it with charging money for all bandwidth. But as far as I'm aware Unity hasn't discussed how the service is implemented in several years, other than in 2018 said to not create any new games for it unless you were already nearing release, but it will continue functioning into 2022 for current users.

    What I would do is analyze how much traffic your connections are actually using, and contact Unity as to what the current state of the service is. Unet itself was never finished and development stopped while still in a buggy state. I'd seriously consider switching to an alternative networking solution.