Search Unity

Unity Multiplayer Is it possible to pair two devices via wifi for a multiplayer game - no remote server ?

Discussion in 'Connected Games' started by bali33, Jul 8, 2015.

  1. bali33

    bali33

    Joined:
    Aug 14, 2011
    Posts:
    135
    Hello guys,

    I'm not familiar with multi-player and Unet - I was wondering if is is possible to make a multi-player game without using a remote server ? One of the devices would be both a client and the server application - is that possible, if so, how to achieve that ?

    Thank you
     
  2. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    If you are talking about wifi direct - so far no... But we are working on this. If you are talking about connecting two devices - yse if they are have public ip or are working in the same LAN. Was I clear?
     
  3. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,137
    I'm curious how you can do LAN but not wifi. Can there be more than 2 devices on a LAN connection?
     
  4. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    Hmm, LAN is a local network, if your computers connected to each other via twisted pair, switches and routers and belongs to the same subnet - it is the LAN :) For example your office has one router, 10 computers and 2 switches - all 10 computers belongs (usually) the same LAN; LAN means the same subnet.
     
  5. Zephilinox

    Zephilinox

    Joined:
    Sep 15, 2014
    Posts:
    14
    If you have two laptops connected to the same connection/access point, then they are on the LAN and everything is fine.
    If you have two phones with Wi-Fi that is not connected to anything, then there is currently no way to do multiplayer. (https://en.wikipedia.org/wiki/Wi-Fi_Direct)
     
  6. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,137
    Oh, so you wouldn't be able to host and join a game on 2 mobile phones with their own signal unless they were connected to the same network? What about an adhoc network?

    Haha I just hate relying on master servers. And I enjoy sending more data over LAN :D
     
  7. fantom642

    fantom642

    Joined:
    Oct 14, 2013
    Posts:
    20
    I'm looking forward to have WiFi Direct in Unity, I would really appreciate this feature.
     
  8. vksamhith

    vksamhith

    Joined:
    May 10, 2016
    Posts:
    3
    Is wifi direct available now in unity 5.3.4.Please let me know if its available in beta.
     
  9. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    @vksamhith no, not ready yet. There are some serious issues with this
    feature:
    1. No native library for android
    2. different implementation for google and samsung
    3. different implementation on ios via bonjour..
    4. difficulties to marry ios and android
    Unfortunately i would say it won't be ready for 5.4 as this build is considering as stable and nobody will allow me to dd new experimental feature.

    Sorry about this
     
  10. ZHUyyyyyyyy

    ZHUyyyyyyyy

    Joined:
    Dec 28, 2015
    Posts:
    4
    So now there are solutions to it? ~ in the latest version Unity2017.2
     
  11. aabramychev

    aabramychev

    Unity Technologies

    Joined:
    Jul 17, 2012
    Posts:
    574
    :( not yet just very busy with another stuff. Sorry for that
     
  12. Carlety

    Carlety

    Joined:
    May 23, 2019
    Posts:
    1
    Is it possible to make multiplayer now ?

    Between two Android phone, one activate the hotspot, and the other get connected to this hotspot, as on application like ShareIt, sharing data between two Android phone from this way
     
  13. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,340
    Activating a hotspot is not "WiFi Direct" that this thread is discussing. Whether a hotspot will work would depend on what firewall rules the hotspot host sets up. I've never bothered to investigate that, and it is such a niche use case to develop a multiplayer game for that I seriously doubt you'll find anyone who has, that I'd just suggest trying it yourself and seeing how it goes.
     
  14. doctorpangloss

    doctorpangloss

    Joined:
    Feb 20, 2013
    Posts:
    216
    No, not in Unity.

    Prior to its port to Unity, Spaceteam had a pretty decent local discovery and networking protocol. But that was iOS only. There is no currently-supported iOS+Android cross platform compatible local discovery plugin.