Many thanks for the super thanks! This was pretty tricky to research since there's a bunch of gaps in the documentation so I really hope it helps people!
Code Monkey, I want to say a HUGE thank you!!! I'm making my first multiplayer game, and I don't have any experience with network related stuff like servers, IPs, etc... And your videos covering UGS have been super helpful! When I learn about a multiplayer related terminology like relay, lobby, etc...and I make a research on it, your videos pop up. Your channel is like a big library that has a vast collection of unity knowledge and wisdom. No other channel has that, not even Brackeys or even Unity. If I actually finish this game(still very likely that I'll finish it even though it's a DOTS game), I'll credit you. I really appreciate you man
Thank you so much for learning and sharing your knowledge with us 🙏🏼. I love how you cover every detail of the process, especially the potential issues we may face.
Great timing....I am just completing the Lobby creation section in the multiplayer course and you had published the dedicated server hosting video...Thanks for all the help you have provided.
I'm glad you are creating some resources for this. The documentation is extremely sparse and I struggled for too long understanding the necessary components to achieve what I wanted, especially between the Manual and APIs (I was livid that APIs for working with server infrastructure were completely missing from anywhere in the manual. That's an incredibly important thing to just leave out, like ok you can start a server by clicking "Start Server" but no one ever in the history of server infrastructure is going to run their game by manually starting their servers every time lol). I'm sure many more developers will find this video extremely useful.
Yeah it took me quite a lot of researching and trial and error to figure all this out, I definitely wish this video existed when I started learning heh
I'm not 100% sure but I believe that Max refers to physical servers which depending on the resource usage of your servers they can support many or not many virtual servers. Note how all the Available servers have the same IP so I assume all of those are hosted in a single physical dedicated server.
Back when I started (2012) it was the only available free option (for making PC games, Unreal was paid, Godot did not exist) so that's why I picked it and since then I have not encountered a single game idea that I could not build with Unity so I've had no reason to look at another engine.
would you recommend this to a small indie dev ? idk about the pricing of this. lets say i want to make an mmo with like a 1000-2000 ccu, what would be the best option ? thanks for the tutorials
Hi, a few questions I'm curious about; - Can we do peer to peer connection with netcode for entities? Without needing relay. So a player would be host and the rest of the users clients. - Can we just get a few aws ec2 instances and use them as our fleet, create server allocations on that? For either netcode for gameobjects or netcode for entities. - Are there any competitors you know of that compares to Multiplay?
You can indeed do direct P2P with NGO without Relay, you just need to manually set the IP of the Host and make sure the Host accepts the connection. The Relay just helps bypass issues with firewalls and port forwarding. You can make an AWS server hosting the dedicated server yes, NGO doesn't care where you host the server. But if you take that route you need to handle all the server fleet management logic yourself. I'm not sure of other tools just like Multiplay, but I'm guessing Unreal probably has something in their services list.
Hi, thank you for making such informative videos. I have question: can I use 1 server to run multiple lobbies? And have separate game scene for each lobby? What should I learn to implement such logic?
Super video ! I might be wrong but I find Multiplay super expensive if you let it run 24/24h. (VPS' seems way cheaper but that depends on your usage) Be careful if you use any unity gaming services it starts the timer for the free credits for multiplay (found out the hard way)
I'm not too familiar with all the options that exist so really no idea how expensive/cheap this is compared to running your own on AWS/Azure. All I can say is that for testing for this video I started maybe about 30 servers, maybe total uptime about 10 hours (not all at once, so not 30 * 10) and my final cost is $2, no clue how that would scale to a published game.
@@CodeMonkeyUnity yeah but you are an experienced unity developer. imagine some new dev developing a game during 1 year or more, testing multiplayer during that time. it gets expensive, especially when the dev doesnt live in europe/usa and dollar isnt cheap
so here for each match ,a server will be allocated then there will be a lots of servers or should i make a server build to handling more than a single match ?
Great video and thanks for making guides on new features and systems! A quick question for the people who have experience with the service - what does Unity offer as part of the free tier plan? Is there a free tier anyway? 🤔
Thanks for this info about ClientRpc and ServerRpc - because I just tested dedicated build for my game and it was behaving oddly. I looked a little into but then put it aside as I needed to focus on something more important. Now while eating lunch I watched this video and you just saved me from HOURS/DAYS of troubleshooting to figure this out! NGO should for sure log something out, just like they do in other cases where you try and set a server only NetworkVariable etc. It make sense, maybe, that ClientRpc isn't running on a SERVER - but ServerRpc? Why the hell is that not running on a Server...its a Server you know :P Else they should have called it ClientRpc and HostRpc. Really odd - but very happy I know this now, will make it a lot easier to refactor so it works.
@@CodeMonkeyUnity Yeah I experienced the problem right away with dedicated, but didn't spend time to look into it. Then I was watching this video as part of research. So yeah you for sure saved me hours of work/research. Afterwards when researching why it is made like this I also ended up on your thread on the Unity forum on the topic :D
@Code Monkey, Hi. Tell me this video is where it talks about how to create a server in which the computer does not need to be constantly turned on and there may be zero or more players on the server? (I don't understand English, so I use a translator)
Hello I was just wondering for the servers when testing do you have to upload the files to the build every time you make a change? Also how did you define DEDICATED_SERVER so the server will run that logic
hello code monkey. first of all, thanks for the video. there was something that stuck in my mind, I want to set up a room while using the lobby and relay, and there will be a maximum of 4 people in each room, can I set up unlimited rooms in this way? or is there a limit? my english is not very good, so I may have missed something while watching the videos, I would be glad if you answer
4:32 Ok, but where do we get these files? The official Unity tutorial also just assumes we have these "files necessary to run your server" without any explanation of what they are or how they're made.
Hey, thanks for the awesome guide! I didn't quite understand if you still need the Lobby and Relay service with a dedicated server? Are lobbies now managed though allocations on the dedicated server, or do we still use the Lobby service to define the rules of when and how players can join?
You would choose between Game Server Hosting or Relay, depending if you want dedicated servers or not Then you can add Lobby on top of either of those, use the Lobby to group your players then have all players in a lobby join the same server
@@CodeMonkeyUnityHi! i Watched your video about unity relay. Can you give me tutorial about how to change from relay to dedicated server? I am confused because the code from the relay and lobby tutorial is completely different from this tutorial
I have a few questions 1. I'm able to create a game the have lan game and indernt with the new unity Networking system ? 2. This indernet service are free and if not it's expensive ? 3. If create 1 server am able to make the Player to create the own custom mach inside on this server ?
Hey @CodeMonkeyUnity. I am seeking here a small info that I couldn't find about the multiplay. I am trying to understand how Game Server Hosting service will work on in a specific game so as to understand how it can optimize costs and if the service will fit these needs in the future. The game is a 2 player board game let's assume chess for example, where the server side load is mostly keep a record of game state, calculate and validate player's input/moves and relay that verification and input to other clients for local replication and game state sync. My biggest doubts stem from how the concept of server correlates to the concept of CPU Cores in Unity's pricing model. Since this game is decently simple I expect that each individual session's core usage will be small, but am I able to host multiple sessions without rounding core's to the next integer core? Hypothetically, if one core could run 2 sessions of this game and I have two "servers" each running a session, will our core usage be 1 or 2? If so, would be need to create a solution to be able to run several sessions inside the same server, or is it done by default? Thank you all
I believe that's going to depend on how your server code runs, it will automatically try to fit as many instances in one server as possible. So if your server code is really lightweight you can fit a lot of them into a single server which should have a very low cost. Or for that kind of asynchronous multiplayer you can even go with a simple cloud server that only runs logic when a move happens, I sort of did a multiplayer tic tac toe like that ruclips.net/video/EEQfSmK1nXA/видео.html
I trying to find tutorial for make an account on server and how to send and use a data like character items, experience. All uing netcode for game objects. Using cloud save.
Hi codemonkey, should I watch you videos "matchmaking and Server Hosting) after completing the multiplayer tutorial for kitchen chaos? Or there is no relation between them.
Yup watch them afterwards, in those videos the starting point is the last project files of the course Although if you just want to learn about these tools they also work as standalone tutorials
I have a really pain headache solving memory usage issue with Unity Multiplay. Did you experiencing big memory usage increase sometimes when player join/leave? The issue is not happen with windows dedicated server build tested on local, but happen in Multiplay with Linux build. Maybe this issue won't matter with 4 players in 1 rooms, but for City Hub that will contains 100 players is a really big problem!
How do you set up matchmaking in Multiplay? Or how do you integrate some other matchmaking service (Playfab for example). In Playfab there is option to make a sarver instance for finished matchmaking ticket, so players that were gathered by matchmaking into a match are joining that server. How do yoou make something similar with Multiplay?
I don't get it. Why everyone says making a multiplayer game is not worth it because setting up network is difficult and expensive when it's this simple? Is there a catch?
It's always more difficult than a singleplayer game since you have to build all the same things of a singleplayer game and then add multiplayer on top. But yes thanks to the tools that exist nowadays making something multiplayer isn't the huge challenge it once was.
Hello, I dint tried this yet, but can you tell me if this works with assets such as fishnet networking, photon, mirror and others of the sort? Or just the new Unity multiplayer?
This is completely separate from the Netcode layer so it can work with any of those tools. For example Apex Legends uses this and it does not use Netcode for Game Objects (or even Unity)
"Hello, I have a question about Multiplay hosting. When I set up the fleet cloud server density, I get the message: 'Your servers have used more resources than allowed within the past 24 hours. If this happens often, you may experience issues.' I am on the Pay-As-You-Go plan, though."
hmm I haven't seen that message myself, maybe you just need to up the CPU on the server? Maybe it means you're using up more resources than you defined during setup
I dealt with the clientrpc issue u mentioned all day today 😂 unity is updating the clientrpc and serverrpcs soon to be more generic calls with something to pass through instead. Idk maybe it will make it less topsy-turvy.
Do you have tutorial on Shaders? I want to learn how to write shaders, I’m making a mobile FPS game and I want to create the most optimized shader possible. I know it’s going to take me months, or maybe even a year, but I’m willing to put in the effort to make my game look great.
hello sir i cannot connect my client to the dedicated server it takes too long time to connect and finally gives failed to connect to the server all my ips and port match in client and server port is 9000 automatic and ip varies according to server please help can i achieve this without using relay??
Hey Awesome tutorial. Was just researching on lobby and DGS and this video was god send. Just want to ask some questions In the MainMenuDedicatedServer, you have loaded a LobbyScene on start. Let's say I have 2 maps, how can I set it up so that based on which map the player selects, that map's lobby scene is loaded? If I want the player to automatically join the first lobby with available slot in the list of lobbies inside a map; how can I achieve this using DGS?
You want the Lobby itself to be in different maps or just the GameScene? Either way the answer is the same, have the Host/Server change the Scene and all the Clients will receive the change. I'm not sure what you mean "list of lobbies inside a map", Lobby has no concept of "map", it's just a grouping of players. And DGS has no concept of Lobby, it's just a dedicated server. Whatever logic you are trying to implement first get it working with a regular Host, if it works with a Host it will work with a Dedicated server.
Thanks for the tutorial! Could you tell me which services and methods are better to use for a game where a player presses 1 match search button and when he finds an opponent (1x1), the game starts. Is this a hidden lobby + relay or is something else needed? (Smth like in Dota 2 or Brawl Stars)
Lower delay but higher cost. With relay the packet needs to go to the Relay, then to the Server, then back to the Relay then back to the Client. With Dedicated server you have a dirent connection.
Does anyone have a solution or a clue as to how to deal with hidden / or missing shaders on the Linux build. it wont finish its test allocation, and when i look in the server log. its full of shader / gpu mismatch errors.
Thanks for this awesome tutorial. I am getting this error while joining : Server having issues (Query didn't respond or responded incorrectly [DOWN]) for 120 seconds (Restarted 0 time(s)) Failed to connect to server.
On this, do Unity allow custom matchmaking algorithims and for players to be able to queue to multiple locations at once for Match making?Since that's one thing I've always hated about apex, there's a billion different servers and you can't play together, so the matches are terrible quality(this was extremely obvious when Arena came out, literally had bronze players vs top 10 people in other team...)
Hmm not sure what you mean by "queue to multiple locations at once", like queue simultaneously for Ranked and for Casual? I think that should be possible, I think you should be able to create 2 tickets, one for each pool, and cancel the second one when the first one goes through. I'm covering the Matchmaker in the next video and it's a very robust tool with tons and tons of options.
On your Build Target just select Dedicated Server That will give you an executable for the dedicated server, then you can use that with whatever cloud server system you want, doesn't have to be Unity's one
dumb question, so I am making a mobile game, but want to have it hosted on Unity dedicated server build, should I make the game (Android) and then change the platform to server (whether windows or linux)? or should i keep it mobile build and deploy it to unity dedicated servers? is there a video/steps? again this is going to be for hosting a mobile game server.
I can't think of any reason why it wouldn't work, Netcode just synchronizes objects, the target platform doesn't matter. Same thing on the dedicated server, it's just a Linux server that runs the server logic regardless of what platform is connecting to it.
But that way i have to pay all the servers or no? I would like to give people the option to host their own dedicated server instance on a windows or linux machine and just have some masterserver maybe, or working with steam or playfab, etc. This way, you can't really make a free game out of it without monetizing it somehow to pay the servers. Sorry if i misunderstood something.
Yes if you want technically you could build the entire infrastructure yourself, but that will still cost you If you're making a free game then the best option is P2P, just use Relay or NAT Punchthrough instead of dedicated servers
Are you running one match per one server? Aren't servers priced per amount? Wouldn't it be better to have minimum amount of servers that run multiple games at once? Thank you!
Can this be used with Unity’s 3rd party networking solutions like FishNet and Mirror? And are Unity dedicated servers are able to handle a lot of traffic from large scale games, like MMORPGs?
Hi Code Monkey, Awesome tutorial video. Do you have an existing video on how to manage players creating ID, logging in and how to save and retrieve player character data from server side to the game?
That is going to be heavily dependent on what you use for server side data, Unity doesn't currently have any server data storage (although they have Cloud Code) so youcould use something like Azure unitycodemonkey.com/video.php?v=qdE01Xg3y2A
Allocated server had issues (CPU over limit. Combined core(s) usage 120.88% (60.44% of machine), only 39.00% allowed with 1 players), stopping server and deallocating I'm getting this error after few minutes
@CodeMonkey Thanks for this awesome tutorial. When I imported this project, I am getting this error : ( Assets\Scripts\UI\LobbyMessageUI.cs(54,50): error CS1061: 'NetworkManager' does not contain a definition for 'DisconnectReason' and no accessible extension method 'DisconnectReason' accepting a first argument of type 'NetworkManager' could be found (are you missing a using directive or an assembly reference?) && Assets\Scripts\KitchenGameMultiplayer.cs(128,40): error CS1061: 'NetworkManager.ConnectionApprovalResponse' does not contain a definition for 'Reason' and no accessible extension method 'Reason' accepting a first argument of type 'NetworkManager.ConnectionApprovalResponse' could be found (are you missing a using directive or an assembly reference?) ) Am I missing some reference? I also did not see anything related to 'Reason' inside ConnectionApprovalResponse class
Which Unity version are you using? Which Netcode for Game Objects version? Sounds like it loaded an older version. For this demo I used Unity 2022.2 and NGO 1.2.0
My project uses the services APIs to allocate servers as I saw in your tutorials, and everything works great on unity, but when I host the WebGL build and try to send a post to the Unity services APIs it gets blocked by CORs. If I was the server owner It would be possible to just set the right servers headers, but since Its Unity apis I cant change it. The worst is that it makes no sense that Unity has no CORs headers on the APIs because that means no WebGL build would be able to acess it.
I'm following this step by step implementing it to my game, right now Im getting a error after the Allocation Test that says: Caught fatal signal - signo:11 code:1 errno:0 addr:(nil). Any ideia what it could be?
@@CodeMonkeyUnity It appears on the log file right on the startup. The log shows some warnings and errors related to shaders and crashes with this error before printing anything inside the initialization scripts of the game
@@CodeMonkeyUnity I haven't got any problem with complexity, just realized it. 😀I'm developing web applications for bank, so complexity is not a surprise for me.
🌍 Learn more about Game Server Hosting on.unity.com/3ZW9VZT
❤ Watch my FREE Multiplayer Course ruclips.net/video/7glCsF9fv3s/видео.html
✅ Get the Project Files unitycodemonkey.com/video.php?v=IvCVFywNXMc
🌍 Get my Complete Courses! ✅ unitycodemonkey.com/courses
🔴 RELATED VIDEOS 🔴
Learn Unity Multiplayer (FREE Complete Course, Netcode for Game Objects Unity Tutorial 2023) ruclips.net/video/7glCsF9fv3s/видео.html
Learn Unity Beginner/Intermediate 2023 (FREE COMPLETE Course - Unity Tutorial) ruclips.net/video/AmGSEH7QcDg/видео.html
Download Data/Images from inside Unity (HTTP WebRequest) ruclips.net/video/Gk0-amfn5DM/видео.html
Easily handle MATCHMAKING in Unity! (Skill based, Platform, Region) ruclips.net/video/90Iw1aNbSYE/видео.html
Can you do a video that shows how to make blood effects in 3D?
Can you make a video tutorial about Leaderbord with Unity Game Srvices ?
💕
Looks like Unity already sponsored this, but here is my appreciation too. Literally could not do this without you. Thanks Hugo!
Many thanks for the super thanks! This was pretty tricky to research since there's a bunch of gaps in the documentation so I really hope it helps people!
W
It's been great collabing with you - keep up the awesome work!
Thanks Unity!
Continue working together please 🎉 !
Code Monkey, I want to say a HUGE thank you!!!
I'm making my first multiplayer game, and I don't have any experience with network related stuff like servers, IPs, etc...
And your videos covering UGS have been super helpful! When I learn about a multiplayer related terminology like relay, lobby, etc...and I make a research on it, your videos pop up. Your channel is like a big library that has a vast collection of unity knowledge and wisdom. No other channel has that, not even Brackeys or even Unity.
If I actually finish this game(still very likely that I'll finish it even though it's a DOTS game), I'll credit you.
I really appreciate you man
That's awesome! I'm glad the videos have helped you! Best of luck with your game!
You're awesome! Thanks again :)
Great content, thank you once more. Your tutorials are invaluable to the community!
Thanks for the super thanks! I'm glad the videos have helped you! Thanks!
This is amazing. Thank you!
Thanks for the super thanks!
Thank you so much for learning and sharing your knowledge with us 🙏🏼. I love how you cover every detail of the process, especially the potential issues we may face.
Yet again, CM saves me a bunch of time when first venturing into a new process.
Thanks Taro! I'm glad the video helped you!
Bruh I didn't get a notification for this video, this is so useful! Thank you
Great timing....I am just completing the Lobby creation section in the multiplayer course and you had published the dedicated server hosting video...Thanks for all the help you have provided.
I'm glad you are creating some resources for this. The documentation is extremely sparse and I struggled for too long understanding the necessary components to achieve what I wanted, especially between the Manual and APIs (I was livid that APIs for working with server infrastructure were completely missing from anywhere in the manual. That's an incredibly important thing to just leave out, like ok you can start a server by clicking "Start Server" but no one ever in the history of server infrastructure is going to run their game by manually starting their servers every time lol). I'm sure many more developers will find this video extremely useful.
Yeah it took me quite a lot of researching and trial and error to figure all this out, I definitely wish this video existed when I started learning heh
You are amazing and a legends thank you, I have made significant breakthroughs on my game dev & programming journey thanks to you.
Excited for this video!
Thank You for sharing this knowledge 👍🏻
I'm so behind on your tutorials, so many tutorials to watch and learn
At 9:56 how were you able to create a second server when you set the max number of servers to 1 in the setup?
I'm not 100% sure but I believe that Max refers to physical servers which depending on the resource usage of your servers they can support many or not many virtual servers. Note how all the Available servers have the same IP so I assume all of those are hosted in a single physical dedicated server.
I'm asking because I'm curious, don't get me wrong
Why did you choose Unity?
Back when I started (2012) it was the only available free option (for making PC games, Unreal was paid, Godot did not exist) so that's why I picked it and since then I have not encountered a single game idea that I could not build with Unity so I've had no reason to look at another engine.
thanks for answering my question
Could you do a tutorial about how to implement a production-ready Client-side Prediction for a fast-paced multiplayer game?
You are the best teacher. Thank you for your hard work!
would you recommend this to a small indie dev ? idk about the pricing of this. lets say i want to make an mmo with like a 1000-2000 ccu, what would be the best option ? thanks for the tutorials
i love this man so much
12:24 oh my god thank you, I was banging my head against this for days now
What you do is AMAZING!
Hi, a few questions I'm curious about;
- Can we do peer to peer connection with netcode for entities? Without needing relay. So a player would be host and the rest of the users clients.
- Can we just get a few aws ec2 instances and use them as our fleet, create server allocations on that? For either netcode for gameobjects or netcode for entities.
- Are there any competitors you know of that compares to Multiplay?
You can indeed do direct P2P with NGO without Relay, you just need to manually set the IP of the Host and make sure the Host accepts the connection. The Relay just helps bypass issues with firewalls and port forwarding.
You can make an AWS server hosting the dedicated server yes, NGO doesn't care where you host the server. But if you take that route you need to handle all the server fleet management logic yourself.
I'm not sure of other tools just like Multiplay, but I'm guessing Unreal probably has something in their services list.
Great tutorial! I learned a lot about game server hosting and can't wait to try it out.
This is what I exactly need😊😊😊
Just awsome !
Hi, thank you for making such informative videos. I have question: can I use 1 server to run multiple lobbies? And have separate game scene for each lobby? What should I learn to implement such logic?
Super video !
I might be wrong but I find Multiplay super expensive if you let it run 24/24h. (VPS' seems way cheaper but that depends on your usage)
Be careful if you use any unity gaming services it starts the timer for the free credits for multiplay (found out the hard way)
I'm not too familiar with all the options that exist so really no idea how expensive/cheap this is compared to running your own on AWS/Azure.
All I can say is that for testing for this video I started maybe about 30 servers, maybe total uptime about 10 hours (not all at once, so not 30 * 10) and my final cost is $2, no clue how that would scale to a published game.
@@CodeMonkeyUnity good to know !
@@CodeMonkeyUnity yeah but you are an experienced unity developer. imagine some new dev developing a game during 1 year or more, testing multiplayer during that time. it gets expensive, especially when the dev doesnt live in europe/usa and dollar isnt cheap
so here for each match ,a server will be allocated then there will be a lots of servers or should i make a server build to handling more than a single match ?
Did someone know how, from the API get current/max players count from the server to refresh the server list with count players?
Huge Video Ty!
Great video and thanks for making guides on new features and systems!
A quick question for the people who have experience with the service - what does Unity offer as part of the free tier plan? Is there a free tier anyway? 🤔
Make a video about pricing please :)
What is the pricing for the servers?
Thanks for this info about ClientRpc and ServerRpc - because I just tested dedicated build for my game and it was behaving oddly. I looked a little into but then put it aside as I needed to focus on something more important.
Now while eating lunch I watched this video and you just saved me from HOURS/DAYS of troubleshooting to figure this out!
NGO should for sure log something out, just like they do in other cases where you try and set a server only NetworkVariable etc.
It make sense, maybe, that ClientRpc isn't running on a SERVER - but ServerRpc? Why the hell is that not running on a Server...its a Server you know :P
Else they should have called it ClientRpc and HostRpc.
Really odd - but very happy I know this now, will make it a lot easier to refactor so it works.
Yeah that part was really insane, definitely drove me crazy for quite some time, I'm glad I saved you from that!
@@CodeMonkeyUnity Yeah I experienced the problem right away with dedicated, but didn't spend time to look into it. Then I was watching this video as part of research. So yeah you for sure saved me hours of work/research.
Afterwards when researching why it is made like this I also ended up on your thread on the Unity forum on the topic :D
@Code Monkey, Hi. Tell me this video is where it talks about how to create a server in which the computer does not need to be constantly turned on and there may be zero or more players on the server? (I don't understand English, so I use a translator)
Where do we get the Linux build files?
Greate Video Learn Unity Multiplayer
Hello I was just wondering for the servers when testing do you have to upload the files to the build every time you make a change? Also how did you define DEDICATED_SERVER so the server will run that logic
Yes, if you make changes to the server build you need to upload the new build.
I defined that symbol in the Project Player Settings
I just have one question. Why, when queuing an allocation request, you are providing an allocation-id? isn't this supposed to create an allocation-id?
hello code monkey. first of all, thanks for the video. there was something that stuck in my mind, I want to set up a room while using the lobby and relay, and there will be a maximum of 4 people in each room, can I set up unlimited rooms in this way? or is there a limit? my english is not very good, so I may have missed something while watching the videos, I would be glad if you answer
Thank you!
You Best
Thank you so much this video helped me alot
4:32 Ok, but where do we get these files? The official Unity tutorial also just assumes we have these "files necessary to run your server" without any explanation of what they are or how they're made.
You go to File - Build Settings and make a Linux build, that's it
@@CodeMonkeyUnity Thank you!
Any idea how lobby can used with game server hosting?
Is there some way to fetch and add the ip and port in lobby data?
Hey, thanks for the awesome guide! I didn't quite understand if you still need the Lobby and Relay service with a dedicated server? Are lobbies now managed though allocations on the dedicated server, or do we still use the Lobby service to define the rules of when and how players can join?
You would choose between Game Server Hosting or Relay, depending if you want dedicated servers or not
Then you can add Lobby on top of either of those, use the Lobby to group your players then have all players in a lobby join the same server
@@CodeMonkeyUnityHi! i Watched your video about unity relay. Can you give me tutorial about how to change from relay to dedicated server? I am confused because the code from the relay and lobby tutorial is completely different from this tutorial
Hi! Love your videos :) Do you have any plans to make a video about Netcode for Entities? ^^
Yup, when it finally hits 1.0 I definitely want to cover that, I haven't looked at it at all so no idea how different/similar it is to NGO.
I have a few questions
1. I'm able to create a game the have lan game and indernt with the new unity Networking system ?
2. This indernet service are free and if not it's expensive ?
3. If create 1 server am able to make the Player to create the own custom mach inside on this server ?
awesome bro thanks a lot
awesome tut!!! more more more
Hey @CodeMonkeyUnity. I am seeking here a small info that I couldn't find about the multiplay.
I am trying to understand how Game Server Hosting service will work on in a specific game so as to understand how it can optimize costs and if the service will fit these needs in the future. The game is a 2 player board game let's assume chess for example, where the server side load is mostly keep a record of game state, calculate and validate player's input/moves and relay that verification and input to other clients for local replication and game state sync. My biggest doubts stem from how the concept of server correlates to the concept of CPU Cores in Unity's pricing model. Since this game is decently simple I expect that each individual session's core usage will be small, but am I able to host multiple sessions without rounding core's to the next integer core? Hypothetically, if one core could run 2 sessions of this game and I have two "servers" each running a session, will our core usage be 1 or 2? If so, would be need to create a solution to be able to run several sessions inside the same server, or is it done by default?
Thank you all
I believe that's going to depend on how your server code runs, it will automatically try to fit as many instances in one server as possible. So if your server code is really lightweight you can fit a lot of them into a single server which should have a very low cost.
Or for that kind of asynchronous multiplayer you can even go with a simple cloud server that only runs logic when a move happens, I sort of did a multiplayer tic tac toe like that ruclips.net/video/EEQfSmK1nXA/видео.html
Thanks mr.Code Monkey! Always best Unity tutorials ;)
Photon or Netcode what should I use?
To create a game with many servers across regions like CS2, will net code + dedicated server build also work?
I trying to find tutorial for make an account on server and how to send and use a data like character items, experience. All uing netcode for game objects. Using cloud save.
Yes that would be done through cloud save, no relation to NGO
Oh my god thanks you ❤❤❤
Hi codemonkey,
should I watch you videos "matchmaking and Server Hosting) after completing the multiplayer tutorial for kitchen chaos? Or there is no relation between them.
Yup watch them afterwards, in those videos the starting point is the last project files of the course
Although if you just want to learn about these tools they also work as standalone tutorials
I have a really pain headache solving memory usage issue with Unity Multiplay. Did you experiencing big memory usage increase sometimes when player join/leave? The issue is not happen with windows dedicated server build tested on local, but happen in Multiplay with Linux build. Maybe this issue won't matter with 4 players in 1 rooms, but for City Hub that will contains 100 players is a really big problem!
How do you set up matchmaking in Multiplay? Or how do you integrate some other matchmaking service (Playfab for example). In Playfab there is option to make a sarver instance for finished matchmaking ticket, so players that were gathered by matchmaking into a match are joining that server.
How do yoou make something similar with Multiplay?
I'm going to cover matchmaking in the next video
I don't get it. Why everyone says making a multiplayer game is not worth it because setting up network is difficult and expensive when it's this simple? Is there a catch?
It's always more difficult than a singleplayer game since you have to build all the same things of a singleplayer game and then add multiplayer on top.
But yes thanks to the tools that exist nowadays making something multiplayer isn't the huge challenge it once was.
Does the multiplayer video include what you shared in this video? Or is this some extra info?
This is extra, in the course I implemented Lobby and Relay which means a P2P connection, this is Dedicated Servers.
Hello, I dint tried this yet, but can you tell me if this works with assets such as fishnet networking, photon, mirror and others of the sort? Or just the new Unity multiplayer?
This is completely separate from the Netcode layer so it can work with any of those tools. For example Apex Legends uses this and it does not use Netcode for Game Objects (or even Unity)
@@CodeMonkeyUnity Oh I see, thats nice. Thank you so much :)
"Hello, I have a question about Multiplay hosting. When I set up the fleet cloud server density, I get the message: 'Your servers have used more resources than allowed within the past 24 hours. If this happens often, you may experience issues.' I am on the Pay-As-You-Go plan, though."
hmm I haven't seen that message myself, maybe you just need to up the CPU on the server? Maybe it means you're using up more resources than you defined during setup
I dealt with the clientrpc issue u mentioned all day today 😂 unity is updating the clientrpc and serverrpcs soon to be more generic calls with something to pass through instead. Idk maybe it will make it less topsy-turvy.
Yeah I saw they're in the process of making just a single RPC that works for both Client and Server, that should help simplify some things
Do you have tutorial on Shaders?
I want to learn how to write shaders, I’m making a mobile FPS game and I want to create the most optimized shader possible. I know it’s going to take me months, or maybe even a year, but I’m willing to put in the effort to make my game look great.
ruclips.net/p/PL78XDi0TS4lEBWa2Hpzg2SRC5njCcKydl
I've only used shader graph, never made shaders with code
I made some tutorials here unitycodemonkey.com/search.php?q=shader
hello sir i cannot connect my client to the dedicated server it takes too long time to connect and finally gives failed to connect to the server all my ips and port match in client and server port is 9000 automatic and ip varies according to server please help can i achieve this without using relay??
Hey Awesome tutorial. Was just researching on lobby and DGS and this video was god send. Just want to ask some questions
In the MainMenuDedicatedServer, you have loaded a LobbyScene on start. Let's say I have 2 maps, how can I set it up so that based on which map the player selects, that map's lobby scene is loaded?
If I want the player to automatically join the first lobby with available slot in the list of lobbies inside a map; how can I achieve this using DGS?
You want the Lobby itself to be in different maps or just the GameScene? Either way the answer is the same, have the Host/Server change the Scene and all the Clients will receive the change.
I'm not sure what you mean "list of lobbies inside a map", Lobby has no concept of "map", it's just a grouping of players. And DGS has no concept of Lobby, it's just a dedicated server. Whatever logic you are trying to implement first get it working with a regular Host, if it works with a Host it will work with a Dedicated server.
What would be an alternative for network transform for multiple online enemies
Thank you a lot my friend
Thanks for the tutorial! Could you tell me which services and methods are better to use for a game where a player presses 1 match search button and when he finds an opponent (1x1), the game starts. Is this a hidden lobby + relay or is something else needed? (Smth like in Dota 2 or Brawl Stars)
That would be either Quick Join, which is from Lobby which I covered in the multiplayer course
Or matchmaking which I will cover in the next video
Pun 2 is alternative of unity game server??
Why choose dedicated server instead of relay ? How to know what you should do ?
Lower delay but higher cost.
With relay the packet needs to go to the Relay, then to the Server, then back to the Relay then back to the Client. With Dedicated server you have a dirent connection.
What about player databases please? Like scores coins etc.
You need some kind of server stored data, could be one of the many cloud providers like Azure ruclips.net/video/EEQfSmK1nXA/видео.html
Hi, is there a way to use UGS with AWS? or transfer the configured project to our servers?
Not sure exactly what you mean by that but yes you can use AWS to host your dedicated servers instead of Unity's Game Server Hosting
Does anyone have a solution or a clue as to how to deal with hidden / or missing shaders on the Linux build. it wont finish its test allocation, and when i look in the server log. its full of shader / gpu mismatch errors.
IsServer is working in start but not working in update or in other functions
Thanks for this awesome tutorial. I am getting this error while joining : Server having issues (Query didn't respond or responded incorrectly [DOWN]) for 120 seconds (Restarted 0 time(s))
Failed to connect to server.
Did you implement the Query protocol? If not the server gets considered unresponsive and quits
@@CodeMonkeyUnity I don't find the query protocol. How do I implement the query protocol?
Is it a similar process to use Photon fusion, and Multiplay?
It should be similar, Multiplay is meant to work with any Netcode stack
Can dedicated servers be linked with Lobby so that players can host and join with a code?
Means if I want to test this I always need to create test allocation if not then I have to buy the paid version of this? Because it's timer of 1 hour
On this, do Unity allow custom matchmaking algorithims and for players to be able to queue to multiple locations at once for Match making?Since that's one thing I've always hated about apex, there's a billion different servers and you can't play together, so the matches are terrible quality(this was extremely obvious when Arena came out, literally had bronze players vs top 10 people in other team...)
Hmm not sure what you mean by "queue to multiple locations at once", like queue simultaneously for Ranked and for Casual? I think that should be possible, I think you should be able to create 2 tickets, one for each pool, and cancel the second one when the first one goes through.
I'm covering the Matchmaker in the next video and it's a very robust tool with tons and tons of options.
Brother, how make server build ?
And how I can use other server than unity multiplay?
On your Build Target just select Dedicated Server
That will give you an executable for the dedicated server, then you can use that with whatever cloud server system you want, doesn't have to be Unity's one
@CodeMonkeyUnity Thanks
dumb question, so I am making a mobile game, but want to have it hosted on Unity dedicated server build, should I make the game (Android) and then change the platform to server (whether windows or linux)? or should i keep it mobile build and deploy it to unity dedicated servers? is there a video/steps? again this is going to be for hosting a mobile game server.
Yes exactly, make the game build as Android, and make the server build as Dedicated Server
Is it possible to create Netcode games with AR Foundation as a dedicated server? I'm having a difficult time finding information about that.
I can't think of any reason why it wouldn't work, Netcode just synchronizes objects, the target platform doesn't matter. Same thing on the dedicated server, it's just a Linux server that runs the server logic regardless of what platform is connecting to it.
Hey great tutorial, Is it posssbile to host this server experience on a Web browser domain ?
Not sure what you mean by "host", the server lives on a server somewhere, then a WebGL client can connect to it
hey bro please help me, i am working on windows, how do i host a windows build on a dedicated server? please help man thanks
But that way i have to pay all the servers or no? I would like to give people the option to host their own dedicated server instance on a windows or linux machine and just have some masterserver maybe, or working with steam or playfab, etc. This way, you can't really make a free game out of it without monetizing it somehow to pay the servers. Sorry if i misunderstood something.
Yes if you want technically you could build the entire infrastructure yourself, but that will still cost you
If you're making a free game then the best option is P2P, just use Relay or NAT Punchthrough instead of dedicated servers
hi, can someone wxpline how the unity multiplay pricing work?
(i want to make a multiplayer game and i dont sure how much it will cost me)
Are you running one match per one server? Aren't servers priced per amount? Wouldn't it be better to have minimum amount of servers that run multiple games at once? Thank you!
Yes and no. Note how I set it for just one server but it made multiple allocations, those are all seperate games running on just one server.
Does the connection require the Internet?
Can this be used with Unity’s 3rd party networking solutions like FishNet and Mirror? And are Unity dedicated servers are able to handle a lot of traffic from large scale games, like MMORPGs?
Yes, this works with any Netcode. And yes, this is the tool that Apex Legends uses so it can handle pretty much any game you can imagine
Hi Code Monkey, Awesome tutorial video.
Do you have an existing video on how to manage players creating ID, logging in and how to save and retrieve player character data from server side to the game?
That is going to be heavily dependent on what you use for server side data, Unity doesn't currently have any server data storage (although they have Cloud Code) so youcould use something like Azure unitycodemonkey.com/video.php?v=qdE01Xg3y2A
What is regular linux build? I never heard of it before I dont know what to do
You make a build for Linux. For into File - Build Settings and choose Linux as the target platform
@@CodeMonkeyUnity Thank you it helped
Allocated server had issues (CPU over limit. Combined core(s) usage 120.88% (60.44% of machine), only 39.00% allowed with 1 players), stopping server and deallocating
I'm getting this error after few minutes
Sounds like you picked values for the CPU that are too low for your game
Does this service work for custom network solutions too? Or do we have to use unity networking only?
You can use it with anything, for example Apex Legends uses this but does not use Unity or Unity networking
@CodeMonkey
Thanks for this awesome tutorial. When I imported this project, I am getting this error :
( Assets\Scripts\UI\LobbyMessageUI.cs(54,50): error CS1061: 'NetworkManager' does not contain a definition for 'DisconnectReason' and no accessible extension method 'DisconnectReason' accepting a first argument of type 'NetworkManager' could be found (are you missing a using directive or an assembly reference?)
&&
Assets\Scripts\KitchenGameMultiplayer.cs(128,40): error CS1061: 'NetworkManager.ConnectionApprovalResponse' does not contain a definition for 'Reason' and no accessible extension method 'Reason' accepting a first argument of type 'NetworkManager.ConnectionApprovalResponse' could be found (are you missing a using directive or an assembly reference?) )
Am I missing some reference? I also did not see anything related to 'Reason' inside ConnectionApprovalResponse class
Which Unity version are you using? Which Netcode for Game Objects version?
Sounds like it loaded an older version.
For this demo I used Unity 2022.2 and NGO 1.2.0
My project uses the services APIs to allocate servers as I saw in your tutorials, and everything works great on unity, but when I host the WebGL build and try to send a post to the Unity services APIs it gets blocked by CORs. If I was the server owner It would be possible to just set the right servers headers, but since Its Unity apis I cant change it. The worst is that it makes no sense that Unity has no CORs headers on the APIs because that means no WebGL build would be able to acess it.
I'm not a web expert but I think that has more to do with the settings on the server where you're hosting the WebGL build rather than the Unity code
I'm following this step by step implementing it to my game, right now Im getting a error after the Allocation Test that says: Caught fatal signal - signo:11 code:1 errno:0 addr:(nil). Any ideia what it could be?
Is that an error inside Unity or coming from the GameServerHosting API? Might be an issue on the servers
@@CodeMonkeyUnity It appears on the log file right on the startup. The log shows some warnings and errors related to shaders and crashes with this error before printing anything inside the initialization scripts of the game
@@CodeMonkeyUnity Do you have any ideias on tests I could make?
@@H_Battousai Hey! I have the same issue, have you fixed it?
@@youko3795 Unfortunately no, I’m still trying to figure it out
Great job! Making multiplayer/online games requires huge concentration, does it? You should know several resources (like ids, tokens, api keys etc.)
Multiplayer is inherently more complex than singleplayer but thanks to awesome tools like NGO it is actually not too difficult nowadays.
@@CodeMonkeyUnity I haven't got any problem with complexity, just realized it. 😀I'm developing web applications for bank, so complexity is not a surprise for me.