Search Unity

Empower great multiplayer experiences with Relay and Lobby

November 22, 2021 in Games | 5 min. read
Cloaked character with spear
Cloaked character with spear

Is this article helpful for you?

Thank you for your feedback!

Introducing our brand new multiplayer connection services, Relay and Lobby, plus a fresh sample project to learn hands-on with these services. 

From LAN parties in the mid-1990s, to MMOs with players spanning the globe in the 2020s, it’s clear that the world of multiplayer gaming has grown and changed drastically over the last few decades. And with it, the needs of developers must adapt in order to meet new player expectations. 

That’s why we’re expanding our multiplayer technology stack, in order to update it with the latest tech developers need to deliver great multiplayer experiences to their gamers. 

Our new Multiplayer Services stack covers three key areas: 

  • Creation of the foundation for your multiplayer game 
  • Connection of your players
  • And empowering player communication

For this blog, let's explore how our Connection pillar is growing with our latest tools to help studios of all sizes enable peer-to-peer multiplayer experiences: Relay and Lobby.

Introducing Relay(Beta) and Lobby(Beta)

What is Relay?

The Relayᴮᴱᵀᴬ service allows you to connect your players and provide great multiplayer gaming experiences without the need for a dedicated game server. Our service leverages Unity Transport to enable easy and secure peer-to-peer communications between players. 

What is Lobby?

Lobbyᴮᴱᵀᴬ allows players to connect in lobbies before or during a game.

Using simple attributes, players create public lobbies for the type of game they want to participate in. Other players then discover and join these lobbies through a quick, customizable search. Invite-only lobbies also allow players to create private lobbies for select participants only.

Level your game up by combining Relay and Lobby 

With their powers combined, Relay and Lobby do their best work to improve your player experience. When used on the same project, they will send service-to-service notifications when a player disconnects from the game and automatically remove players disconnected from Relay. That way you’re not left with any “zombie” players in a lobby. 


Learn hands-on with the Relay and Lobby sample

Getting started with Relay and Lobby might sound tough – but don’t worry! We put together this sample which demonstrates how to use the packages to create a typical multiplayer experience. 

This sample covers: 

  • Anonymous Auth login: Track player credentials without a persistent account.
  • Lobby creation: Players host lobbies for others to join.
  • Lobby query: Find a list of lobbies with filters, or use lobby codes.
  • Relay obfuscation: Players in a lobby are connected through an anonymous IP.
  • UTP communication: Players transmit basic data to lobby members in real time.
  • Lobby + Relay connection management: Together, the services automatically handle new connections and disconnections.
  • Vivox Voice: Create a voice channel for the lobby to allow for communication, with per-user volume control and muting.

This content is hosted by a third party provider that does not allow video views without acceptance of Targeting Cookies. Please set your cookie preferences for Targeting Cookies to yes if you wish to view videos from these providers.

This sample is designed as a vertical slice of a multiplayer lobby, so it has additional infrastructure that might be expected in full game production, as well as some components to allow multiple services to work together. Check out how to install the sample for hands-on learning in this article.

Get started with Relay and Lobby

Ready to start delivering great multiplayer experiences? Then join the Relay and Lobby betas. Plus, check out Netcode for GameObjects for the reliable foundation you need to build your multiplayer game. 

Get involved in the conversation on the Unity Forum and our Multiplayer Services Discord, where you can chat directly with our team, and other developers like you, who are already using this technology for their projects.  

November 22, 2021 in Games | 5 min. read

Is this article helpful for you?

Thank you for your feedback!