@samyam
  @samyam
samyam | How to Setup Dedicated Server Hosting and Matchmaking for Unity @samyam | Uploaded May 2023 | Updated October 2024, 54 minutes ago.
Lean how to use Unity's UGS tools to host a dedicated game server and implement matchmaking.

ᐅGet the full Source Code Bundle to my Unity Tutorials 🤓
sam-yam.itch.io/samyam-full-source-code-to-all-videos

📥Get the Source Code📥
patreon.com/posts/82134830

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

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

►Check out the Previous Video
The Ultimate Multiplayer Tutorial for Unity - Netcode for GameObjects
youtu.be/swIM2z6Foxk

⚙️ Set Up ⚙️
►Multiplay
ᐅcom.unity.services.multiplay
►Matchmaker
ᐅcom.unity.multiplayer.tools
►Multiplay Launch 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 it disconnects you and you need to click "Retry Connection".

🔗Video Links 🔗
►Unity Multiplay Documentation
docs.unity.com/game-server-hosting/en/manual/welcome
►Unity Matchmaker Documentation
docs.unity.com/matchmaker/en/manual/matchmaker-overview
►Game Engine Best Practices (Contains the TargetFPS Script)
docs.unity.com/game-server-hosting/en/manual/guides/game-engine-best-practices
►Your Unity Dashboard
dashboard.unity3d.com
►Multiplay Launch Parameters
docs.unity.com/game-server-hosting/en/manual/concepts/launch-parameters
►Unity Command Line Arguments
docs.unity3d.com/Manual/EditorCommandLineArguments.html
►Matchplay: A Matchmaker and Multiplay sample
github.com/Unity-Technologies/com.unity.services.samples.matchplay

In this video I cover 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 needed. Then we will go over Matchmaker, a way to easily connect players together and host a match.

Before uploading to UGS Matchplay, we need to create a Dedicated Linux Server build of our game in Unity. For 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 config with our launch parameters, a fleet which will determine where our server will run, and then test it with a test allocation. We also enable Matchmaker within our project. Then back to Unity, we write some boilerplate code to connect our game to UnityGamingServices using the ip and passed in port, then find a matchmaker allocation which spins up a server. We also enable backfill to support players joining the match after it has started. On the client side we write a separate script where the client is signed in anonymously, enables UnityGamingServices, then tries to fill 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: patreon.com/samyg
Donate: ko-fi.com/samyam

►⏱️ Timestamps ⏱️
0:00 Intro
1:12 Game Showcase
2:47 Multiplay Terms
6:14 Set Up Build for Multiplay
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 💗
patreon.com/samyg
💬 Discord Server 💬
discord.gg/SwCKB3Q
🐦 Twitter 🐦
twitter.com/samyam_youtube
📚 Facebook 📚
facebook.com/samyam.youtube
👍 Like and Subscribe! 👍

🖥️ Computer Setup 🖥️
*As an Amazon Associate I earn from qualifying purchases.
amazon.com/shop/samyam

►Gameplay Videos Shown:
ᐅ10 Brand NEW Multiplayer Games Trying Something NEW
youtube.com/watch?v=mfcOf3Bc108
ᐅ15 Great Couch Co-Op Games to Play w/ Your Friends
youtube.com/watch?v=3OSY0iWV53s&t=1s
ᐅMario Kart 8 Deluxe - All New DLC Courses (DLC Booster Pack 1) (4K)
youtube.com/watch?v=J0xw8S5PpCg

#unity3d
#gamedev
#multiplayer
How to Setup Dedicated Server Hosting and Matchmaking for UnityMake Line Rider in Unity Pt.3 - Erasing the LinesWelcome to my Game Dev Channel!I Made a Search Engine for AI Generated TexturesWhy You Should Use The New Input System In Unity + OverviewTop Down Shooter Controller with Input System - Unity TutorialSalvaging a Superhero Game | 6 Devs Pass the Project Challenge in UnityHobbyist game dev answers your questions(+ face reveal)! - Patron Q&A GoalEasy Drag and Drop with Input System 2D | 3D - Unity Tutorialanother engine #gamedev #indiegameController and Keyboard Menu Navigation w/ Input System - Unity TutorialHow to use the Input Debugger for the Input System - Unity Tutorial

How to Setup Dedicated Server Hosting and Matchmaking for Unity @samyam

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER