Search Unity

  1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

Unity Multiplayer Feedback needed! New Doc for Getting Started with Unity Multiplayer

Discussion in 'Multiplayer Networking' started by Erik-Juhl, Nov 19, 2015.

  1. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    864
    You got to actually "tag" Erik like so in order to get his attention:

    @Erik Juhl

    But yeah, I'm also curious to know.
     
    isidro02139 likes this.
  2. jroto23

    jroto23

    Joined:
    Oct 19, 2015
    Posts:
    80

    Thanks!
     
    isidro02139 likes this.
  3. jroto23

    jroto23

    Joined:
    Oct 19, 2015
    Posts:
    80
    Bump...
    Hopefully he reads this and can give us a time frame / status

    @Erik Juhl
     
    isidro02139 likes this.
  4. DSebJ

    DSebJ

    Joined:
    Mar 30, 2013
    Posts:
    101
    The doc is really good - wish I had found this before I started :)
     
  5. foxvalleysoccer

    foxvalleysoccer

    Joined:
    May 11, 2015
    Posts:
    97
    How do i get this set up to play on two different computers? Right now it works if i open two browsers on the same PC. But when I put it on my server and test on two different computers it does not network. What piece am I missing?
     
  6. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    864
    External IP, or use Unity MatchMaking service.
     
  7. foxvalleysoccer

    foxvalleysoccer

    Joined:
    May 11, 2015
    Posts:
    97
    Is there a tutorial that you know of that does this?
    I have a server. If i change the network address from local host to the server ip address will it work?
     
  8. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    864
    That's is where you enter in your external IP address, or your DNS domain. localhost is a domain name with the IP address of value, 127.0.0.1.

    If you are thinking in where to put the IP address other than the text field, where else would you put it?
     
  9. foxvalleysoccer

    foxvalleysoccer

    Joined:
    May 11, 2015
    Posts:
    97
    I got the ip of my server and put it in the network address in the network manager. I changed the port to 80. Its not working. Do I need to keep the port to 7777? What else might I be missing?
     
  10. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    113
    Use a port that you know for sure will be open. I found issues when using 7777 in Canada.
     
  11. logon_13

    logon_13

    Joined:
    Dec 29, 2015
    Posts:
    2
    This is great but I have an important question about UNET.

    I'm using Unity 5.3.2f1 and I'm finding the method OnServerStart() is only being called the first time im click host. If I shut down the server without closing it and click host again OnServerStart() is not being called. To me this is unexpected behavior

    Thanks in advance to anyone who replies
     
  12. logon_13

    logon_13

    Joined:
    Dec 29, 2015
    Posts:
    2
    Interesting I should probably post a bug report. I fixed it by having an offline scene and an online scene
     
  13. Chris_Devl

    Chris_Devl

    Joined:
    Jun 17, 2014
    Posts:
    10
    Could we get a version for a dedicated server instead of a player host?
     
  14. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    864
    Make a Unity Feedback instead of here.
     
  15. Erik-Juhl

    Erik-Juhl

    Unity Technologies

    Joined:
    Jul 11, 2012
    Posts:
    59
    Hey! Thanks for all the feedback. The "official" version is now part of the online docs with the rest of UNet:
    http://docs.unity3d.com/Manual/UNetSetup.html

    I see a few questions about when we would add more to it. For that I'd like to hear what you all think we should do next. We originally had placeholders for match maker and relay server but went into more game play stuff instead. Should we continue with match maker and relay server or are there more game play related things you all would prefer to see?
     
  16. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    113
    Personally more game play related stuff. Also replace that old gui hud, it's disturbing.

    I'm unsure of the more game play related stuff as of now because I have not tested all the current game play related stuff you currently have implemented.

    Is there a list where I can go over them?

    Thanks
     
  17. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    864
    The first thing I would suggest you all to do is to create a new sticky thread to clean up all the clutter of posts no longer relevant towards getting the feedback you wished to hear from (since your "official" doc is out, it would be better to stick to the most up-to-date info.)
     
    pKallv likes this.
  18. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    245
    Personally, I would like to see the docs getting improved especially on those parts which still have the most crucial open gaps. I think it would be nice to have enough documentation available in order to enable people to create production ready multiplayer games. In many cases this would also include matchmaking and relay server. In addition, I would like to suggest to work on connecting the UNET documentations with the real project examples in the forum. I think it is important to keep those examples up-to-date so that they work without errors and that they are sufficiently documented.

    Maybe it would be a good idea to create a public list somewhere in the forum which collects all open ToDo's for improving UNET and its docs so that people can see what you are currently working on. This way people can provide feedback on priorities for the open points. Moreover, if people notice that something important is not included in that list, they can point you to a respective improvement measure. The keyword is transparency and I think it would help the community to help you, the Unity devs, to improve UNET and the docs with keeping a focus on the right things.
     
    Last edited: Feb 19, 2016
  19. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,480
    I looked at it and from the start there is a problem: No explanation for what is a client or host! I feel there needs to be both VERY technical stuff in the docs AND very EASY stuff in the docs. However I find this video does a great job of explaining the beginning of uNet:

    Also the docs need to have better description for the components (such as the Network Transform).

    Everything else seems good!
     
    Last edited: Feb 25, 2016
  20. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    864
    We actually expected you to have this article read already.
     
  21. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    I really need help at learning LLAPI can any1 gimme a link to where to start. And please don't give Unity's manual it sucks. I tried and did not understand anything.
     
  22. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    864
    Make a new thread and ask about what you don't understand in chunks/portions, so we can teach you about it.
     
  23. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
  24. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    Please make UNET LLAPI tutorial!
     
  25. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    Hi @Erik Juhl, thank you so much for this. I've been using UNet a while but will still go through this to make sure my basics are solid. Nowhere in the official version does it mention adding DontDestroyOnLoad() in a script somewhere on the player object. I've found this is necessary so that the player isn't destroyed when calling NetworkManager.ServerChangeScene().

    Could you let us know if adding DontDestroyOnLoad() in this way is correct?
     
  26. PhilippG

    PhilippG

    Joined:
    Jan 7, 2014
    Posts:
    209
    Concerns with bullet replication

    I was recently working on replicating bullets and I followed you example, but when testing, I started to have some concerns and its quite obvious.
    If you are the host, there is no problem at all. I press fire and bullets spray immediatly.
    But if I am a remote client, and I send my request to spawn a bullet out to the server, there might be significant latency between me pressing the button and actually see my bullet flying. Every player would instantly complain if bullets appear late.
    This is why I'd suggest the player should instantiate the bullet immediatly and do the replication for the other clients afterwards.
    I'm just not sure about how to do this the cheapest and most reliable way possible. I currenty call a [Command] method that calls a [ClientRpc] with arguments (string prefab, Vector3 position, Quaternion rotation) so I can instantiate it on the other clients with resources load (with a !isLocalPlayer check) . This means the bullet has no network identity and it lives independently on all clients. Only either the server or the instigating player should deal damage of course.
     
    F-R-O-S-T-Y and rikey like this.
  27. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    124
    Hi.
    I did some major changes on my project, partly taken from this documentation and I have a question.
    Regarding the following code, I can't really see what I'm missing or am I doing it completely wrong?

    Code (CSharp):
    1.                        if (Input.GetKeyDown (KeyCode.Q)) {
    2.                 CmdSetNewPrimary ("Sten Gun");
    3.             }
    4.         }
    5.     }
    6.  
    7.  
    8.     [Command]
    9.     public void CmdSetNewPrimary(string newPrimary){
    10.         RpcSetNewPrimary();
    11.     }
    12.  
    13.     [ClientRpc]
    14.     public void RpcSetNewPrimary(){
    15.          //What did I do wrong over here?
    16.         wpPrimaryCurrent = newPrimary;
    17.     }
     
  28. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    you need to pass newPrimary to RpcSetNewPrimary().
     
    F-R-O-S-T-Y likes this.
  29. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    124
    It doesn't seem to work. Am I doing anything stupid? See the following code:
    Code (CSharp):
    1. [Command]
    2.     public void CmdSetNewPrimary(string newPrimary){
    3.         RpcSetNewPrimary(newPrimary);
    4.     }
    5.  
    6.     [ClientRpc]
    7.     public void RpcSetNewPrimary(){
    8.         wpPrimaryCurrent = newPrimary;
    9.     }
     
  30. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    Your RpcSetNewPrimary() should look like this:

    Code (CSharp):
    1. [ClientRpc]
    2. public void RpcSetNewPrimary(string newPrimary){
    3.         wpPrimaryCurrent = newPrimary;
    4.     }
     
    Justice0Juic3 likes this.
  31. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    124
    Thanks man. :rolleyes: This will save me a lot of time instead of having to invoke a seperate Command and RPC everytime.
    ...Because there's going to be about 50 choosable Primary weapons in the game. :p

    Cheers!
     
  32. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    Sounds like I might need to clarify in case we're not on the same page. You'll still have to call the Command that then calls the RPC. The RPC just needs to receive the parameter. i.e.

    Code (CSharp):
    1. [Command]
    2. public void CmdSetNewPrimary(string newPrimary){
    3.     RpcSetNewPrimary(newPrimary);
    4. }
    5. [ClientRpc]
    6. public void RpcSetNewPrimary(string newPrimary){ // <--- this parameter
    7.     wpPrimaryCurrent = newPrimary;
    8. }
     
  33. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    124
    No need to clarify, I understood your previous quote already.
     
  34. Reizla

    Reizla

    Joined:
    Nov 5, 2013
    Posts:
    129
    Started on the web-documentation for matchmaking and I think it works pretty well. On the other hand, the explanation of the NetworkTransport API is very low and needs a lot of working. It's minimal on the documentation and example code and the code listed is in Java instead of C# :(
     
  35. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    864
    You should report that in the Documentations subforum.
     
  36. Somaweb

    Somaweb

    Joined:
    Feb 4, 2015
    Posts:
    12
    It would be also nice, to have an example how to correctly leave a game and a "lobby"
     
    dylanh7244 likes this.
  37. dylanh7244

    dylanh7244

    Joined:
    Jan 12, 2016
    Posts:
    379
    Hi @Erik-Juhl -- Great job -- Few things that I would 100% emphasize:

    1. The lobby and lobby scripts. The current ones out there are very vague, details regarding staging are non-existent, and matchmaking docs are extremely sparse (and include syntax errors for the lobby callbacks - docs seem to be missing an import statement of some kind).

    There's also not much flow -- I found a sample Unity project with awesome flow for basic networking, but it doesn't even include an editor LobbyManager Component -- it was all old API code.

    LobbyManager docs are also very sparse and with no flow in regards to using it with other lobby feats.

    Please add more consistent/detailed docs with more examples for the lobby and all that relates to the lobby - esp staging and matchmaking (+MM with friends) - and Show a general flow of events (Quickstart) for your most basic lobby setup.

    2. Host Migration workaround. This feature is confirmed as a reproduced bug since June and has not been fixed yet - as this is a major feature, please post a workaround as it's been quite a long time while not yet fixed.

    3. [Added 11/23/2016] Add docs/examples for NetworkLobbyManagerComponent's "Show Lobby GUI" (EDIT: Found Here on BitBucket - still needs API doc update)

    Thank you.
     
    Last edited: Nov 23, 2016
    foobar, isidro02139 and kortenoever like this.
  38. kira419

    kira419

    Joined:
    Dec 16, 2016
    Posts:
    3
    New Game Guide: 24 pages with pictures.
    New Lobby Guide: 1/4 page sad summary.

    [​IMG]
    Current Game Guide: 18 sections with pictures.

    [​IMG]
    Current Lobby Guide: 15-bullet summary. Less bullets than pages. What about callbacks? What about replacing the OnGUI (which is 50% of the effort)? What about handling common events? How do I get what info from where, and when & where do I do it?[​IMG]

    [​IMG]

    I find replacing the OnGUI events harder than anything, but there's no guide. I thought it seems pretty important, hm?

    There are already game guides. How about a lobby guide focus? It's the only one missing and it's confusing.
     
    Last edited: Dec 17, 2016
    dylanh7244 and theANMATOR2b like this.
  39. dylanh7244

    dylanh7244

    Joined:
    Jan 12, 2016
    Posts:
    379
    This is where I'm at :) They have a bitbucket for NetworkHUD, which helps, but it's dated and doesn't use HLAPI, so it doesn't really help with much since you don't know what callback to call and where. Out of the 30ish new callbacks - it's hard to tell where to put what, like you said, since onGUI uses the old stuff/non-HLAPI.

    However, there's no bitbucket that I could find for the LobbyGUI. Anyone know where this is? It shows player list added/sync'd, ready up/down button, exit and enter lobby buttons. This would be a great reference (even though it's likely dated, too) if I can find it ! I tried asking a few weeks ago, but no response. Which leads me to another suggestion:

    While the docs are being updated, especially HLAPI/Lobby/UNET/HostMigration/MatchMaker (where there are no updated docs/demos), please add some staff to answer questions in the mplayer forum! We NEED you!
     
    Artaani and isidro02139 like this.
  40. dylanh7244

    dylanh7244

    Joined:
    Jan 12, 2016
    Posts:
    379
    Wait a second.... I just realized the doc revamp draft was posted OVER 1 YEAR AGO! *facepalm*

    This entire mplayer forum is completely abandoned by staff about 1.5 years ago. No staff will even challenge these words.
     
    Last edited: Mar 1, 2017
    Artaani likes this.
  41. Jtoomer

    Jtoomer

    Joined:
    Jan 30, 2017
    Posts:
    38
    I had been having some trouble getting multiplayer to work and the document went a long way to helping out with that. Any sort of updated tutorial on the topic is a good thing in my opinion.
     
    theANMATOR2b likes this.
  42. Aurecon_Unity

    Aurecon_Unity

    Joined:
    Jul 6, 2011
    Posts:
    223
    Hi
    Just trying this networking tutorial - https://docs.unity3d.com/Manual/UNetSetup.html and when I press play in the editor when the build is running (and hosting) then the build closes and nothing happens in the play window. If I leave both LocalPlayerAuthority and ServerOnly false (on the NetworkIdentity component) and build then the build window stays open and I can join as client from the editor (play mode). In this case both cubes move but only in the one window (is this correct?)

    Then, moving to the next step, and changing the code so only the local cube moves then the build window closes when pressing play in the editor no matter what the other settings are. Please help. Thank you.