How to set up dedicated server hosting and matchmaking for Unity

How to set up dedicated server hosting and matchmaking for Unity

HomesamyamHow to set up dedicated server hosting and matchmaking for Unity
How to set up dedicated server hosting and matchmaking for Unity
ChannelPublish DateThumbnail & View CountDownload Video
Channel Avatar samyam2023-05-03 13:00:09 Thumbnail
29,953 Views
Learn how to use Unity's UGS tools to host a dedicated game server and implement matchmaking.

ᐅDownload the complete source code bundle for my Unity tutorials
https://sam-yam.itch.io/samyam-full-source-code-to-all-videos

Get the source code
https://www.patreon.com/posts/82134830

Wishlist for my new game BUMBI on Steam!
https://store.steampowered.com/app/2862470/BUMBI/

If you enjoyed this video please like and subscribe as it helps me a lot, and please consider joining my Patreon or becoming a YouTube Member 🙂

Watch the previous video
The ultimate multiplayer tutorial for Unity – Netcode for GameObjects
https://youtu.be/swIM2z6Foxk

️Setup️
Multiplay
ᐅcom.unity.services.multiplay
Matchmaker
ᐅcom.unity.multiplayer.tools
Multiplay start parameters
ᐅ-ip ip -port port -queryport query_port -logFile log_dir/Engine.log -dedicatedServer -batchmode -nographics

If the client ticket times out, make sure you are connected to Unity Services in the Editor (Project Settings ᐅ Services). Sometimes the connection is lost and you have to click /"Retry Connection/".

Video links
Unity Multiplay documentation
ᐅhttps://docs.unity.com/game-server-hosting/en/manual/welcome
Unity Matchmaker documentation
ᐅhttps://docs.unity.com/matchmaker/nl/manual/matchmaker-overview
Game Engine Best Practices (includes the TargetFPS script)
ᐅhttps://docs.unity.com/game-server-hosting/en/manual/guides/game-engine-best-practices
Your Unity dashboard
ᐅhttps://dashboard.unity3d.com/
Multiplay start parameters
ᐅhttps://docs.unity.com/game-server-hosting/en/manual/concepts/launch-parameters
Unity command line arguments
ᐅhttps://docs.unity3d.com/Manual/EditorCommandLineArguments.html
Matchplay: an example of Matchmaker and Multiplay
ᐅhttps://github.com/Unity-Technologies/com.unity.services.samples.matchplay

In this video I'll explain how to upload your multiplayer game build to Unity Gaming Services (UGS) Multiplay, which will act as a scalable dedicated hosting platform with minimal setup. Next, we'll discuss Matchmaker, a way to easily connect players and organize a match.

Before uploading to UGS Matchplay, we need to create a Dedicated Linux Server build of our game in Unity. To do this, we create a script to read the command line arguments passed to the game and determine if the build is the server. It is also recommended to set the target frame rate and disable v-sync.

In UGS we will then create a build, a build configuration with our starting parameters, a fleet that will determine where our server will run, and then test it with a test assignment. We also use Matchmaker within our project. Then back to Unity, we write some basic code to connect our game to UnityGamingServices via the IP address passed in the port, and then find a matchmaker assignment that spins up a server. We also enable replenishment to support players who join the match after it has started. On the client side, we write a separate script where the client logs in anonymously, enables UnityGamingServices, and then attempts to fill out their matchmaking ticket to be assigned to the match. At the end of the video we also fix some bugs that become apparent when hosting the game on the UGS dedicated server platform.

Support me
Patreon: https://www.patreon.com/samyg
Donate: https://ko-fi.com/samyam

️Timestamps️
0:00 Introduction
1:12 Game showcase
2:47 Multiplay Terms
6:14 Setting up build for multiplayer
31:30 Set up matchmaker
45:29 Matchmaker server script
1:24:56 Matchmaker client script
1:46:19 Replace UGS build
1:48:57 Bug fixing
1:55:42 Outro

THANK YOU TO ALL MY PATRONS

❯❯❯ My links ❮❮❮
Patreon
https://www.patreon.com/samyg
Discord server
https://discord.gg/SwCKB3Q
Tweet
https://twitter.com/samyam_youtube
Facebook
https://www.facebook.com/samyam.youtube/
Like and subscribe!

️Computer settings️
*As an Amazon Associate I earn from qualifying purchases.
https://www.amazon.com/shop/samyam

Gameplay videos shown:
ᐅ10 Brand new multiplayer games that try something new
https://www.youtube.com/watch?vmfcOf3Bc108
ᐅ15 great co-op games to play with your friends
https://www.youtube.com/watch?v3OSY0iWV53s&t1s
ᐅMario Kart 8 Deluxe – All New DLC Courses (DLC Booster Pack 1) (4K)
https://www.youtube.com/watch?vJ0xw8S5PpCg

#unity3d
#gamedeveloper
#multiplayer

Please take the opportunity to connect and share this video with your friends and family if you find it helpful.