Search Unity

Local multiplayer

Discussion in 'Scripting' started by suctioncup, Jan 4, 2014.

  1. suctioncup

    suctioncup

    Joined:
    May 19, 2012
    Posts:
    273
    Ive done a bit of searching around and I can't seem to find any tutorials. I would like to implement some very very simple local multiplayer, and I have no networking experience. Just some basic LAN networking - where should I start? Any tutorials?

    Thanks
     
  2. Pirs01

    Pirs01

    Joined:
    Sep 30, 2012
    Posts:
    389
    What I would do instead of tutorials is go to documentation and learn about it. Tutorials might be good to see how people do things but I only check them out after I am familiar with the topic. Not sure what you mean by local multiplayer. Socket connection is a socket connection no matter where the sockets are, local or not. First thing to do is to decide what solution to use: Stock Unity Networking, uLink, Photon are probably the most commen choices. Personally I'm fooling around with uLink because it's more tightly integrated with Unity and allows to write one code utilizing UnityEngine for both client and server side. On the other hand when I look at released projects Photon seams to dominate - not sure why. From my research uLink is obvious choice.
     
    Last edited: Jan 4, 2014
  3. Rs31412

    Rs31412

    Joined:
    Feb 17, 2014
    Posts:
    3
    When people say "Local" they usually mean offline, not requiring a server. I've been searching around for things on this topic too. Still nothing. As for documentation, I don't know where you'd possibly find documentation for offline multiplayer. Anytime you search multiplayer you get referenced to the Networking documentation.
     
  4. KelsoMRK

    KelsoMRK

    Joined:
    Jul 18, 2010
    Posts:
    5,539
    Do you mean Local as in split screen multiplayer running on a single client? Or Local as in LAN with multiple clients running on multiple machines?

    Split screen local would involve setting up 2 sets of Inputs to control different player objects and then rendering with 2 cameras using a viewport that is half the resolution (all of these topics are in the manual and documentation).

    LAN works basically the same as regular networked multiplayer except you don't connect to a Master Server. Have one client initialize a server and the other clients can connect directly to his IP and it'll work (we use Hamachi for LAN testing but you can try it yourself by launching 2 games on the same machine and having the client connect to 127.0.0.1)
     
  5. Joker_54

    Joker_54

    Joined:
    Nov 24, 2013
    Posts:
    64
    Use this Tutorial, it is very clearly written and is also good for LAN Setups.
     
  6. Saketh Verma

    Saketh Verma

    Joined:
    Dec 1, 2014
    Posts:
    1
    hi @KelsoMRK, could u please elaborate on how to implement the LAN u were talking about (one of the clients acts as server), that could be of great help
    Thanq