Setting Up Real-Time Matchmaking
Setting Up the SDK
Before we begin, you'll need a project with the main GameSparks SDK integrated and set up. The real-time services SDK is bundled in with the Unity SDK:
You can find a tutorial on how to setup the Unity SDK here. Once you've set up the Unity SDK, you are ready to go!
Realtime and Matchmaking Availability? The Realtime and Matchmaking features are no longer available to games created on or after February 19th, 2019, or for games created before February 19th, 2019 that had not yet used these features. If you require Realtime and/or Matchmaking for your game and do not have access under your current plan, please contact us to discuss the Enterprise Pricing Tier.
Setting Up Real-Time Matches
In our real-time services we refer to a multiplayer game-instance as a real-time session. In order to find players for the real-time session, we create a Match. Matches group your players together by a skill-level you choose. In this section, we won't be going through the basics of matchmaking but instead we'll just show how to make our normal Matches work with our real-time services. If you'd like to learn how to set up Matches, you can check out the Matching Players tutorial.
To set up a real-time Match, you follow the same steps as for normal Matches:
- Under Configurator, click Matches.
- On the Matches page, click to Add a new Match.
- Enter the Match details as normal and click to turn the Realtime switch to ON.
- Click to Add a Threshold to the Match. If you don't have at least one Threshold in the Match, when you try to matchmake from the client you will get this error: "matchShortCode: NOT_FOUND"
For this example:
- You have the option to add a Realtime Script to the Match. However, in this example we'll not be covering real-time scripts.
- To suit the real-time 4-player game we'll be building in a subsequent tutorial, we don't want the Match to start until all players have joined the game, so we've set both the Min.Players and the Max.Players to 4.
- We've added a single Threshold for Absolute matching of players with skill level of zero. As we'll see in the later tutorial for Real-Time Matchmaking, we'll assume players for our TANK_BATTLE Match will have skill level zero.
That's all that is needed to setup a real-time Match in GameSparks!
In the next tutorial, we'll see how we can create these Matches in the client and get players to connect to the Match before we create a real-time session.