Search Unity

Singleplayer vs Multiplayer

Discussion in 'Multiplayer' started by joshcamas, Mar 13, 2018.

  1. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    I'm just starting to look into the networking systems into Unity, and I have a question.

    When the player is in "singleplayer mode", is the easiest way to manage this just to still have a network manager and everything, but just have only a server/client (host) and no remote clients? That sounds logical to me at least.

    Thanks!

    Josh
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Yeah unfortunately UNET's HLAPI doesn't have a built in single player mode. What you said is an idea others have suggested in other threads to work around the lack of that feature.
     
  3. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    Woah... That's actually really crazy...
    But okay, I'll look around :) thank you
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I remember reading that Photon has a single player mode. Don't quote me on it, but it may be worth taking a look.
     
  5. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    It does, and you don't need to make any changes to your game to account for single player vs multiplayer, it's very handy. In single player mode, all network commands, RPCs etc. succeed even without an internet connection active.
     
  6. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,521
    Can you switch from single to multi on the fly?
     
  7. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,735
    I believe you have to select single/multi player when not in a room i.e. you haven't started a session, but you might want to check the docs to confirm that.