Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Advanced] Client get disconnected issue after updating to unity 5.6!

Discussion in 'Multiplayer' started by amynox, May 23, 2017.

  1. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    177
    Hello folks,

    I'm facing a very wired issue with Unity networking (P2P mode) after updating to unity 5.6:

    I'm building a RPG game which player can place building (fondation, ceiling....). Each building part instance have (4 SyncVar). The game work well on small party (with a limited number of buildings parts) but when I'm having huge buildings number (let's says 120 parts x 4Syncvar) my client get disconnected from the server with timeout error. The disconnect happen few seconds after the client join the server ( I guess due to the high number of syncvar that should be synced when client join).

    The disconnect happened on LAN and also using Unity matchmaker.

    After few research I discovered that this maybe caused by the NoRessouce error by sending more than the allowed bandwidth.

    I've tryied to tweak the network manager ConnectionConfig. I don't want to change de packet size (default to 1500). The only Params that prevent my client to get disconnected is when I changed the ConnectionConfig.AcksType !
    I passed it from Ack32 to Ack64 and it works !! After adding a news buildings parts the issue happen again => so I passed it to Ack128 and it works again. I added a few more buildings and the issue appear again :)

    So I give up with the AcksType ! And settled back to Ack96.

    My current connection config :

    Code (CSharp):
    1.         myNetworkManager.customConfig = true;
    2.         myNetworkManager.connectionConfig.NetworkDropThreshold = 45;
    3.         myNetworkManager.connectionConfig.OverflowDropThreshold = 45;
    4.      
    5.         myNetworkManager.connectionConfig.AcksType = ConnectionAcksType.Acks96;
    6.        
    Next try : I added a new channel (channel 2) to my network manager with Qos Reliable Fragmented and added the network attributes to myBuildings script to syncvar on channel 2 thinking that this may resolve the issue but as you guess it I'm still facing the same problem !


    I've tryied merging all the syncvars on synclist but i experienced the same problem. (It seems that synclist send data on the channel 0 and this is hard coded on UNet !)


    My only left option is the get ride of all this syncvars and use UNet message instead (with bytes compression for exemple to optimize the bandwidth) but with this solution I will need to keep track of all the buildings states and set them "manually" to every new client that join the server... all of this will be an important refactor to my code so it why I prefer to ask here if some one experienced the same issue and if UNet message will be a good solution to my problem ?


    Thank you
    With amour from Paris
     
    Last edited: May 24, 2017
  2. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    177
    Any one ?
     
  3. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    177
    Hello folks,

    Just to update this thread. The solution to my problem was to use a custum implementation (using physics collider - AOI- ) of "Network Proximity Checker" to reduce the amount of data synced on client join and avoid hitting the bandwidth limit (4k/s/player).

    Its really sad that Unity Networking Team dosn't provide any support and dosent even answer questions on the forum or QA. :(
     
    akast07 likes this.