Making a MULTIPLAYER Game? Join your Players with LOBBY!

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2022
  • ❤ Watch my FREE Complete Multiplayer Course • Learn Unity Multiplaye...
    ✅ Learn more about Lobby and UGS on.unity.com/3XdKEd7
    🌍 Get the Project Files unitycodemonkey.com/video.php...
    📝 Lobby Docs on.unity.com/3OtC0Du
    🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses
    👍 Learn to make awesome games step-by-step from start to finish.
    👇 Click on Show More
    🎮 Get my Steam Games unitycodemonkey.com/gamebundle
    🎮 Wishlist my Next Steam game! cmonkey.co/totalworldliberation
    🔴 RELATED VIDEOS 🔴
    COMPLETE Unity Multiplayer Tutorial (Netcode for Game Objects) • COMPLETE Unity Multipl...
    Multiplayer through FIREWALL with Relay! (Unity Gaming Services) • How to use Unity Relay...
    What is Unity Gaming Services? • Free Unity Multiplayer...
    EASY Console! Run any Command! (Add Cheats, Set Gravity, Spawn Enemies Quantum Console Asset Review) • EASY Console! Run any ...
    Simple Text Input Field Window in Unity (Submit Score, Name) • Simple Text Input Fiel...
    💬 Let's learn how to use Unity Lobby to connect our players together before starting the game.
    You can create a new Lobby, make it public or private, then players can find it either through a Lobby browser or by inputting a Lobby code.
    You can then define whatever data you want for the Lobby and each Player. Things like Game Mode, Map, Teams or for the Player you can have Selected Character, Loadout, Color, etc.
    This is a really easy to use tool that you can add to your Multiplayer games to make it easy for players to find one another.
    This also easily integrates with Netcode for Game Objects which I've already covered, and Relay which I will cover in the next video.
    📝 Some Links are Affiliate links which means it costs the same to you and I get a nice commission.
    🌍 Get Code Monkey on Steam!
    👍 Interactive Tutorials, Complete Games and More!
    ✅ store.steampowered.com/app/12...
    If you have any questions post them in the comments and I'll do my best to answer them.
    🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
    See you next time!
    📍 Support on Patreon / unitycodemonkey
    🎮 Grab the Game Bundle at unitycodemonkey.com/gameBundl...
    📝 Get the Code Monkey Utilities at unitycodemonkey.com/utils.php
    #unitytutorial #unity3d #gamedev
    --------------------------------------------------------------------
    Hello and Welcome!
    I'm your Code Monkey and here you will learn everything about Game Development in Unity using C#.
    I've been developing games for several years with 8 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
    I do Unity Tutorials on just about every topic, Unity Tutorials for Beginners and Unity Tutorials for Advanced users.
    You can see my games at www.endlessloopstudios.com
    --------------------------------------------------------------------
    - Other great Unity channels:
    Unity - / unity3d
    Brackeys - / brackeys
    Dani - / @danidev
    Jabrils - / @jabrils
    BlackthornProd - / @blackthornprod
    Sykoo - / sykootv
    Jason Weimann - / @unity3dcollege
    Jonas Tyroller - / @jonastyroller
    --------------------------------------------------------------------
    - Website: unitycodemonkey.com/
    - Twitter: / unitycodemonkey
    - Steam: store.steampowered.com/develo...

