1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

Unity Multiplayer WIFI issues on LAN or Android Client <=> Windows Server?

Discussion in 'Multiplayer Networking' started by Indiefreaks, Jun 25, 2015.

  1. Indiefreaks

    Indiefreaks

    Joined:
    Nov 12, 2012
    Posts:
    64
    Hi,

    I am meeting some issues when using UNET on multiple devices on the same LAN using WIFI.

    Here is my current setup:
    I have a server hosted on Windows that I launch before everything else.
    The server has a broadcast service to let LAN clients know how to connect to the server.
    The server has also a lobby for players to join.

    I then have a client on Windows too (the same machine) that I launch right after the server.
    It gets the broadcasted message and then joins the lobby without any issue.

    I finally have a client on Android that I launch after all of the others.
    It also gets the broadcasted message and joins the lobby.
    However, after some time, depends really on every trial I made, the Android client gets disconnected because of a timeout issue.

    In order to verify that my code wasn't in cause, I tried launching clients from several machines that all are on LAN Ethernet (not using the WIFI). It all worked perfectly with no disconnection.

    I therefore wonder if my issue could be related to using WIFI or because making communicating an Android Client and Windows server and clients?

    Unfortunatelly, I don't have Windows machines to test connections over WIFI (all machines are desktop without any WIFI support) so I can't confirm its a WIFI issue but it sounds like it....

    I attached my Android device log file so that someone with a deeper understanding on UNET or low level networking could find out what's going on...

    This is driving me crazy as it simply blocks the core principle of the game I'm trying to develop... :(

    Thanks by advance.
     

    Attached Files:

  2. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    401
    Hm, I have two guess so far
    (1) Low battery level on the device
    (2) device jumped from one wi-fi network to another...
     
  3. Indiefreaks

    Indiefreaks

    Joined:
    Nov 12, 2012
    Posts:
    64
    There are no issues with the device. And it doesn't state changing to another Wi-Fi network.
     
  4. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    401
    It was LTE or WiFi? (sorry for this question, just to be sure)
    Can you ping your android device? If yes can you attach results? (rtt + jitter) ?
    Do I understand correctly, you have one (or more) PC which are connected via ethernet to router, and android device is connected to the same router via WI-FI?
     
  5. Indiefreaks

    Indiefreaks

    Joined:
    Nov 12, 2012
    Posts:
    64
    No, they all are communicating through Wi-Fi. The other setups were some tests to try to identify if the issue was caused by the code, network or cross device communication.
     
  6. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    401
    hm report the problem please and attach your project (in minimal configuration) as well as description of all steps for problem reproducing. Without this I afraid I cannot help you:( (Something strange, as we definitely tested android)
     
  7. Indiefreaks

    Indiefreaks

    Joined:
    Nov 12, 2012
    Posts:
    64
    I will prepare that this week-ebd abd submit the project. Where should I post that to?
    Moreover, could you please enligth my ignorance letting me know how do you state if an idle server and client are still connected? Do you send periodical pings?

    Thanks
     
  8. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    401
    >I will prepare that this week-ebd abd submit the project. Where should I post that to?
    https://unity3d.com/unity/qa/bug-reporting

    > how do you state if an idle server and client are still connected? Do you send periodical pings?
    yes full analogy with tcp - periodic (config.PingTimeout) keepalive packets
     
  9. Serhii-Horun

    Serhii-Horun

    Joined:
    Apr 12, 2015
    Posts:
    28
    I have the same issue. Is there a solution?
     
  10. Indiefreaks

    Indiefreaks

    Joined:
    Nov 12, 2012
    Posts:
    64
    Hi, yes there is a simple solution: Simply extend the timeout for responses and it sgould work fine.
     
  11. Serhii-Horun

    Serhii-Horun

    Joined:
    Apr 12, 2015
    Posts:
    28
    I think this is exactly what is the problem. But, what exactly needs to change?
    I tried increase NetworkManager.MaxDelay from 0.01 by default, to 0.2(than tried to 2.0) , and tried change NetworkManager.connectionConfig.DisconnectTimeout form 2000(default) ms to 6000 ms. But nothing helped.
     
  12. mDabgar

    mDabgar

    Joined:
    Jan 6, 2016
    Posts:
    3
    please tell me how to do codding for multiplayer over wifi...


    thanks....
     
  13. Serhii-Horun

    Serhii-Horun

    Joined:
    Apr 12, 2015
    Posts:
    28
    no difference in codding (UNET)
     
  14. mDabgar

    mDabgar

    Joined:
    Jan 6, 2016
    Posts:
    3
    what code should be added to run game on 2 or more devices without internet over wifi....
     
  15. Camypau

    Camypau

    Joined:
    Mar 2, 2016
    Posts:
    4
    Hello Sir!
    I have the same issue. Is there a solution?