Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Hotspot/wifi multiplayer game using unity

Discussion in 'Connected Games' started by rpk2805, May 14, 2019.

  1. rpk2805

    rpk2805

    Joined:
    Feb 13, 2019
    Posts:
    13
    Hi guys i'm planning to make a wifi multiplayer game in android just like mini militia and i have been searching for long for a solution to implement this. In many forums i saw suggestions to use unet but it shows its deprecated and i think photon multiplayer supports only server based multiplayer. Can anyone help me regarding this.
     
  2. rpk2805

    rpk2805

    Joined:
    Feb 13, 2019
    Posts:
    13
    can we use unet again?
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    5,428
    The network discovery feature of Unet was a bit buggy, and doesn't work on some android devices. I don't think it is a popular feature either, as I can't think of another network API which implements it (I admit I haven't done an exhaustive search). If your game can support clients manually typing in the IP address of the server, most network API's will work for what you're trying to do though.
     
  4. aabramychev_

    aabramychev_

    Joined:
    May 10, 2019
    Posts:
    3
    :) 1. broadcast works strange on some android devices, especially on google pixel. But I think that wifi router will accept broadcasting..
    2. The problem here not in broadcasting, but mostly with the automatic discovery hot spot device... in general wi-fi direct (some sort) should be used, but android solution is not compatible with iPhone...

    You can try to use hot-spot solution, (you can use any network library for this) with unit do following
    1. Allow hot-spot on one device
    2. Connect other device to hot-spot device
    3a. Start broadcasting onto-spot device and obtain connection on other device or
    3b. check gateway address on other device and try to connect to hot-spot using this address
    3b can be used with other libraries not only obsoleted unit lap
     
  5. rpk2805

    rpk2805

    Joined:
    Feb 13, 2019
    Posts:
    13
    but which one to use for doing this?photon or unet? when i used unet its saying that its deprecated and photon forum says that photon does not support offline multiplayer
     
  6. aabramychev_

    aabramychev_

    Joined:
    May 10, 2019
    Posts:
    3
    Hmm, you can try with unit, and you can ping @nxrighthere posts here fore enet using in unity. Transport api usually is pretty similar to each other, so you (I hope) will be able smoothly migrate to unity solution when it will be ready. Check as well @wobes posts afaik he was able to use this library with ecstatics and got awesome results, it doesn't support broadcasting, so you will need to use 3b approach
     
    TwoTen likes this.
  7. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    457
    ENet supports IPv4 broadcast out of the box, this feature enabled at the socket creation stage for hosts at both ends. All that you need to do is just send a connection request to 255.255.255.255 address, ENet will automatically respond to the broadcast and update the address to a server's actual IP.
     
    aabramychev_ and TwoTen like this.
  8. Jadara

    Jadara

    Joined:
    Dec 8, 2016
    Posts:
    4
    If you can use low level stuff where you send byte[] I'd recommend Google Play Games Service(Nearby Multiplayer) or tcpclient/udpclient. That Is what I am using.
     
    doctorpangloss likes this.
  9. rpk2805

    rpk2805

    Joined:
    Feb 13, 2019
    Posts:
    13
    does google play games support local wifi multiplayer