Search Unity

Many questions about Unity 5.1 Networking and Unity Multiplayer Services

Discussion in 'Multiplayer' started by lrasomattos, Aug 27, 2015.

  1. lrasomattos

    lrasomattos

    Joined:
    Aug 22, 2015
    Posts:
    29
    Hi, I recently jumped into Unity 5.1's networking system (For Ludum Dare 33), and I left the weekend with many questions about how everything works. I did a lot of research during and after, read and re-read many times the manual and the forums, and now I will list some of my concerns and doubts.

    (Sorry about the long text that follows, but It would be great if someone could clarify at least some of them to me! )

    1 - About Unity Multiplayer Service:
    It is currently in preview, but will be a paid service in the future. Will there be a way to build our own servers that implement the matchmaking interface, or will all that stuff be useless for those who want to use their own servers?


    2 - About the Network Manager and Network Lobby Manager monobehaviours:
    I think I just didn't get them. The way I see the lobby is that "room" you enter before going to gameplay. When you are in the lobby you are already connected to a host, (right)? At that point, there is no matchmaking anymore, and you can go from "freely" from lobby scene to gameplay scene and back to lobby. If i'm right, it sounds like the way to implement it with Unity 5.1 is:
    1. Menu / Matchmaking scene with the standard Network Manager implementing matchmaking and following setup:
      1. No player prefab needed here, since we won't instantiate them.
      2. Offline scene is the current Menu scene.
      3. Online scene is the lobby scene.
      4. Destroy on load (We won't need it's matchmaking after leaving menu)
    2. Lobby scene with Network Lobby Manager and useful "OnPlayerAdded" overrides, following setup:
      1. Gameplay player prefab set
      2. Lobby player prefab set
      3. Don't destroy on load (since we need it in the two scenes).
    3. Gameplay scene with no manager, everything will come working from lobby.
    Now the concerns and problems I found with this:

    First: because the Lobby Manager extends the Network Manager it sounds strange to have two Network Managers, it looks like it will connect to Unity Matchmaking services twice, won't it cause any problems? Should I implement the matchmaking in another monobehaviour (like in the manual), and discard the matchmaking implemented features in Network Manager?

    Second: When the player is in a lobby, is it still counting as a CCU in unity service? As it is already connected to another host. When does it stop counting? Anyway to disconnect from the matchmaking service? How does CCU is counted?

    Third: How do I pass the matchmaker info to the new scene, and to the new Lobby Manager so it connets to the host? Do I even need to pass it, Or setting Utility.SetAccessTokenForNetwork will be enough to set everything up?


    4 - About server authority, movement prediction and lag compensation:
    I've seen the usual Valve's link, and many posts in the forum (but many of them are old), and there are some things I'm missing:

    First: Does Unity even considers the idea of server authority for fast paced games? All I've seen in the forums leads to a "no way to do it in Unity because physics are non deterministic".

    Second: Is it possible to use Network Transform with enough quality for a fast paced game? Does it implement any way of prediction, if not, what is the difference between Transform sync mode: CharacterController and Transform?

    Third: How one would re-calculate the movement of a character controller, in case movement prediction predicted wrongly? Since we need physics to be recalculated for each movement of the player?

    Fourth: I've seen a "Networking: Standalone Simulation Server" for 2016's Roadmap, anyone knows what is that about, maybe physics simulation will come then?

    Sorry for asking all this in one post, but it sounded better than creating and bumping many ones. Any tips are welcome.
     
  2. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    If you would like you should take a look at my website www.numbapple.com at the top you will find a section called crossnet at the bottom of the tutorials you will find the package to download its free.. I spent a long time making it and decided to release it as a tutorial / network solution / what ever you want.. You can also find the package in my signature as a direct link..