Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

from singleplayer into multiplayer

Discussion in 'Multiplayer' started by fredr92, Apr 11, 2014.

  1. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    Hi

    My original plan was too create a open world sanbox game, where the players can do anything just playing around and play the way they like ! But i figured out really fast creating a multiplayer game is gonna be very hard.

    So i decided to make a singleplayer mode first that are exactly the way i want the multiplayer mode too be just you are alone in the world since its singleplayer offline.

    At this time the singleplayer is pretty mutch finish.

    And i want too start with multiplayer and i dont know where too start? What is so different from singleplayer and multiplayer? I watched alot off tutorials , and it helped a little, but can someone come with some good advices?
     
  2. nastasache

    nastasache

    Joined:
    Jan 2, 2012
    Posts:
    74
    Main differences from singleplayer to multiplayer are:
    - multiplayer need a "controller" for connected machines; this may the Unity masterserver or other similar solutions
    - when code for multiplayer, you have to send the info like positions and actions of a player over the network, and code to receive the info on all connected machines; this may be done writing code for RPCs and/or other Unity network dedicated functions (or similar functions provided by others).
    Making the multiplayer having already done single player is not simple; for you, I think learning and integrating Photon (https://www.exitgames.com/) is the best option.
     
  3. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    Thanks i will check it out. If anyone else has something helpfull too say about multiplayer feel free too post it here.
     
  4. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    The way I'm doing multiplayer is like this:

    I have:
    1 Host player
    5 Client players


    All key inputs are sent to the host player. The host player does all the physics and game calculations and decides whose winning etc. Then it sends details to the client players. The client players mainly just clone whatevers happening on the host player (which is what networkview components are for).

    The host player can either be one of your players (easiest) or you can have your host player on a server somewhere in the cloud (I've no idea how that works or even if the Unity license allows this!).


    So the first thing I would after you get you clients to connect to the host is get your client games to copy everything from the host game.