Search Unity

Mobile Networking over 3G

Discussion in 'iOS and tvOS' started by mattimus, Oct 3, 2011.

  1. mattimus

    mattimus

    Joined:
    Mar 8, 2008
    Posts:
    576
    I've been working through Leepo's ultimate networking guide in effort to get a multiplayer game working with a master server and local hosts. I have been able to get it working while using wifi on an iPhone. However, when I host a game on an iphone using 3G the hosting device is listed on the master server list but the iPhone cannot be connected to.

    Nobody in Leepo's guide thread seems to have any experience with mobile devices and cannot offer any advice, so I thought I would check on the iOS forum. Has anyone successfully set up a master server network that functions over 3G?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Thats not possible.
    3G in nearly every case does explicitely not allow to open any incoming connection on UDP and thats the base to host any game on the device. NAT punchthrough and similar fail too for this reason.

    So simply put: either it works or there is nothing that can be done at all.

    You will then either have to restrict it to WIFI or host dedicated servers for them to join.

    That being said, be warned about the 3G related latency consequences: It can go from 100ms to several thousand ms basically, which no networking I'm aware of can handle without it becoming a meaningless teleport fest as extrapolation beyond a few hundred ms at max is useless.
    So unless your title is turnbased, you might want to rethink supporting 3G

    if the title is turnbased, then dedicated server nodes running on a server machine or using Photon / Smartfox server will do the job much easier and without the fighting against NAT punchthrough which is impossible on 3G
     
    Last edited: Oct 3, 2011
  3. mattimus

    mattimus

    Joined:
    Mar 8, 2008
    Posts:
    576
    Damn, that's what I was afraid of. Thanks for the info.

    As for latency over 3g, it really isn't an issue as the game I'm creating is more or less akin to a turn-based card game. No reaction times at all necessary.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    In that case I would definitely consider Photon or Smart Fox Server as they scale to thousands of users on a single server with relatively little problem and clean data seperation and threaded scaling.

    If you are afraid that the coding will become too complex, give Photons 'Photon Unity networking' a go that you can find for free on the asset store within unity, will remove all those fears as the code looks basically the same just that you now can send much more datatypes then those 7 archaic datatypes supported in unity networking ;)

    What PUN basically does is use photon as a central server inbetween which routes all the data between the clients and the master client (that is the counterpart to the unity hosted server in PUN).
     
  5. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
    GameKit for iOS is a good option for Turn Based games over mobile. You can store data on Apple's servers for free and it supports up to 16 players at a time. Plus it works over 3g or other mobile networks. Of course, like Dreamora said, latency can be an issue depending on service area. But turned based games will work great.
     
  6. rameshkumar

    rameshkumar

    Joined:
    Aug 5, 2013
    Posts:
    50
    hi friends is there any tutorial or link available for making multiplayer game for android platform..please help me..