1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. Unity 2017.1 beta is now available for download.
    Dismiss Notice
  5. Unity 5.6 is now released.
    Dismiss Notice
  6. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  8. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice

Networking Lobby Example Beta Q&A

Discussion in 'Community Learning & Teaching' started by UnityGuillaume, Jul 17, 2015.

  1. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    We have released a beta version of the Networking Lobby Example on the Asset store .

    https://www.assetstore.unity3d.com/en/#!/content/41836

    This pack contains a multiplayer lobby using either the Networking matchmaker service (https://multiplayer.unity3d.com) or a manual connection by IP address.

    NOTE : This is a beta! Some bugs may be expected. You can help make it better by please reporting any problem you have with this package using the in-editor bug reporter!

    USAGE

    Instructions are included in Standard Assets/Network/Instruction.txt

    1. You will need two scenes : one for the lobby, one for the game
    2. These scenes need to be added to the Build Settings window. (File > Build Settings)
    3. Drop the LobbyManager Prefab into your scene
    4. In the LobbyManager script component, drop your scenes into the fields "Lobby Scene" and "Game Scene".
    5. Drop your game player prefab into "Game Player Prefab" slot. This prefab will need to have a script deriving from NetworkBehaviouron it. (See Spaceship in SamplesScene/Prefabs for an example of a Game Player Prefab)
    6. Set “Min Player” to the minimum number of players needed to start a game (0 = no minimum)

    Additionally, if you want to pass data from the lobby player (the sample one has a name and a colour) , you can derive a script from LobbyHook (see SampleScenes/Scripts/NetworkLobbyHook for an example) and add it to your own LobbyManager

    Please note that the prefab will output information / warnings in the Console. This is normal! To control the amount of logging output by the Lobby, in the LobbyManager script inspector change the Log Level parameter.

    Lobby screen

    newlobby.png

    You can add a local player with the Add Local Player "+" icon.
    The Remove Icon will be grayed out for other clients players (apart if you are the server) or if you are the only local player (you can't remove all your players!)

    Game Lobby Example

    You can create a lobby:

    1. Through the Matchmaker by clicking Create after entering a name
    2. For Direct Connection by clicking Play and Host.

    Both will create a local server on your machine and connect you to it.

    Other players can then join by doing

    1. "List Servers" (if the match was created with Matchmaker)
    2. By entering your IP address (if you created with Play and Host)
    NOTE : Direct IP can fail if you are behind NAT, firewall etc... It is recommended to use the matchmaker for non LAN game!

    Matchmaker

    To be able to use the matchmaker, you need to create a project in the Unity Services tab (Window > Unity Services and select Multiplayer in the list)

    Sample Asteroid

    The directory SampleScenes/Scenes contains two samples scenes for a simple networked game of Asteroid. It's a simple example here to show how to interact between a lobby and a game.

    Open the lobby scene to see how a lobby is set.

    The script SampleScenes/Scripts/NetworkLobbyHook.cs will show you how to pass info from the LobbyPlayer to the GamePlayer.
     
    luochuanyuewu and rikey like this.
  2. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    My computer starts to overheat when running the sample lobby scene in the editor or as a standalone on Mac. My Mac is less than 2 years old, but I don't have a dedicated graphics card. Could this be why, due to the sample lobby using a taxing UI?
     
  3. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    629
    It's more likely you have a problem with the cooling system in your PC, blocked heat sink or failed fan possibly.
     
  4. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    Nope, nothing wrong with this MacBook Pro.
     
  5. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,607
    Have you run the profiler of this?

    We're not seeing anything wrong as far as we can tell...

    If you can find a glitch, we'd love to know about it.
     
  6. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    Hi Adam,

    Thanks for your response. I just ran it with the profiler, and I'm not sure what to look for, but nothing jumped out at me. As far as the laptop getting hot, I'm 99% sure it's because I don't have discrete graphics.
     
  7. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,607
    Do you find this to be true with other Unity scenes? Or just the lobby?

    If you want, you can file a bug report from you in-editor reporting tool, and it will include a snapshot of your hardware.
     
  8. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    This is the first time I've seen the laptop heat up with a project running in the editor; it's a project with just the assets from the package. A game like Portal will heat up my laptop, so that's why I think it's a weak graphics hardware thing.

    I'll go ahead and do that in case it is of any help.
     
  9. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,607
    Thanks. Can you get the report number to me, just in case?
     
  10. webagency1

    webagency1

    Joined:
    Jun 13, 2015
    Posts:
    9
    Hi! I did all that is described in instruction 1-6, but it is working only on local machine. When I try to connect with other users over the web it is not working. What else should I do to make it working?
     
  11. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    Direct IP connections may fail for lots of reasons (firewall, NAT, routers etc...) (

    That's why the matchmaker is here, a server at Unity will connect two computer, taking care of all that.
    To use the matchmaker, as stated, you need a cloud project id, and to get this, you have to register your project at https://multiplayer.unity3d.com

    (nice side effect, setting a project ID will also connect your project to all the Unity service, such as Analytics, cloud build, database, Ads etc. )
     
  12. webagency1

    webagency1

    Joined:
    Jun 13, 2015
    Posts:
    9
    Hello, I have registered my project on https://multiplayer.unity3d.com and use matchmaker as stated in the instruction. But it is not working. Is there any detailed instruction on how to use matchmaker? Maybe I am doing something wrong... I just registered my project and entered project ID.
     
  13. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    Hum it should be the only thing to do : enter the cloud ID that https://multiplayer.unity3d.com five you in the "Cloud Project Id" field in "Edit > Project Settings > Player"

    On one player :
    Enter a name in "Create a Game" section of the matchmaker, and click "create".
    Other players:
    Find it by clicking "List server"

    What does not work? Crash? error? Can find the game from a client?

    What is your version of Unity?

    Try to create the game in the editor and see if there is warning/error (yellow or red text) in the console.
    Then create the game on a standalone build, and try to List Servers in the editor and check also for error/warning in the console.
     
  14. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    After creating a match, but before starting it, if I go back to the main panel and call StopMatchMaker, StopServer, and StopClient, OnStartLocalPlayer on the lobby player object is automatically called between the calls to StopServer and StopClient. Is this a bug?
     
  15. webagency1

    webagency1

    Joined:
    Jun 13, 2015
    Posts:
    9
    I use Unity 5.1.1f1. I created new project. Created Cloud id - fe107d36-15a7-4481-8cff-6950ebc1f5fe and entered it in Player settings.
    When I hit play, give a game name "A3" and hit Create into "Create Game" section I have got following errors:
    Failed to read the ID for the match maker, please set the Cloud Project ID string in the Player Settings (see https://unet.cloud.unity3d.com).
    UnityEngine.Networking.NetworkManager:StartMatchMaker()
    UnityStandardAssets.Network.LobbyMainMenu:OnClickCreateMatchmakingGame() (at Assets/Standard Assets/Network/Scripts/Lobby/LobbyMainMenu.cs:59)
    UnityEngine.EventSystems.EventSystem:Update()
    MatchMakingClient Create :https://mm.unet.unity3d.com/json/reply/CreateMatchRequest
    UnityEngine.Networking.Match.NetworkMatch:CreateMatch(String, UInt32, Boolean, String, ResponseDelegate`1)
    UnityStandardAssets.Network.LobbyMainMenu:OnClickCreateMatchmakingGame() (at Assets/Standard Assets/Network/Scripts/Lobby/LobbyMainMenu.cs:60)
    UnityEngine.EventSystems.EventSystem:Update()
    System.FormatException: FAILURE Returned from server: Failed CreateMatch for appId=Invalid
    at UnityEngine.Networking.Match.Response.Parse (System.Object obj) [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.Match.CreateMatchResponse.Parse (System.Object obj) [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.Match.NetworkMatch+<ProcessMatchResponse>c__Iterator0`1[UnityEngine.Networking.Match.CreateMatchResponse].MoveNext () [0x00000] in <filename unknown>:0
    UnityEngine.Networking.Match.<ProcessMatchResponse>c__Iterator0`1:MoveNext()
    JSON Response: [[UnityEngine.Networking.Match.CreateMatchResponse]-success:False-extendedInfo:Failed CreateMatch for appId=Invalid]-address:,port:0,networkId:0x0000000000000000,nodeId:0x0000,usingRelay:False
    UnityEngine.Networking.Match.<ProcessMatchResponse>c__Iterator0`1:MoveNext()
    Create Failed:[[UnityEngine.Networking.Match.CreateMatchResponse]-success:False-extendedInfo:Failed CreateMatch for appId=Invalid]-address:,port:0,networkId:0x0000000000000000,nodeId:0x0000,usingRelay:False
    UnityEngine.Networking.NetworkManager:OnMatchCreate(CreateMatchResponse)
    UnityStandardAssets.Network.LobbyManager:OnMatchCreate(CreateMatchResponse) (at Assets/Standard Assets/Network/Scripts/Lobby/LobbyManager.cs:227)
    UnityEngine.Networking.Match.<ProcessMatchResponse>c__Iterator0`1:MoveNext()

    If I am on the project page https://multiplayer.unity3d.com/orgs/dmitry-4430781/projects/a3/unet and refresh page, I got following error: Unable to load project. (400).
     
    Last edited: Aug 4, 2015
  16. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    Upgraded to 5.1.2p3 and installed a fresh copy of this package. When clicking any of the following buttons and then clicking "Back" at the top, the error message below repeats. Thanks for any help.

    Buttons: "Create", "Play and Host", "Dedicated Server"

    Error message: "host id {0} has been already deleted"
     
  17. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    Thanks for all the report!
    Currently unable to look at it, but every report is noted and I'll take a look at all that next week. The help to make that package as stable as possible is greatly appreciated!
     
  18. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    285
    Did anybody notice that the color is not being synced from the lobby player to the game scene player in the NetworkStarter example from Unity.

    This is the same problem I'm having with my game.

    Anybody knows how to solve it?

    Thanks
     
  19. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    Could you try with latest 5.1.2p2? The unable to read project ID error was a bug fixed in between those version I think, where project id wasn't updated correctly.
    As a temporary fix, you can try to type random thing in the project id, validate with enter, then paste your project ID again.

    As for "Unable to load project" error, that is for the team behind the service. Can you confirm it is still happening so I can notice them of it?

    When you say NetworkStarter, you talk about that package or the one posted in the 5.1 beta forum quite a while ago? Does your console in the editor or player log (inside youbuilname_data folder next to your build game executable) contains errors?
     
  20. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    285
    Hello UnityGuillaume,

    Its the UNET demo written by Unity I just downloaded yesterday from the Unity asset store

    https://www.assetstore.unity3d.com/en/#!/content/41836

    I have Unity 5.1.2f1, You can see the problem if you run one instance as "Server only" then others as "Client Only", then change the colors while in the lobby, then run the game, the color of the players in the game is always black, not the colors that was selected in the lobby.

    Also the color synching dont seem to work too good while in the lobby.
     
  21. chetan-rane

    chetan-rane

    Joined:
    Nov 26, 2012
    Posts:
    17
    Hi UnityGuillaume,

    I have downloaded the project, followed the steps
    But i could not create game using matchmaking

    The matchmaker automatically create the game on localhost and thus i am not able to connect two computers.

    Check the Status and Host
    For fraction of second it tried to connect to cloude server and then changed automatically to Host

    please check the images

    Screen Shot 2015-08-13 at 2.39.47 PM.png Screen Shot 2015-08-13 at 2.41.03 PM.png Screen Shot 2015-08-13 at 3.03.11 PM.png
     

    Attached Files:

    Last edited: Aug 13, 2015
  22. Dynamoid-Megan

    Dynamoid-Megan

    Joined:
    Apr 16, 2015
    Posts:
    72
    I am having the same issue!!!
     
  23. Dynamoid-Megan

    Dynamoid-Megan

    Joined:
    Apr 16, 2015
    Posts:
    72
    I would also like to know how I can fire the "Join" button for the Client joining a server without the UI button. I am having a pretty hard time getting the button to click itself when I fire a command from an EventTrigger, so I was wondering if there is an easier way. I am using Matchmaking, and need to join an existing Match via C# script.
     
  24. webagency1

    webagency1

    Joined:
    Jun 13, 2015
    Posts:
    9
    I dowloaded and updated version on 5.1.2p but when check my version it still shows old one. Moreover when i check for updates i have the message ”the unity editor is up to date currently installed version is 5.1.1f1.
     
  25. chetan-rane

    chetan-rane

    Joined:
    Nov 26, 2012
    Posts:
    17
    When click on List Servers button from Android device, i am getting below exception

    Request error: java.io.FileNotFoundException: https://mm.unet.unity3d.com/json/reply/ListMatchRequest

    Raw response:

    NullReferenceException: Object reference not set to an instance of an object
    at UnityStandardAssets.Network.LobbyServerList.OnGUIMatchList (UnityEngine.Networking.Match.ListMatchResponse response) [0x00000] in <filename unknown>:0
    at UnityEngine.Networking.Match.NetworkMatch+<ProcessMatchResponse>c__Iterator0`1[UnityEngine.Networking.Match.ListMatchResponse].MoveNext () [0x00000] in <filename unknown>:0



    Anybody any idea???
     
  26. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    This is actually normal. Sorry about the misleading UI.

    When you create a matchmaker game, you are still the host (so localhost for the hosting machine). The matchmaking service is "just" handling the rooms creations & advertising to other player, as well as connecting the two computer though Internet, NAT etc...

    Even if it's say localhost, your game is created & advertise, clicking on "List server" on another instance should show the game you created. If it don't, check the console/log don't have error or warning such as "set the Cloud ID".

    Just look at LobbyMainMenu, the function called by the button is "OnClickJoin". So either call that function from your script, or redo the step it does.

    Sorry about that, I actually didn't had time to test it thoroughly on Android, I will investigate! Thanks for the report!

    I will take a look at that, thanks for reporting it! Is there any problems if one of the client host? ("Play and Host" button)
     
  27. chetan-rane

    chetan-rane

    Joined:
    Nov 26, 2012
    Posts:
    17
    Hi UnityGuillaume,

    thanks for your reply.
    will wait for your ans on android. I had a very hard last week, tried all kind of solutions on forum, but no luck with the matmaking of android and window machine build :(

    Also i want to know if it is possible to assign custom hostname (just like room name in case of matchmaker) with Play and Host game?

    i mean i can host on windows machine and connect android build using windows machine's ipadress, but is it possible to assign custom name to ipaddress (to hide ipaddress).

    thanks in advance
     
  28. lucasbs1991

    lucasbs1991

    Joined:
    Jun 15, 2015
    Posts:
    4
    Hi, when i use matchmaker in my pc i can create matchs and see them, but when i try to create/list servers in other pc i get some errors:

    NetworkLobby.png

    why does this happens? what can i do? many thanks!

    EDIT1: and when a send to a friend, he creates but i can't see any match :(
     
    Last edited: Aug 23, 2015
  29. chetan-rane

    chetan-rane

    Joined:
    Nov 26, 2012
    Posts:
    17
    in game play mode, jump button not working on android
     
  30. tissueme

    tissueme

    Joined:
    Oct 20, 2014
    Posts:
    5
    In this asset https://www.assetstore.unity3d.com/en/#!/content/41836

    in game play it can be disconnected one people? now if touch back button game will end
    for example, I want disconnect one people he will lose all coin
    thank you. sorry for my english skill is bad.
     
  31. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    Hi @UnityGuillaume! Any plan you can share on releasing a post-beta version?
     
  32. Mrinaank

    Mrinaank

    Joined:
    Jul 25, 2015
    Posts:
    14
    HI
    I just downloaded the multiplayer version of the Tanks Tutorial. In it I tried the completed assets game by building it and running it on different computers. It works and looks amazing, but it lags. Is that normal? One player cannot see the screen of the game until the 3rd round, but his tank moves properly and aligns perfectly with the buttons.

    Also I was wondering if anyone could post an explanation of the Networking scripts used in the Lobby Scene as I want to edit my UI and game to have different events.

    Thx in advance!
     
  33. Dimilicious

    Dimilicious

    Joined:
    Oct 19, 2015
    Posts:
    14
    Hi. Is there any video tutorial for the unity networking stuff?
     
    danreid70 likes this.
  34. Adam-Buckner

    Adam-Buckner

    Unity Technologies

    Joined:
    Jun 27, 2007
    Posts:
    5,607
    There is this thread and there is the Multiplayer Tanks! Project as well. We have more items incoming.
     
    Dimilicious likes this.
  35. jinincarnate

    jinincarnate

    Joined:
    Mar 8, 2015
    Posts:
    2
    U need to get the unity multiplayer cloud id.
    In unity 5.2 u will see cloud icon on top in player settings click on that and in earlier versions u have to paste the cloud id in player settings only.
     
  36. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    So no, it's not normal. That was an old bug, surprised of it surfacing again. Can you check the log of that player & check if there is exceptions there? If you find some, paste them in the Multiplayer Tanks topics please (http://forum.unity3d.com/threads/multiplayer-networked-tanks-demo-q-a.356443/)

    As for explaining the scripts, there is no particular points to explains really, it's just a massive amount of them so a bit overwhelming. But they don't do anything fancy.

    I recommend just taking a button that do what you want and look which function it is binded to in the inspector. You can also just swap sprit in image component and move button around. With a "fresh" copy of the lobby next to your "work in progress" version, it should be fairly simple even if a bit fastidious (sadly there is a lot of UI action going in there so hard to make that simpler...)
     
  37. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    WAY too late, there will be a new "beta" version released very soon (like before end of the week) with some bugfixes, possibility to add local player (so you can have 2 persons in a couch playing against 2 persons somewhere else in the world) and the wonky pong sample replaced by an multiplayer top-view asteroid shooting game.

    I would consider the Lobby nearly as "out of beta" as, apart some bugs I'll probably have missed in my local testing, it's feature complete and seem pretty stable now. I'll keep the beta title for the asteroid game that still need some love, but I prefer to release it now to give everyone the upgraded lobby.
     
    rikey likes this.
  38. a-bottosso

    a-bottosso

    Joined:
    Nov 13, 2015
    Posts:
    6
    Hi! It is possibile, using the lobby, to join a game already in progress? Documentation says "Option to prevent players from joining a game in progress", but I don't understand if I can bypass it. Thanks!
     
  39. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    This is great! Does this support LAN games (that don't use the relay server, just exists locally)? Also, will this eventually still become part of standard assets (as mentioned in the docs)?
     
    danreid70 likes this.
  40. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    This lobby don't allow that, but it may be possible with direct connection thought the NetworkServer class.
    But not through this lobby or the NetworkLobby class.


    The previous version also supported LAN game. Just use the "Direct Connection" section of the lobby, create a server with Host & Play (or dedicated server) and on client enter IP of the server and click Join. This of course require the network to be setup properly (all computers on the same network (same mask, same domain) etc.)

    If you are talking about listing all LAN game in the lobby with associated name, then no, it is not supported, as this would require more low level network (server in some way announcing the game, client finding all announced games etc.) and that is way above my networking knowledge.
    Though I agree it would be a nice to have feature, that's why it is somewhere in my todo list and I'm working with the networking team to try to find a way to do that.


    Finally yes it will be part of Standard Asset, maybe in a 5.3 patch release or at most in 5.4 (Networking is as knew to me as it is to all of you, I just want to make sure we have a polished, working solution =) !)
     
    Last edited: Nov 17, 2015
    rikey likes this.
  41. rikey

    rikey

    Joined:
    Mar 3, 2015
    Posts:
    147
    This is all great news. I didn't know that the "Direct Connection" section truly meant that the relay was not used, just thought it was a straight alternative to the match maker, everything else being the same.

    I currently take your beta asset, clear out the game and the extra stuff not needed for the lobby scene, and add that to my game. Will the standard asset be more like something we can drop in our game or will it essentially be a full project as it is now?
     
  42. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    Standard asset version will only be the "Standard Assets/Network" folder, so yes easier to drop in a project. The Sample Scene will be part of the Sample Scene package that you can install with Unity.

    So Standard Asset version will only be "add the LobbyManager prefab to your scene, setup scenes & gameplayer prefab & play". See Instruction.txt in the "Standard Assets/Network" folder.

    Right now you can copy that folder entierly and copy it into your project and setup the lobby as Instruction.txt tells you!
     
    rikey likes this.
  43. ht2k9

    ht2k9

    Joined:
    Aug 15, 2015
    Posts:
    1
    I am really stuck , I can't figure out what's the problem , I am trying to lobby the game on android platform , I tried between my android phone and computer but the problem am keeping getting stuck on the "Connect..." UI wen joining a match from the server list , or when I try to join 127.0.0.1 after making play and host room , I get "Connect..." UI then I get error :

    UNet Client Disconnect Error: Timeout
    UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

    and sometimes I get this log:

    Multiple NetworkManagers detected in the scene. Only one NetworkManager can exist at a time. The duplicate NetworkManager will not be used.
    UnityEngine.Networking.NetworkManager:Awake()

    **** I kinda solved it by changing the localhost in the lobby prefab
     
    Last edited: Nov 20, 2015
  44. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    The warning is no worry, it's just a log from the LobbyManager but have no impact.

    As for the join, it's normal : localhost or 127.0..0.1 (they are the same thing) are the address of your own network card (to simplify).

    So if you try to connect to that IP/adress, you try to connect on the same machine, so in that case your phone try to connect on a server on your phone, or your computer try to connect on a server on your computer.

    It will work if you launch the game twice on your computer. But to connect from your phone to your computer, you need to enter the IP adress of your computer, and your phone and your computer need to be on the same network (c.f. tutorial on internet on mask & IP and connecting )

    Alternatively, if you activate the multiplayer services (cf Instruction.txt or first post here) you will be able to use the matchmaker, and that will take care of IP for you.
     
  45. phineliner

    phineliner

    Joined:
    Mar 26, 2013
    Posts:
    3
    Hi UnityGuillaume,

    I'm currently working on my own Lobby-System, inspired by your example.
    Everything seems to work fine, but when I call "SendReturnToLobby()" from playScene in order to get back to lobbyScene, I get the following error:

    SetClientOwner m_ClientAuthorityOwner already set!

    StackTrace:
    UnityEngine.Networking.NetworkLobbyManager:SendReturnToLobby()
    MPITNumberController:<ShowTimeIsUpDialog>m__5() (at Assets/Scripts/Controller/InformationTheory/MPITNumberController.cs:313)
    UnityEngine.EventSystems.EventSystem:Update()

    Besides this error, no problems occur.
    It doesn't seem to have any effect on the functionality of my lobby either.
    The clients are correctly redirected to the lobbyScene and can start the next match.
    I'm just curious why I get this, or how I can avoid it.

    Cheers,
    phineliner

    (See also: http://answers.unity3d.com/questions/1103768/unet-networklobbymanager-why-getting-error-when-re.html)
     
  46. moco2k

    moco2k

    Joined:
    Apr 29, 2015
    Posts:
    227
    After some steps working with the NetworkLobby, I think there might be an issue with using a minimum player count of 1, respectively with joining ongoing games.

    For my game, I have no minimum player count. It is possible to start a game with just a single player. Other players may join an ongoing game at any later point. Thus, I'm using a minimum player count of 1 set in the NetworkLobby. Unfortunately, however, it does not work for other players to join an ongoing game with the NetworkLobby example. When I start a game with one player, as soon as another player tries to join the ongoing game, there are some errors thrown on the server, starting with 'Attempt to send to not connected connection {1}'. Please have a look at the attached screenshot for the whole log.

    You can easily reproduce this issue with the clean and unmodified NetworkLobby asset (v1.2) by just setting Minimum Players of the Network Lobby to 1, go Play and Host, set ready and start the actual game, and then try to join with another game instance.

    Please have a look. Thanks.
     

    Attached Files:

    Last edited: Dec 7, 2015
  47. jjasonkschaefer

    jjasonkschaefer

    Joined:
    Dec 1, 2015
    Posts:
    2
    How can i remove my playerlist
     
  48. Vedal987

    Vedal987

    Joined:
    Mar 10, 2015
    Posts:
    3
    In my game when I run with more than one player I encounter some bugs. Anyone controls everyone. You can't look in the Y-Axis in your camera. How do I fix this?
     
  49. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    75
    Hi, after I host a game and have a client connect, some of my objects (my game control object and pooler) are being destroyed despite calling DontDestroyOnLoad when they awake. This only happens on the client. The objects are not in children of any other objects. Anyone else having this? I'm using Lobby 1.2 with Unity 5.2.3. Thanks.
     
  50. UnityGuillaume

    UnityGuillaume

    Unity Technologies

    Joined:
    Mar 16, 2015
    Posts:
    94
    You mean multiple player locally or just one client control the input of all clients?

    if multiple player locally, you need to define input for everyone (fire1, fire2 etc...) and grab the playerControllerId from the LobbyPlayer (see the Multiplayer Tank demo (you can find it on teh asset store) in the TankLobbyHook.cs script to see how to grab it

    If it's simply that one player control all other playere, you just need to check if(isLocalPlayer) before doing any input. Check the Asteroid Sample in the package for samples.



    If I get this right : you have gamemanager in the lobbyscene, set them as DontDestroyOnLoad but they are destroyed when the scene is loaded right?

    When do you call the "DontDestroyonLoad" ? because it could be that it's in a function not called on clients.
     
    Vedal987 likes this.