ความคิดเห็น • 426

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  ปีที่แล้ว +19

    ❤ Watch my FREE Complete Multiplayer Course th-cam.com/video/7glCsF9fv3s/w-d-xo.html
    💬 This was one of the most requested UGS tutorials, I hope you find it useful! Best of luck with your Multiplayer games!
    ✅ Learn more about Lobby and UGS on.unity.com/3XdKEd7
    🌍 Get the Project Files unitycodemonkey.com/video.php?v=-KDlEBfCBiU
    📝 Lobby Docs on.unity.com/3OtC0Du
    🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses
    👍 Learn to make awesome games step-by-step from start to finish.
    🎮 Wishlist my Next Steam game! cmonkey.co/totalworldliberation
    🔴 RELATED VIDEOS 🔴
    COMPLETE Unity Multiplayer Tutorial (Netcode for Game Objects) th-cam.com/video/3yuBOB3VrCk/w-d-xo.html
    Multiplayer through FIREWALL with Relay! (Unity Gaming Services) th-cam.com/video/msPNJ2cxWfw/w-d-xo.html
    What is Unity Gaming Services? th-cam.com/video/JwClCc2_zC8/w-d-xo.html
    EASY Console! Run any Command! (Add Cheats, Set Gravity, Spawn Enemies Quantum Console Asset Review) th-cam.com/video/bOf6CjpuSFs/w-d-xo.html
    Simple Text Input Field Window in Unity (Submit Score, Name) th-cam.com/video/4n6RT805rCc/w-d-xo.html

  • @coryscustominstalls7168
    @coryscustominstalls7168 ปีที่แล้ว +125

    I found myself returning to this video often to refresh my memory when building my lobby I wrote down all the time stamps to the sections maybe some one can also use these...
    1:54 install packages
    2:06 setup services
    3:08 script creation / service initialization
    5:46 create lobby
    8:18 search for lobbies
    11:17 implement lobby heartbeat
    13:22 add filters to search for lobby
    16:55 join lobby by id
    18:48 creating lobby options
    20:12 join lobby by code
    21:16 quick join lobby
    23:48 print players
    28:06 player creation refactoring
    32:33 update game mode
    37:30 handle update polling
    39:56 updating player names
    41:34 leaving lobbies
    42:40 kicking players
    44:40 transfer host
    46:02 deleting lobbies

    • @JohnGamble
      @JohnGamble 5 หลายเดือนก่อน +1

      Thank you! I have referenced this video countless times while implementing Lobbies in my game. It would be great if these were added as chapters to the video.

    • @NedjmouBlaxword73
      @NedjmouBlaxword73 3 หลายเดือนก่อน

      Thanks

  • @eze-cs
    @eze-cs ปีที่แล้ว +41

    As someone who's been working with Unity professionally, you never cease to give really great reference to new services and quick implementation, keep up the hard work!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +9

      Thanks for the kind words! I'm glad you found the videos helpful!

    • @arvydazo4203
      @arvydazo4203 6 หลายเดือนก่อน

      when lobby host left the lobby, for example wifi disapears or game crashes, lobby disapears after 30s from the list, but players in lobby stays endefinetely with no warning that lobby no more exist. is there a way to change lobby owner when original owner is offline?

  • @TheAsbj0rn
    @TheAsbj0rn ปีที่แล้ว +8

    I have returned to this video approximately 20 times over the last three weeks. It is amazing, giving only what we need and no confusion. I'm actually using what I learn to develop a unity package that incorporates everything here with steam, automatically setting player icons and names and such. Thank you very much for this tutorial, it would have taken me months without

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +5

      I'm glad the video has helped you! Best of luck with your game, thanks!

  • @durvesh007
    @durvesh007 ปีที่แล้ว +10

    Really appreciate this detailed explanation 👍

  • @akash_the_phenomenal942
    @akash_the_phenomenal942 ปีที่แล้ว +32

    Was going to sleep, code monkey's notification came, so I am here ... Postponed sleep for next 52 minutes 😁

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +12

      Heh don't worry, the video will still be here in the morning!

    • @akash_the_phenomenal942
      @akash_the_phenomenal942 ปีที่แล้ว +2

      @@CodeMonkeyUnity 😅Yeah , But you can understand the passion for game Devs .

    • @padamgupta6941
      @padamgupta6941 ปีที่แล้ว +2

      @@CodeMonkeyUnity अरे कुछ नहीं मंकी भाई यह सो गया था तुरंत ही मेरा रूममेट है ये

    • @akash_the_phenomenal942
      @akash_the_phenomenal942 ปีที่แล้ว

      @@padamgupta6941 abe 🤣 ... Accha screenshot lagane ki wjh se dhundh liye tum... Bhkk...

    • @magnusherringelund6231
      @magnusherringelund6231 11 หลายเดือนก่อน +1

      Legend says that he still hasn’t slept. Been watching codemonkey nonstop ever since.

  • @GH-pp7ho
    @GH-pp7ho ปีที่แล้ว +2

    This is more than an amazing tutorial. thanks for sharing this. Looking forward to watching more multiplayer tutorials!

  • @captainnoyaux
    @captainnoyaux ปีที่แล้ว +2

    I'm working on the multiplayer version of my game, nearly finish this is coming at the right time :D Thanks a lot

  • @SzaboB33
    @SzaboB33 ปีที่แล้ว +14

    I just started game developing and it seems like all my ideas that I am excited about are all multiplayer, seems like I timed my start right, thank you for these valuable videos!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +17

      Heh nowadays making multiplayer games is easier than ever so that's great timing!
      I remember when I added Multiplayer to my first Steam game, I had to build the entire Lobby Master Server infrastructure from scratch myself, it was very painful and very easily broken.
      Really awesome that nowadays there are all these tools you can easily use!

    • @ergicela4420
      @ergicela4420 ปีที่แล้ว

      @@CodeMonkeyUnity does a multiplayer game cost , or how much you need to spend to create a multiplayer game by your self?

    • @phlips8254
      @phlips8254 ปีที่แล้ว +3

      @@ergicela4420 The lobby system in this tutorial is done with the base Unity system and is free as long as you don't use too much data (unless you have a lot of players this won't happen), then the hosting of the server is done by the player that is the host of the lobby. Because of this you don't need to run your own servers and the entire system is free to use. So no you don't have to pay to add multiplayer

    • @sir.niklas2090
      @sir.niklas2090 ปีที่แล้ว

      Honestly Multiplayer is still difficult get some practice in, not years but just understanding.

  • @Crazytm24
    @Crazytm24 ปีที่แล้ว +1

    This is exactly what I needed, thank you!

  • @evanstaylordigital8232
    @evanstaylordigital8232 ปีที่แล้ว +6

    Awesome video. I have come back to this several times while prototyping my own lobbies implementation. Would be super helpful if you included chapters!

    • @arvydazo4203
      @arvydazo4203 6 หลายเดือนก่อน

      when lobby host left the lobby, for example wifi disapears or game crashes, lobby disapears after 30s from the list, but players in lobby stays endefinetely with no warning that lobby no more exist. is there a way to change lobby owner when original owner is offline?

  • @alec_almartson
    @alec_almartson ปีที่แล้ว +4

    Awesome. 👍🏻😁
    You made it look easy... which is the Best a Teacher can do.
    I will try it on my future Prototype.
    Thank you for making this video. 😄✌🏻

  • @roubatov
    @roubatov ปีที่แล้ว +4

    Yes Code Monkey, YES! I'm working on a VR artwork which uses multiplayer, but I had no idea how to setup the lobby, but with this everything is working just fine! Thank you for everything and good luck with the rest!

    • @racistpixel1017
      @racistpixel1017 6 หลายเดือนก่อน

      how dud you made so all the players would be spawned to gameplay scene ?

    • @Nounsi_Dev
      @Nounsi_Dev 2 หลายเดือนก่อน

      @@racistpixel1017 have to make it work with netcode for gameobject

  • @alexdev447
    @alexdev447 11 หลายเดือนก่อน

    Love your content. This is the best way to learn new concepts as opposed to reading documentation and thousands of lines of code in example projects. Your videos are extremely helpful and you saved my ass countless times. Thanks!!

  • @RigidDecay
    @RigidDecay ปีที่แล้ว

    Thanks so much for making this man, I’ve been waiting 😅

  • @notlaw1567
    @notlaw1567 ปีที่แล้ว

    Thanks for showcasing this package. As always a really useful tutorial! It gave me thoughts about if this is how channels are implemented in mmorpg's.

  • @o2dyt
    @o2dyt ปีที่แล้ว +1

    Amazing tutorial. I followed along and got everything working. Thank you!

    • @Hhuxx1
      @Hhuxx1 ปีที่แล้ว

      the Join player using Id didnt work is something wrong?

    • @o2dyt
      @o2dyt ปีที่แล้ว

      @@Hhuxx1 Hey! What's the error?

    • @Hhuxx1
      @Hhuxx1 ปีที่แล้ว

      @@o2dyt Id didnt exist

  • @devonn6
    @devonn6 ปีที่แล้ว

    Finally ...😍😍
    You are awesome!

  • @lemetamax
    @lemetamax ปีที่แล้ว +2

    Yeaasss! Will watch early tomorrow morning.
    This video's thumbnail gave me a game idea: a superhero game with Code Monkey as the titular character.

  • @GreazyController
    @GreazyController ปีที่แล้ว +1

    Yes, finally a great tutorial on this!

  • @playnowgaming4628
    @playnowgaming4628 ปีที่แล้ว

    Really helpfully video and appreciate your work bro ❤

  • @klevialushi571
    @klevialushi571 ปีที่แล้ว

    This video was needed since i was thinking of implementing the same thing in a 2d game that im making, thanks!

  • @josephderosa5569
    @josephderosa5569 ปีที่แล้ว +2

    Yes!!! UGS tutorials are amazing! Thank you so much! Can you please make one for Unity Game Server? I cannot find it anywhere on the net outside of docs and a video showing a practical example would be extraordinarily helpful, not just to me but to MANY others.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +3

      Yup Game Server Hosting (Multiplay) and Matchmaker are two other tools I want to research

  • @rootbindev
    @rootbindev ปีที่แล้ว

    i love your multiplayer tutorials

  • @emberdragons8244
    @emberdragons8244 ปีที่แล้ว

    Thanks, that was really helpful

  • @rajsah4667
    @rajsah4667 ปีที่แล้ว

    🤩 great tutorial

  • @ezrahuffman
    @ezrahuffman ปีที่แล้ว +7

    Just a note in case some is facing the same issue. If you are using the editor to test (I am using parrellels sync package), the heartbeat might stop when you unfocus the editor window. You can change it in Edit -> Project Settings -> Player -> Resolution and Presentation -> Run In Background. Also the anonymous login will create the same id for both players when logging in by default. You can either clear the session tokens or use different profiles to get around it.

  • @designer.trifonov
    @designer.trifonov ปีที่แล้ว

    Its super lesson! Thanks! :)

  • @DP_1
    @DP_1 ปีที่แล้ว +1

    thank you, you helped me a lot 😲🙂

  • @Synith19
    @Synith19 ปีที่แล้ว

    Wooooo another multiplayer video!

  • @lazarbecic2199
    @lazarbecic2199 8 หลายเดือนก่อน

    Thanks a ton!

  • @JasonLovettGameDev
    @JasonLovettGameDev ปีที่แล้ว +1

    This was gold! Literally just made my entire lobby system for my game just following along

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว

      Nice! Best of luck with your game!

    • @JasonLovettGameDev
      @JasonLovettGameDev ปีที่แล้ว

      @@CodeMonkeyUnity Thanks man! Appreciate it!

    • @captainnoyaux
      @captainnoyaux ปีที่แล้ว

      ​@@CodeMonkeyUnity Same ! ​ Thanks a lot I'll definitely support you when my game generates more money !

    • @potatogod3882
      @potatogod3882 9 หลายเดือนก่อน

      how did you made so lobby players would be transfered to actual gameplay scene?AC

    • @hralpuh
      @hralpuh 8 หลายเดือนก่อน

      Im also trying to work that out, and have been through several days... when I download the project files they seem to be a bit broken, so its hard to figure out how the UI gameobjects should be constructed.

  • @bloobyjoobyjoob8949
    @bloobyjoobyjoob8949 ปีที่แล้ว +2

    Yus! This is exactly what I needed! Any chance you could do Vivox next?

  • @bluzenkk
    @bluzenkk ปีที่แล้ว

    Thanks~ very helpful ~

  • @davidgauffindahlin698
    @davidgauffindahlin698 ปีที่แล้ว +1

    You are the best

  • @AntAptive
    @AntAptive ปีที่แล้ว +4

    Could you possibly make a tutorial on how to make the UI for the lobby and how to connect it to this? I've followed this tutorial but I'm not quite sure how to do that. The main problem I'm having is I'm not quite sure how to get the names of the players in the lobby, but I see you set it up to do that in your UI.
    Regardless, thank you for making these tutorials for us!

  • @mjkkaya6056
    @mjkkaya6056 ปีที่แล้ว

    How do you achieve to show so many features in a single video?
    This is awesome!

  • @-Bill-Clinton-
    @-Bill-Clinton- ปีที่แล้ว

    awesome tutorial!

  • @Ionixification
    @Ionixification ปีที่แล้ว

    Ur awesome man

  • @connerreynolds6142
    @connerreynolds6142 6 หลายเดือนก่อน

    Great tutorial very clear! Did you make a video on how to transition from the lobby scene like the one you created to the actual multiplayer gameplay scene?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  6 หลายเดือนก่อน +1

      You can just sync some Lobby data, set it to 0 by default then set it to 1 when you wnat to start the game, that's waht I did in my complete game th-cam.com/video/7glCsF9fv3s/w-d-xo.html

  • @mohamedmusthafa1057
    @mohamedmusthafa1057 6 หลายเดือนก่อน

    Developer's Gem ❤

  • @stefanciobotaru9678
    @stefanciobotaru9678 4 หลายเดือนก่อน +1

    Super cool video. How did you manage to run 2 builds in Unity? Thanks!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 หลายเดือนก่อน +2

      They're not both inside Unity, only one is in Unity the other one is a standalone build

  • @rucesocial
    @rucesocial ปีที่แล้ว

    That's pretty good.

  • @VladaPersonal
    @VladaPersonal ปีที่แล้ว

    This great tutorial could really use chapters.

  • @MarekNijaki
    @MarekNijaki ปีที่แล้ว

    Very very good video

  • @lachfrosch9818
    @lachfrosch9818 ปีที่แล้ว

    Thanks a lot for this great Tutorial.
    I am having some trouble with connecting a UI to the code though, like you showed at the end. When trying to create the List of existing Lobbys I created a prefab for the list entrys but I can't figure out how to dynamically spawn elements of this prefab and also how to then fill it with the lobby name, maxplayers and so on. I tried taking a look at your project files but i can't figure it out.
    Also for the UI, I saw you put everything in one Scene - I created multiple Scene for each "Window" - Which route would be considered "correct" according to Unity Guidelines? If your style is the proper way, do you have a Link to a tutorial on how you did that?
    Again, Thanks a lot!

  • @MrMrn87
    @MrMrn87 ปีที่แล้ว +5

    I would love some insight in Steam intergration with Unity Multiplayer Networking

  • @poisht853
    @poisht853 หลายเดือนก่อน

    Thank you for the video!!
    I have realized one thing that happens sometimes.
    It might have to do with the fact that most of the code here are async code that when I stop playmode (from testing), time and after the scene changes when exiting playmode - (aka is different to what it was before starting play mode)... usually this is fine as reloading the same scene by clicking in the scene from the project in the editor restores it to what it was before...
    But I was wondering if this could happen for a build as well? because I had a few times where the camera was getting disabled for no particular reason when exiting playmode and this would be really bad if it happens in a build and remains that way...

  • @zanuka9765
    @zanuka9765 หลายเดือนก่อน +1

    If like me you're a newbie and get the error : "player is already a member of the lobby" while trying to join a lobby from different instances of the game, you have to find a way to differentiate the two players (host and client). One way is to change your authentication method like this :
    private async void Start()
    {
    var options = new InitializationOptions();
    options.SetProfile("Player" + Random.Range(0, 1000));
    await UnityServices.InitializeAsync(options); //

  • @lilbaby4PF
    @lilbaby4PF 5 หลายเดือนก่อน

    If you are new to unity these tutorials will be somewhat challenging
    , Because he's using his custom UI stuff instead of unity built in stuff. These tutorials can be simplified a lot.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 หลายเดือนก่อน

      What custom UI stuff? I'm not even using any UI for the most part of the tutorial, only made a custom demo for the end

  • @nileshsharma9009
    @nileshsharma9009 ปีที่แล้ว

    Great Video! just want to know if we can customize the lobby code or not.. like if i want it to be for 5 characters only, something like that was present in photon i think!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว

      No I don't think that's possible, it's auto-generated on Unity's side

  • @OneTime_12
    @OneTime_12 ปีที่แล้ว

    I understand you mentioned how to make the players on team, but it would be great for you to show us. Im not that good of a coder and im lost most of the time. Anyway to make a video on selecting team both manual and random, adding friends, creating parties, thing like that. Seems like alot for me but it might not be that big of a task for you. Thanks even id you say no lol !!

  • @Sim2322
    @Sim2322 10 หลายเดือนก่อน +1

    Note that if the 30 seconds lifeapan of the lobbies bugs you, it can be changed via the UGS dashboard up to an hour (3600 seconds). Probably negligeable, but helps send less data, which is always good.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  10 หลายเดือนก่อน

      Oh that's interesting, I don't remember seeing that, must be a nice recent addition

    • @arvydazo4203
      @arvydazo4203 6 หลายเดือนก่อน

      @@CodeMonkeyUnity yas but lobby host leaves the loby, noone can connect to that lobby and it just stays there in the list with ghost players

  • @ozalpm
    @ozalpm ปีที่แล้ว

    You are a lagend!

  • @arsalanasif8354
    @arsalanasif8354 6 หลายเดือนก่อน

    Loved the video! Just wanted to ask, why don't you like coroutines? I thought it was standard procedure to keep most of your logic inside coroutines and functions.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  6 หลายเดือนก่อน

      Personally I don't like the pattern they force you to use. You need to use a MonoBehaviour, you need to StartCorouting(), you need to make a function that return IEnumerator, you need yield return
      I find that whole pattern to be needlessly convoluted.
      But they work perfectly fine, so if you like them then by all means use them

    • @arsalanasif8354
      @arsalanasif8354 6 หลายเดือนก่อน

      @@CodeMonkeyUnity Those are definitely valid reasons. I guess I'm just more used to them now. Find it much easier to hold execution and sync with fixed updates in coroutines. Just wanted to know if I was missing something here.

  • @warfarecreations379
    @warfarecreations379 ปีที่แล้ว

    Best ❤️

  • @Steve-gi2yj
    @Steve-gi2yj 2 หลายเดือนก่อน

    question, @CodeMonkeyUnity, you mentioned that its better to create the game as one package, server, host and client... i am planning on making a mobile game... not sure if I should create the "Server" version first, then convert it to or switch type to Mobile after creating the server version... so the client can be mobile.. your thoughts? hoping to do a Dedicated server hosting for unity to host.

  • @ananths1122
    @ananths1122 ปีที่แล้ว

    This was very useful. (Question) I un-commented "HandleRefreshLobbyList( )" , but 5 seconds was too soon for it, says "Too many requests", What other time interval do you suggest for lobby refresh ?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว

      The docs mention the rate limits for each function

  • @sir.niklas2090
    @sir.niklas2090 ปีที่แล้ว +5

    Yall, just a tip don't name your script "Lobby" since its a keyword it will give you head aches... :D

    • @afrikaansedude2525
      @afrikaansedude2525 หลายเดือนก่อน

      I knew i shouldn't name i Lobby but yet still my smooth brain did exactly wat i told it not to do..😂

  • @sanjeebboyaju4800
    @sanjeebboyaju4800 ปีที่แล้ว

    Great tutorial. Quick question, How do you add bot in lobby? or do I add bot in game play?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว

      You would probably only add that during gameplay. After you start the game if there are fewer than the max number of players spawn a bot for the remaining ones

  • @s1m1ng7on
    @s1m1ng7on ปีที่แล้ว +2

    I have a question - as you said in this video, using netcode for game objects, relay and lobbies makes for a seamless multiplayer experience. What is the right video to start watching in order to do that? I don't really understand how they differ and how they work together.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +2

      Each of the videos focused on each tool.
      This one is the lobby video
      Here is the Relay unitycodemonkey.com/video.php?v=msPNJ2cxWfw
      And NGO unitycodemonkey.com/video.php?v=3yuBOB3VrCk

  • @somegamer7958
    @somegamer7958 ปีที่แล้ว

    Couple of minor changes I'd make - using multiple lobby variables is a bit confusing. You really just need one. Switching them back and forth isn't necessary since one client is going to be be a part of one lobby at a time. Also, logging into a lobby via code. I think for a tutorial it makes more sense to log in by lobby Id, because that's a value you can actually get. Only the host of the lobby gets access to the lobby's code.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +1

      What do you mean multiple Lobby variables? There's just one member variable which is set whenever a function changes it, you need to do that since the variable won't update by itself.
      If you want to see it as part of a complete game I used this in my complete course th-cam.com/video/7glCsF9fv3s/w-d-xo.html

  • @freepik19nineteen2
    @freepik19nineteen2 ปีที่แล้ว

    Can you make a video on how to link to unity authentication please... by the way great tutorial!

  • @SuperKREPSINIS
    @SuperKREPSINIS 6 หลายเดือนก่อน +1

    i have small issue. im using your lobby assets you provided. when player leaves lobby or relay. or shuts down game completely, he stays in the lobby and cant reconect. when im testing lobby always says it has two players, so the host and testing build. i also keep lobby on dontdesroyonload when moving to gameplay scene, just to keep lobby active for new players to join, but i dont think it makes this problem. also in dashboard in lobby i changed so if player is disconected for 10 seconds, he would be removed from looby, it was set on 2 minutes, and still it doesny work, players stays in the lobby no mater what.

  • @rafaelbrustolin4687
    @rafaelbrustolin4687 2 หลายเดือนก่อน

    I didnt know unity had a high level lobby system like this

  • @mohamedmusthafa1057
    @mohamedmusthafa1057 4 หลายเดือนก่อน

    Can u Please Explain I can See QuickJoin Method On Lobbies Class And LobbyServices class as well whats Difference both?

  • @maz44e
    @maz44e ปีที่แล้ว

    Cool

  • @SMORIGINALS
    @SMORIGINALS ปีที่แล้ว

    My this question is out of this video----
    Q- concept of making jungle marble blast game....how is work....?
    Could you make any video for this....?

  • @goldenapple801
    @goldenapple801 5 หลายเดือนก่อน

    Is there any more detailed description on how you created the lobby UI? I have watched your other videos but still do not manage to replicate it.

  • @harsimargawri8113
    @harsimargawri8113 10 หลายเดือนก่อน

    I have a question about constructors and initialisers, like at 31:08, u have used curly brackets to pass in the arguments for createLobbyOptions, but on the other other, in some cases, just normal round brackets are used for passing in arguments. How does it exactly work? Thanks for the help!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  10 หลายเดือนก่อน

      It depends if the constructor has parameters or not. But regardless of whether it does or not you can always use curly brackets to set public fields

  • @stefanciobotaru9678
    @stefanciobotaru9678 4 หลายเดือนก่อน

    do you have any video showing how to transfer data between host and guest and both of them getting notified on events? Usecase: guest changes its data and host gets notified about changes and viceversa.

  • @juanalvear6592
    @juanalvear6592 หลายเดือนก่อน

    Hello, just using this right now, I added the team selection on my lobby screen but only the player themselves can edit their PlayerData, not even the host can, so how would you work around this?

  • @dappy3338
    @dappy3338 ปีที่แล้ว

    hey, im trying to utilize relays without using lobbies. i cant seem to figure out how to synchronize the relay join code to the client without using lobby data though, do you have any ideas?

  • @force.4game649
    @force.4game649 ปีที่แล้ว

    We want to learn sign in google firebase. Everybody wait this thanks! Please next video do this!

  • @jud.su.5developer895
    @jud.su.5developer895 ปีที่แล้ว

    I play dust-2 for 7 years ❤

  • @JesseTheGameDev
    @JesseTheGameDev ปีที่แล้ว +1

    I'm getting a bug when I run my game in a standalone build that causes the player to never leave the lobby if I close the game while still inside it. I can force leave the lobby, but closing the game seems to leave the lobby open forever. Any experience with this bug or an idea on how to fix it?
    UPDATE: I think calling delete lobby or remove player from lobby from OnApplicationQuit works, but only if you don't do it asynchronously (so no async/await in the call).

  • @ryutmrgl
    @ryutmrgl 6 หลายเดือนก่อน

    How do you change data for each player, like the avatars you've show in this video and sync it with other players? I've trying to make a team based lobby with no succeed, I have tried to change data of each slot for each player but it does not work, since only the player itself can change his own data and the host of the lobby can't change the data of other players.

  • @lazygoosegames702
    @lazygoosegames702 ปีที่แล้ว

    Great tutorial thanks!
    Is there a way to poll for updates outside of the update function? I would ideally like to poll only when a change is made to the lobby data via a method that sends a call to all players in the lobby to update their UI instead of each player making poll calls in the update function every second.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว

      You mean some kind of event? No that's not possible since the API doesn't have any direct connection, you need to contact the server to see if anything changed

    • @lazygoosegames702
      @lazygoosegames702 ปีที่แล้ว

      @@CodeMonkeyUnity Yeah thats what I meant. Wasn't sure if, for example, a player joins the lobby and through lobby they send a call to all other players to update the lobby. Or the host changes the game mode and then it sends a call to all the players in the lobby to then poll for an update. Thank you!

  • @DwightPotvin
    @DwightPotvin ปีที่แล้ว

    So question related to steam integration and standard. I don't see any tutorials on steam integration into lobby, so I have to ask, can the stream id be used as the client id / player id, OR does the Id have to come from the netcode manager?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว

      The Steam integration would happen on the Unity Authentication side, not directly with lobby. You would use the SteamID to create a UnityAuthID then use that as normal.
      The Netcode manager doesn't use any of those Ids, the Id's in the netcode are just single digits like 1, 2, 3 to identify a player in a game, not globally.

  • @tylercarey8782
    @tylercarey8782 ปีที่แล้ว

    As someone fairly new to unity/ game dev, how hard is this to hook up to an actual 2D game? How hard is it to then tell unity to spawn the players into a scene while also giving them the character they selected as a controllable game object? I am trying to make a simple online smash brothers clone and if I could understand that functionality I would be able to get started! Any suggestions extremely welcome! Thankyou for the awesome videos :)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +1

      Lobby has nothing to do with the camera/assets so there's no difference between 2D and 3D, it works exactly the same.
      Making a playable Lobby would be pretty simple, just create the connection right away when someone joins instead of waiting for the host to press play.

  • @TarrenHassman
    @TarrenHassman ปีที่แล้ว

    I looked at the basic coroutine and couldn't figure out why you didn't like the pattern until I tried to make it async lmao

  • @Maskedmous
    @Maskedmous ปีที่แล้ว

    Lobby services with 10 gb is neat. Free authentication, remote config and cloud storage.
    Relay services however can become quite costly**.
    let's say your game is $15. 30% goes to steam, $5 for simplicity. Then you have your own take of $5. The rest $5 goes back into the game.
    which means ($5 / $0.16) / 12 ≈ 2,6 years. After that you're paying it yourself to support your own games networking.
    By then you require another monetization feature just to keep the game running. Or revert back to Direct IP which is troublesome for most players to set up.
    Most of them don't even know how to access a router / modem let alone configure it for some game.
    I'm ignoring bandwidth here, but that also is quite costly when you go above 150 gb of data.
    Multiplayer is great, just not the costs that come with them.
    ** Sure there are caveats and this calculation is a worst case scenario 100% playtime. It still feels expensive. Perhaps my view on it is too extreme.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +1

      Your math is a bit confusing, you're assuming every single player will be online at the exact same time playing 24/7 for 2.6 years, that is an extreme scenario that doesn't really ever happen. Remember it's Concurrent users, not just Users.
      As an example, my own game Battle Royale Tycoon, which was a decently successful release (for an indie dev) only had a single month above 50 CCUs with 75. So if the game was multiplayer it would have costed me $4 while it sold over $100,000
      So to me the math seems really good. If you have thousands of CCUs then your game is a mega-hit which sold hundreds of thousands of copies and those players will not play 24/7 for 2 years.

    • @Maskedmous
      @Maskedmous ปีที่แล้ว

      @@CodeMonkeyUnity That makes a lot more sense. Like I mentioned with the '**' Worst scenario with 100% playtime. But you're right not everyone will play every day for 2 years long.
      Thanks for explaining

  • @linkrider2302
    @linkrider2302 8 หลายเดือนก่อน +1

    My question is, I managed to connect, how can I switch to the game scene and how can I host it in the lobby via netcode? Or is it automatic?

    • @andrubaskara4879
      @andrubaskara4879 4 หลายเดือนก่อน

      Hi, have you found the solution?

  • @lavimahal8290
    @lavimahal8290 ปีที่แล้ว +2

    Make a tutorial for netcode using Steamworks p2p also plz.

  • @reetuverma5501
    @reetuverma5501 11 หลายเดือนก่อน +1

    How to add search bar so that many players playing the game have option to search the name of any player and add him as a friend instead of lobby

  • @sameoy696
    @sameoy696 ปีที่แล้ว

    Games that are the survival of the strongest, and for example, their number is 100. How, if one person remains, a slogan appears that he is a winner, and the game ends

  • @ANlevant
    @ANlevant 7 หลายเดือนก่อน

    this is very interesting, but I came looking for a way to connect my lobby with my Multiplayer game which uses Netcode for Game Objects

  • @magessm5228
    @magessm5228 หลายเดือนก่อน

    Great video with really easy to follow steps for setting up a lobby.
    I only have one problem:
    If I run the host in a build and the client in a build aswell, the client will not find the lobby.
    If the host runs in the editor the client in the build, the client will find the lobby.
    And if I run the host in a build and the client in the editor, the client will show another lobbyId for the lobby he has found.
    I've tried to find a solution for that problem, but after 3 days of searching and trying stuff out, I didn't find anything.
    Do you know what could cause such an issue?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  หลายเดือนก่อน

      Look in the build logs, maybe your build is being blocked from accessing the internet by a firewall?

    • @magessm5228
      @magessm5228 หลายเดือนก่อน

      @@CodeMonkeyUnity Thank you for your response
      I took a look at the build log, but how can I tell if something went wrong?
      I don't know what to look for, do you have any hints for me?
      And by the way, what IP should i use for the NetworkManager, if i just want it to run over the network?
      I'm using it for a school project. I'm studying computer science and am taking a class about advanced game developement.
      If it runs over the internet, it's ok, but i really only need network connectivity for this project.
      Thank you very much in advance

  • @reetuverma5501
    @reetuverma5501 10 หลายเดือนก่อน +1

    Please tell that how can we make a functional search bar on which if we search then it will show the list of online multiplayers
    And if we click on any player it will show option "add friend" if we click on add friend it will be added to our friends list

    • @DrWoofOfficial
      @DrWoofOfficial 10 หลายเดือนก่อน

      Do you have a database set up to store info of all players?

  • @sadryan4013
    @sadryan4013 11 หลายเดือนก่อน +2

    Anyone else having an issue where the player class exist but also doesn't exist at the same time?

  • @karmaa1036
    @karmaa1036 10 หลายเดือนก่อน

    Hey code monkey, hopfully you are able to answer my question. I downloaded your lobby template but for the player name im a little bit confused. I am using a service called loot locker and thats wnat stores all my player names. So instead of using a Input Field how could I change it to just use a string variable that I can set before they join a lobby? Thanks!!!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  10 หลายเดือนก่อน

      The lobby data already works just with a basic string, so instead of using the data from the input field just use the string that you get from loot locker

  • @arvydazo4203
    @arvydazo4203 6 หลายเดือนก่อน

    when lobby host left the lobby, for example wifi disapears or game crashes, lobby disapears after 30s from the list, but players in lobby stays endefinetely with no warning that lobby no more exist. is there a way to change lobby owner when original owner is offline?

  • @shmz6691
    @shmz6691 2 หลายเดือนก่อน

    How would i make it so the players in my lobby are moved to a round, preferably with netcode since i want to make a FPS

  • @denik69
    @denik69 ปีที่แล้ว

    All multiplayer tutorials will come this week ?
    Plz say yes...☺️ Waiting for them..

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว +2

      The Relay is coming soon, then I want to go research Multiplayer, Matchmaker and Vivox.

    • @denik69
      @denik69 ปีที่แล้ว

      @@CodeMonkeyUnity 😃

  • @md3d519
    @md3d519 หลายเดือนก่อน

    im curious on how you made the chat and commands , a tutorial on that would be appreciated

    • @Overdrink7
      @Overdrink7 หลายเดือนก่อน

      It's a unity asset If I remember well. And he probably explained it in a previous video

    • @Overdrink7
      @Overdrink7 หลายเดือนก่อน

      See the previous video of the playlist

  • @mboshu5551
    @mboshu5551 ปีที่แล้ว

    Great video, Amazing explanation done. However how can I display the Lobby code obtained on the Hosts screen? When I try to store lobby.LobbyCode in a variable it is actually null yet when we Debug.Log it is output in the console so Im confused. Im a noob in Unity by the way haha

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว

      You're probably just not using the same "lobby" variable, you're probably assigning it to a local variable and trying to use the null member variable. Look up variable scope in C#

    • @mboshu5551
      @mboshu5551 ปีที่แล้ว

      @CodeMonkeyUnity Thank you for the response, I renamed the variable lobby to lobbyCreated. I then also created a variable called lobbyCodeObtained of type string in the same method "CreateLobby" so I thought it would access it

  • @anujsaini0271
    @anujsaini0271 10 หลายเดือนก่อน

    I have some doubts,
    how host is migrated if host has quit the game suddenly?
    How Host is migarted without using migrateLobbyHost() by host as host lobby will be null hence no pingheartBeat would be called?

  • @romain4088
    @romain4088 ปีที่แล้ว +1

    is it possible to spawn the players in the lobby in the same game with the character they picked using unity netcode?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  ปีที่แล้ว

      When you join the lobby you can initiate the NGO connection right away, that's what I'm doing in my multiplayer game, video coming out next Monday

  • @Somiaz
    @Somiaz 11 หลายเดือนก่อน

    How do I even get the UI set up? It seems this was also a crucial part that was missed? Especially since so many changed were made from during the tutorial. It would have been nice to see how to set everything up fully even with basic Unity UI stuff.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  11 หลายเดือนก่อน +1

      In any way you want, every game will have a different UI. If you want to see that step by step I did pretty much exactly the same thing in my free multiplayer course th-cam.com/video/7glCsF9fv3s/w-d-xo.html

  • @vardanbetikyan4117
    @vardanbetikyan4117 11 หลายเดือนก่อน

    The Lobby deletes itself and doesn't migrate host after the host "unexpectedly" disconnects (simply turning off unity play) instead of just leaving the room. Is there a way around this?