Lobby overview
How it works?
A lobby scene (sometimes known as a main menu) is a space, where the player can authenticate themselves, select a game mode, adjust settings, see some meta-play data like leaderboards or high score, and finally cool down after a match. The default lobby scene supplied by Elympics makes all of this possible by facilitating the communication with Elympics services under the hood.
To provide numerous Web3 features such as preserving the player's identity and allowing to join tournaments, the lobby needs to be integrated with PlayPad SDK.
Functionalities:
- establishing the connection between the client and a server (known as matchmaking, even for solo games) for playing the game using server authoritative architecture
- providing custom match data
- guest and wallet authentication
- rooms-based matchmaking
- smart, machine-learning-based matchmaking
- using regions for best possible client-server connection quality
- unlocking numerous Web3 features
Setup
Every lobby scene needs an ElympicsLobby
prefab instance. The ElympicsLobbyClient
component attached to the ElympicsLobby
game object is responsible for the whole core lobby functionality.
You can add the instance by clicking right mouse button in the Hierarchy and selecting Elympics > ElympicsLobby
.
To handle authentication, AuthenticateOnAwakeWith
should be set to None
when integrated with PlayPad SDK and Client secret
otherwise.
If your game allows for changing authentication at runtime, proper loading mask and input blocking should be used during the re-authentication process.
The Play action
Every game needs a way for the player to start a match. To achieve that, most games utilize play buttons or automatic play initialization when conditions are met.
Note that each game should provide input blocking mask for match loading and also proper error handling pop-up in case of issues.
Multiplayer games
Use ElympicsLobbyClient.Instance.RoomsManager
to manage rooms, where players can meet each other. After members proclaim mutual readiness, the host can start the match with the StartMatchmaking
method.
This solution requires a whole UI structure for listing, creating, joining and modifying rooms.
Great example of a game using this solution is Clash of Orbs.
Singleplayer games
For leaderboard-based games, a play button is enough.
It needs to call ElympicsLobbyClient.Instance.RoomsManager.StartQuickMatch
.
For tournaments, see the next section.
Web3 features
Features like wallet-based authentication or tournaments management require integration with PlayPad SDK.
Using Web3 features also means a little more complex lobby scene, which will be able to handle displaying leaderboards, tournament data and so on.
Fortunately, all that functionality can be easily achieved by importing our AsyncGameSample
and adjusting it to your visual design.
With that, to play the game, play button should call PlayPadCommunicator.Instance.GameStatusCommunicator.PlayGame
on click (if not currently locked, for example by already closed tournament).
Continue with deploying the game
Once the lobby scene is fully set up and PlayPad SDK is integrated, it's time to deploy and test the game online.