Guess what - not only was this one of the most fun episodes to make, but it also marks 6 months since the beginning of this UA-cam channel 😀! I hope you all like Multiplayer Play Mode as much as I do!
Hey great tutorials, I like how you cover a ton of ground really fast but explain it as you go. The typing while talking is impressive. I hope they take off!
Multiplayer play mode is one of the thing I'd upgrade for when it's out of beta, using ParrelSync while very convenient, takes a lot of space and is slow
That is a nice little intro to Lobbies and Relay. Now, I am a complete beginner in lobbies and I have a few questions: 1. Does creating a server constantly refreshes the lobby (with the countdown heartbeat timer)? 2. Does having nobody in the lobby still refrhesh the lobby? I am worried that I'd be using up the free lobby/relay bytes and requests and I wanted to see if I was wrong. Since I want to have a lobby like in Age of Empires IV (people can connect) and I do not want to waste data. What I am considering is creating a lobby and once a player opens the lobby only a single request is fired to retreive the existing lobbies. If he wants to refresh, he can click the refresh button and it would update (prevent refresh to be every X seconds). Just to save on bytes/requests. Great video by the way, thanks for that explanation on how it functions! Was a great intro to the lobbies for me!
Thanks for your comment! I believe it is possible to keep a lobby open with no players, so long as you've created that lobby through your service account - though I have never tried this myself. The heartbeat and the refresh can be considered 2 different things. The heartbeat keeps the lobby alive, and the refresh is to optionally update the data about which lobbies exist and who is in them for a more UI driven approach. In this video we are just assuming the bare minimum. Your description of how you would implement a refresh is reasonable - in fact many people do it this way AND have a regular update. It's worth noting that the amount of data going back and forth is minimal compared to actual gameplay. Also, the setup for a dedicated server approach will be slightly different than this host/client approach but that's longer than I can write in a YT comment!
@@git-amend Thanks for answering! You cleared up a lot of questions in my brain and I started designing the most basic of lobby systems. The MVP version of it so that I can understand what is happening before expanding upon it. There is no use in only copying your code when I do not understand 90% of it. Again, thank you very much for the video! It is insanely helpful. All your videos are insanely helpful, I felt stuck before I started watching you (didn't leave my comfort zone).
@@GeniusPancake Glad to hear that helped! Starting with an MVP approach to your lobby system is a smart move to fully grasp the fundamentals before expanding. Keep exploring and learning!
@@git-amend So, I come back to you after 7 days of doing a lot of research, and implementation, on my lobby and I am really happy to say that I made a lobby system like in the game Age of Empires. I was gettng really stuck at certain points (when to update lobby, how to update when the lobby is created and not on lobby show, how to sync other players, how to limit what player does, etc.) but I got it in the end and created it with certain limitations on myself (fun that way). Limitation 1: No singletons nor static lobby (have to use managers and EventHandlers or Actions and Funcs)) Limitation 2: I can't cry. Now, I have a working lobby with custom profiles. I can kick people, change map settings, change map and made the pooling not be every second but only when the host changes the data or when the player joins/leaves. Also, trying to swap out lobby pooling update with netcode for game objects where changing UI would tick network variable and update data for people inside the lobby. It's faster, doesn't use lobby "Get" data (since I noticed my "Get" data is really high since there are a lot of data being updated). Anyway, great video on Faccade Pattern! Keep going and thanks for all the knowledge!
Just some feedback after implementing your code The timer for heartbeat and polling never gets called, didn't even realize it at first but then notices the Debug statements never appear in the console. I just deleted the timer and used InvokeRepeating() in the CreateLobby() function where you start the timers. Also for some reason in the LobbyPollingUpdate function you create a new local lobby via Lobby lobby instead of referencing the existing "currentLobby", don't know why you did that, i changed it to currentLobby so it updates the actual lobby we're in. Correct me if this is wrong.
Also i'm considering doing my own video tutorial, showing from start to finish how to implement a very basic 1v1 turn based multiplayer game like Tic Tac Toe or whatever. This would use all the code from your tutorial for Authenticating and Lobby/Relay connection, i would of course link to your video as the source for the code, is that ok? I have also added on a basic function for handling disconnection, and i will show basic multiplayer interaction through RPC calls. I think it'll be a solid tutorial, i haven't seen anything on youtube that shows this stuff clearly from start to end, and your video is about 90% of it.
very good tutorial thank you, can you make a tutorial about character selection and customization and how to use multiplayer services with third party controllers like oopsive or invector or any premade chatacter controller? keep it up bravo
Great video! It is very helpful and straight to the point, saving a lot of time. I just have a few doubts. It would be great if you could provide some insight. Will it work on a different network if I share the lobby code created in the CreateLobby function with a person on a different network? If the lobby remains idle for, let's say, a minute, will it automatically get deleted once the host closes the app, or will I have to delete it manually in the code?
I am bit confused... If we are extrapolating if the latency is more than fixedDeltaTime, wouldn't that mean that the kart on the server will always be extrapolated and their positions wouldn't match up on server and client ?
He your tutotrials are awsome. i want to learn how to code in genaric way, using pattrens i want to strat with base, you have told i your vids but i want to go with fully base ways so icloud patrice them more.
I actually have planned a few videos that are more about advanced language features, principles and patterns rather than entire vertical slices that I'll be creating after the Kart series. Are there any specific topics or patterns you are interested in?
Hi i have been using relay to create my game where maximum 4 players can join lobby and when all of them press ready the main scene is loaded and the game starts. But the issue i am getting is when all players are ready only host loads the scene. Other clients do not load scene. Why is that so?
In Unity's netcode, only the host or server can initiate scene changes via the NetworkSceneManager.Load method, ensuring synchronization among players. It sounds like this may be related to your issue. It's difficult to analyze what may be the cause of your issue however, as it could be any number of things. This is a topic for a future video I plan to make when time permits. If you can't wait for the next Netcode video, check out the docs here: docs-multiplayer.unity3d.com/netcode/current/basics/scenemanagement/using-networkscenemanager/
@@jaysenedwinward Looks like that part might be missing from the video and the repository. Yes, you should make sure that each timer's Tick method is called during Update calls and pass in Time.deltatime.
I'm going to make a co-op game and can I do it without using these: -Relay and -Lobby in Unity's Asset Store - (Can Relay and Lobby be handled with Steam API?)
@@git-amend I am using 2022.3.14f version but I can't find the multiplayer option in my unity cloud and It asks me set the payment method, what should I do?
@@foizsworld1092 Mulitplayer Play Mode is an experimental package that was introduced in Unity 2023. You won't be able to get it without downloading a newer version of Unity. After you upgrade your Unity version, you can install the package by name from the Package Manager by typing in the package name: com.unity.multiplayer.playmode To use Unity Gaming Services you may have to enter a payment method, but there are thresholds you have to cross before they actually charge you - which are quite high - if you are just making a personal project, I doubt you would ever be charged. See: unity.com/solutions/gaming-services/pricing
@@git-amend I am not asking for multiplayer play mode, I am just multiplayer option like, Lobby and Relay. I have them in my Unity cloud but it requires to add the payment method, it shows me UGS requires a subscription fee. So my question is how can I use Relay and Lobby without paying
@@foizsworld1092 You have to add a payment method to use these services. However, you won't be billed anything unless you exceed the limits of free tier as described in the link provided in the previous comment.
Guess what - not only was this one of the most fun episodes to make, but it also marks 6 months since the beginning of this UA-cam channel 😀! I hope you all like Multiplayer Play Mode as much as I do!
The tip to add Multiplayer Play Mode is a game changer. This video needs a hundred thousand more likes
Hey great tutorials, I like how you cover a ton of ground really fast but explain it as you go. The typing while talking is impressive. I hope they take off!
Thank you!
MPPM is such a game changer.
I want u tarodev, I want u bad
Ngl looks like a great challenge for me
Thanks for the tutorial
wow, awesome, i cant wait to finish this series and start to make my own version , thanks
Really loved the series. Maybe a Multiplayer FPS vertical slice for the next?
Maybe one day, I'll keep that one in mind!
Multiplayer play mode is one of the thing I'd upgrade for when it's out of beta, using ParrelSync while very convenient, takes a lot of space and is slow
That is a nice little intro to Lobbies and Relay. Now, I am a complete beginner in lobbies and I have a few questions:
1. Does creating a server constantly refreshes the lobby (with the countdown heartbeat timer)?
2. Does having nobody in the lobby still refrhesh the lobby?
I am worried that I'd be using up the free lobby/relay bytes and requests and I wanted to see if I was wrong. Since I want to have a lobby like in Age of Empires IV (people can connect) and I do not want to waste data.
What I am considering is creating a lobby and once a player opens the lobby only a single request is fired to retreive the existing lobbies. If he wants to refresh, he can click the refresh button and it would update (prevent refresh to be every X seconds). Just to save on bytes/requests.
Great video by the way, thanks for that explanation on how it functions! Was a great intro to the lobbies for me!
Thanks for your comment! I believe it is possible to keep a lobby open with no players, so long as you've created that lobby through your service account - though I have never tried this myself. The heartbeat and the refresh can be considered 2 different things. The heartbeat keeps the lobby alive, and the refresh is to optionally update the data about which lobbies exist and who is in them for a more UI driven approach. In this video we are just assuming the bare minimum. Your description of how you would implement a refresh is reasonable - in fact many people do it this way AND have a regular update. It's worth noting that the amount of data going back and forth is minimal compared to actual gameplay. Also, the setup for a dedicated server approach will be slightly different than this host/client approach but that's longer than I can write in a YT comment!
@@git-amend Thanks for answering! You cleared up a lot of questions in my brain and I started designing the most basic of lobby systems. The MVP version of it so that I can understand what is happening before expanding upon it.
There is no use in only copying your code when I do not understand 90% of it.
Again, thank you very much for the video! It is insanely helpful. All your videos are insanely helpful, I felt stuck before I started watching you (didn't leave my comfort zone).
@@GeniusPancake Glad to hear that helped! Starting with an MVP approach to your lobby system is a smart move to fully grasp the fundamentals before expanding. Keep exploring and learning!
@@git-amend So, I come back to you after 7 days of doing a lot of research, and implementation, on my lobby and I am really happy to say that I made a lobby system like in the game Age of Empires. I was gettng really stuck at certain points (when to update lobby, how to update when the lobby is created and not on lobby show, how to sync other players, how to limit what player does, etc.) but I got it in the end and created it with certain limitations on myself (fun that way).
Limitation 1: No singletons nor static lobby (have to use managers and EventHandlers or Actions and Funcs))
Limitation 2: I can't cry.
Now, I have a working lobby with custom profiles. I can kick people, change map settings, change map and made the pooling not be every second but only when the host changes the data or when the player joins/leaves.
Also, trying to swap out lobby pooling update with netcode for game objects where changing UI would tick network variable and update data for people inside the lobby. It's faster, doesn't use lobby "Get" data (since I noticed my "Get" data is really high since there are a lot of data being updated).
Anyway, great video on Faccade Pattern! Keep going and thanks for all the knowledge!
@@GeniusPancake Fantastic! I'm really glad to hear that, and I hope to see your lobby in action one day!
Just some feedback after implementing your code
The timer for heartbeat and polling never gets called, didn't even realize it at first but then notices the Debug statements never appear in the console.
I just deleted the timer and used InvokeRepeating() in the CreateLobby() function where you start the timers.
Also for some reason in the LobbyPollingUpdate function you create a new local lobby via Lobby lobby instead of referencing the existing "currentLobby", don't know why you did that, i changed it to currentLobby so it updates the actual lobby we're in.
Correct me if this is wrong.
Also i'm considering doing my own video tutorial, showing from start to finish how to implement a very basic 1v1 turn based multiplayer game like Tic Tac Toe or whatever.
This would use all the code from your tutorial for Authenticating and Lobby/Relay connection, i would of course link to your video as the source for the code, is that ok?
I have also added on a basic function for handling disconnection, and i will show basic multiplayer interaction through RPC calls.
I think it'll be a solid tutorial, i haven't seen anything on youtube that shows this stuff clearly from start to end, and your video is about 90% of it.
very good tutorial thank you, can you make a tutorial about character selection and customization and how to use multiplayer services with third party controllers like oopsive or invector or any premade chatacter controller? keep it up bravo
Thanks for the comment and the ideas! I'll give both of those some consideration!
Great video! It is very helpful and straight to the point, saving a lot of time. I just have a few doubts. It would be great if you could provide some insight.
Will it work on a different network if I share the lobby code created in the CreateLobby function with a person on a different network?
If the lobby remains idle for, let's say, a minute, will it automatically get deleted once the host closes the app, or will I have to delete it manually in the code?
I am bit confused... If we are extrapolating if the latency is more than fixedDeltaTime, wouldn't that mean that the kart on the server will always be extrapolated and their positions wouldn't match up on server and client ?
He your tutotrials are awsome. i want to learn how to code in genaric way, using pattrens i want to strat with base, you have told i your vids but i want to go with fully base ways so icloud patrice them more.
I actually have planned a few videos that are more about advanced language features, principles and patterns rather than entire vertical slices that I'll be creating after the Kart series. Are there any specific topics or patterns you are interested in?
@@git-amend not just go from solid principals in detail to mostly used common patterns that are used in games.
Hi i have been using relay to create my game where maximum 4 players can join lobby and when all of them press ready the main scene is loaded and the game starts. But the issue i am getting is when all players are ready only host loads the scene. Other clients do not load scene. Why is that so?
In Unity's netcode, only the host or server can initiate scene changes via the NetworkSceneManager.Load method, ensuring synchronization among players. It sounds like this may be related to your issue. It's difficult to analyze what may be the cause of your issue however, as it could be any number of things. This is a topic for a future video I plan to make when time permits.
If you can't wait for the next Netcode video, check out the docs here:
docs-multiplayer.unity3d.com/netcode/current/basics/scenemanagement/using-networkscenemanager/
Where are you getting 'Countdowntimer' in Utilities? Is it a package that needs to be downloaded?
It's a custom script:
github.com/adammyhre/Unity-Multiplayer-Kart/blob/master/Assets/_Project/Scripts/Utils/Timer.cs
@@git-amend Thank you. This was quite a through tutorial. Some of it was a little advanced but it was easy enough to simplify for a beginner like me
@@git-amend Since this doesn't use Monobehaviour for an update method does that mean I need to pass Deltatime in from somewhere else?
@@jaysenedwinward Looks like that part might be missing from the video and the repository. Yes, you should make sure that each timer's Tick method is called during Update calls and pass in Time.deltatime.
I'm going to make a co-op game and can I do it without using these: -Relay and -Lobby in Unity's Asset Store - (Can Relay and Lobby be handled with Steam API?)
I guess that depends... is it a couch co-op game? I'm not too sure about the Steam API, you'd have to do some research on that!
@@git-amend okey ı will search more. Thanks
Which version of Unity did you use for this?
Unity 2023.2.0b8, though I have since moved up a few versions
@@git-amend I am using 2022.3.14f version but I can't find the multiplayer option in my unity cloud and It asks me set the payment method, what should I do?
@@foizsworld1092 Mulitplayer Play Mode is an experimental package that was introduced in Unity 2023. You won't be able to get it without downloading a newer version of Unity. After you upgrade your Unity version, you can install the package by name from the Package Manager by typing in the package name: com.unity.multiplayer.playmode
To use Unity Gaming Services you may have to enter a payment method, but there are thresholds you have to cross before they actually charge you - which are quite high - if you are just making a personal project, I doubt you would ever be charged. See: unity.com/solutions/gaming-services/pricing
@@git-amend I am not asking for multiplayer play mode, I am just multiplayer option like, Lobby and Relay. I have them in my Unity cloud but it requires to add the payment method, it shows me UGS requires a subscription fee. So my question is how can I use Relay and Lobby without paying
@@foizsworld1092 You have to add a payment method to use these services. However, you won't be billed anything unless you exceed the limits of free tier as described in the link provided in the previous comment.
How do you handle host migration? After all if the host leaves then all the players get booted out too right?