Making a Multiplayer FPS in Unity (E17. Matchmaking) - uNet Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
thanks for tuning in at brakus everyone welcome to video number 17 on making a multi-player fierce in unity this video is going to be very short but very very important we are going to be talking about matchmaking and how you can connect players over the Internet instead of just running multiple clients on one computer as we've done so far so finally you will be able to send the game to your friends and play with them wherever they are also on the local network of course so it's it's very easy to set this up there for this short video but I will be explaining a bit about how it works and some of the pricing stuff so yeah without further ado let's jump right into today's video so you can see that I'm here in unity and the window that we want to find is on the window and then services and I like to dug it over here by the inspector panel and the first thing that we want to do here is select an organization if you haven't created one of those you can go ahead and do it I believe it will prompt you to do that and I'm just going to select brackets here and then I'm going to select create in order to create the unity project ID and that's because any services that includes the multiplayer I API it includes stuff like analytics cloud builds adds all of that on that unity provides needs to be linked with your project and it does that through a unity project ID and that's what we're going to be creating here or if you already have one set up you can click that button there and type it in so I'm going to hit create here and now it's basically done exactly that you can see I've access to ads analytics cloud build all of that stuff and then the multiplayer tab down here and that's why we're going to go down and click that and you can say see that it loads just for a moment here and then you can see your configuration overview and currently it says that there's no configuration presence and what we can do to change this assembly hit go to dashboard we also have some other things we can do in here such as go to the Settings tab if you want to rename your magic name change the organization or unlined unlink the project from the unity project so that's that's all settings that you have access to you cannot delete your unity project ID in here but you can do that through the dashboard up here so let's go onto multiplayer and hit go to dashboard and it's going to open this up enjoy on default web browser in my case that's Google Chrome so here we have it and it's going to ask you to set this up and we do this by first specifying the maximum amount of players that we are set a room for per room so in a lobby I want to have maybe a maximum of 16 players so I'm going to type in 16 here and hit save and we can basically change this at any point so it's not really important just choose a number that's big enough for you and you can see you can change it very quickly right here then we have this statistic called the CCU usage CCU means concurrent users and it's something that we often talk about when talking about network games and it basically means the total amount of users that are on your game at any given time and of course this is going to vary depending on the day and the time of day and over the life cycle of your or the lifetime of your game but when I'm billing or when calculating how much you're going to pay on any kind of server for any kind of service you like to kind of predict how many concurrent users you're going to need or how much room you're going to need for X amount of concurrent users and this here should show you with maybe a bit of error how many users are currently on the game and of course we haven't loaded up this game anywhere so there's currently no concurrent users on there you can also see that my global CCU limit meaning the at all or the maximum amount of people that can be on the game at any time is 200 that's because I have unity Pro if you have the default a unity version you're going to have a number of 20 here and this is only for when developing your game it to amount of 20 people is going to be fine this is only for testing on a few computers so you're not going to need any more than that but when you act actually publish the game then you want to go in here under activate live mode live mode you can see here is for multiplayer projects that are about to be publicly released to end-users so that means that when you want to actually share this with the world and it's no longer in the arm in the development phase but maybe in the testing phase such as where the access and beta or just release then you're going to go in here and activate it and from there on out you're going to be paying for how much traffic you use and the reason for this is because unit servers are expensive and unity have set up some servers and that does matchmaking that means they connect user setup rooms and all of that stuff and also relay servers that make sure that they connect that when a client connects it connects to unity servers first and then they go from Unity servers to what every other client that you want to communicate with and it does this to avoid problems with firewall and net configuration and that kind of stuff so that it just works all of this stuff can be done manually you can do this on your own however it's actually kind of difficult and if you have never played around with service before and you find the stuff that I show you in this video to be on may be kind of difficult I wouldn't recommend our beginning with that yet I mean this kind of stuff can be fairly advanced it can definitely be done of course it can be taught if you if you really want to get into it do that but it's not something that you just do overnight so and that's why unity provides this and I definitely recommend that you are use it so let's look a bit on pricing shall we so here you have the unity services page and you can see that it says here that it's backed by you with unity matchmaker servers and the unity relay servers so that was what I was talking about you can see that the personal Edition includes 20 CCU for multiplayer development and again this is only on the development and includes 200 for the professional Edition so unity charges 0.49 on dollars per gigabyte are used by the Unity matchmaker and relay servers and only those all of the other traffic doesn't matter and you can see here that they have made a tool to estimate the monthly bill that you're going to have and this is very much an estimate things can vary it's very hard to predict how many concurrent users you are going to have how many messages they will send how much how large these are messages are and all that stuff but it's here so if you have an idea of what this is going to be you can check it out for now I would just worry about building the game and seeing if you can you can actually turn it into something that's worth publishing and if you do then it's maybe time to look into this kind of stuff so but it's definitely here and you should definitely read up on different alternatives to publishing your game online it's it's it's a whole world out there good so that's how unity is multiplayer system works and how they're matchmaking works and if we go back into unity now we can refresh our configuration and it's going to list here the same information that we had on in the chrome tab here so I have a pro subscription plan with 200cc you limit and we're currently using serial and what we basically able to do now is if you go into our network manager we don't need to change a single thing here instead we can simply go ahead and hit play and then instead of using LAN host online client we go and enable the matchmaker there and unity now can create an internet match meaning a room for people to join and then it can of course find an internet match and it's really that easy to you so you type in a real name you create then you find and it will connect you to one of them and you can just um you can just choose to connect to the correct room and everything works of course this our UI is very temporary and I definitely want to change this in an upcoming video so that was all we needed to do what I'm going to do now is simply build this for the Mac that I have standing nearby and I'm going to build it for the Windows client here as well and then I'm just going to record that the two are connecting to each other and I'm going to make sure to put my Mac on a separate network so that you can see that it doesn't only work on land so let's do that now and of course when I'm building here just going to build settings and then I'm switching between Windows and Mac and then I'm just hitting build and choosing a place for that to happen so that's all I'm doing if you don't have the Mac OS X here you're going to need to re R run the Installer and choose it as a installable component so you have the ability to choose whether or not you want to be able to export to Mac and so if you haven't chosen that you should go ahead and rerun the installer so I'll see you in a little bit so as you can see I've set up my Mac alongside my Windows computer and I'm just now creating a test Lobby on the Mac then I'm switching to the window hitting fine internet match and then I'm choosing the lobby that we just created and that should bring the two players inside of the same room and you can see that all of our network code is working so that was pretty much it for this video I hope you enjoyed it and I'll see you in the next one
Info
Channel: Brackeys
Views: 78,169
Rating: undefined out of 5
Keywords: unity, unity3d, tutorial, material, materials, and, settings, how, to, howto, learn, course, series, tutorials, game, development, develop, games, programming, coding, C#, matchmaking, lobby, room, join, connect, internet, relay, server, firewall, nat, lan
Id: X9Ra0D7JJ88
Channel Id: undefined
Length: 10min 39sec (639 seconds)
Published: Thu Jun 23 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.