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!
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 on your game's portal, click Multiplayer.
- On the Matches panel, click to 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 is 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.