Search Unity

Unity network manager, and multiple play scenes

Discussion in 'Multiplayer' started by kennyrogers7272, Mar 22, 2017.

  1. kennyrogers7272

    kennyrogers7272

    Joined:
    Jan 22, 2015
    Posts:
    38
    I've been reading through the docs for a couple of days and I still have questions. I've even watched this video that walks through the Tanks app


    1) My game has eight maps that can be chosen from. After the host chooses one of the maps, how does this get specified to all clients? I see that I'm supposed to drag only one play scene into the Network Manager inspector.

    2) I've discovered the lobby hook script, and I believe this is how we send player names from the lobby to the play scene. Can anyone recommend some reading material on this, as I find both the documentation and Tanks project to be a little overwhelming.

    3) I my game, each user is in fact playing their own game, but competing for the highest score. Each client needs to see only the other player's progress. I believe this gets done with SyncVars. However, I'm confused about what the players are supposed to be. Do I need to specify an actual game object for each player, despite there being no "player" characters in my game?

    Any advice is appreciated.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
  3. kennyrogers7272

    kennyrogers7272

    Joined:
    Jan 22, 2015
    Posts:
    38
    My vision is a game where two players do their best while seeing opponent progress in real time. It's an air traffic control game. Ideally, a player would see information about their opponent such as numTakeoffs, numLandings, crashes, and stress. The game would end when someone has a crash, or when someone achieves 100 airplanes moved. I suspect the multiplayer platform is what I'd need, but I like the NetworkServerSimple concept, and will read through both links.
     
  4. kennyrogers7272

    kennyrogers7272

    Joined:
    Jan 22, 2015
    Posts:
    38
    Any answers?

    My game has eight maps that can be chosen from. After the host chooses one of the maps, how does this get specified to all clients? I see that I'm supposed to drag only one play scene into the Network Manager inspector.
     
  5. MichalBUnity

    MichalBUnity

    Unity Technologies

    Joined:
    May 9, 2016
    Posts:
    18
    Take a look at https://docs.unity3d.com/ScriptReference/Networking.NetworkManager.ServerChangeScene.html

    If you want a more in-depth example, check out the Tanks!!! example that can be found here: https://www.assetstore.unity3d.com/en/#!/content/80165
     
  6. kennyrogers7272

    kennyrogers7272

    Joined:
    Jan 22, 2015
    Posts:
    38
    Thanks, MichalBUnity. I've gone through the project you posted, but found it difficult to sift out the info I needed. Sounds like NetworkManager.ServerChangeScene is all that I need to make all clients move to a specific scene.