Implementing Unity Lobby, Relay and Editor Multiplayer Play Mode (It's AWESOME!)

preview_player
Показать описание
In less than 20 minutes, we'll build a stand-alone Quick Join Lobby and Relay implementation for Unity Gaming Services that will work for any game! On top of that, we'll be implementing and test-driving the experimental Multiplayer Play Mode package, which allows us to test with up to 4 players without any third-party tools! LET'S GO!!

#unity3d #gamedev #indiedev

▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬

0:00 Intro
0:52 Setup Lobby and Relay
2:27 Multiplayer Play Mode
5:55 Diagram
6:30 Project Changes
7:05 Multiplayer Service
15:30 Lobby UI and Loader
17:50 Demo

*Open Source In This Project*

*KART Models used in this video*

*Follow me!*
Рекомендации по теме
Комментарии
Автор

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 YouTube channel 😀! I hope you all like Multiplayer Play Mode as much as I do!

git-amend
Автор

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!

GeniusPancake
Автор

The tip to add Multiplayer Play Mode is a game changer. This video needs a hundred thousand more likes

jaysenedwinward
Автор

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!

vrdev
Автор

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.

ItsAllGoodGames
Автор

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?)

ffqw
Автор

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 ?

shijinmohammed
Автор

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?

piyushpanjwani
Автор

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

captainnoyaux
Автор

Ngl looks like a great challenge for me
Thanks for the tutorial

alyson_lupo
Автор

wow, awesome, i cant wait to finish this series and start to make my own version, thanks

loscaballerosdebronzodia
Автор

Really loved the series. Maybe a Multiplayer FPS vertical slice for the next?

lavimahal
Автор

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?

IAmSidh
Автор

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

chahdstudio
Автор

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.

Abdulwahab-vbhe
Автор

Where are you getting 'Countdowntimer' in Utilities? Is it a package that needs to be downloaded?

jaysenedwinward
Автор

How do you handle host migration? After all if the host leaves then all the players get booted out too right?

AdrienSanctioned
Автор

Which version of Unity did you use for this?

foizsworld