Documentation

Support

Matchmaker

Matchmaker

Party matchmaking

Enable multiple players to request matching together as a group.
Read time 1 minuteLast updated 2 days ago

Matchmaker supports party matchmaking where a group of players can request to be matched together in a game. A matchmaking ticket can contain multiple players. The Matchmaker places all players from one ticket onto the same team. The maximum party size is 20 players per ticket. The following code sample shows how to create party matchmaking:
{ "queueName": "4vs4", "attributes": {}, "players": [ { "id": "6cc5ac8d-dfab-4b50-9ede-c1d026d8dc81", "customData": { "Hero": "tank" }, "qosResults": [ { "regionId": "75721794-e9fd-4d8a-9879-aa853ed18885", "packetLoss": 0.8, "latency": 50 }, { "regionId": "1e29bd54-8acc-433a-ae7d-28ae5fc192a1", "packetLoss": 0.5, "latency": 20 } ] }, { "id": "ac35c771-291c-4e7e-9a0e-6351faf261c6", "customData": { "Hero": "support" }, "qosResults": [ { "regionId": "75721794-e9fd-4d8a-9879-aa853ed18885", "packetLoss": 0.2 "latency": 75 }, { "regionId": "1e29bd54-8acc-433a-ae7d-28ae5fc192a1", "packetLoss": 0.5, "latency": 10 } ] }, ]}
Ticket containing two players with each their custom data

Unity SDK

var player1 = new Player( "6cc5ac8d-dfab-4b50-9ede-c1d026d8dc81", new Dictionary<string, object> { {"hero", "tank"} }, new List<QoSResult> { new QoSResult("75721794-e9fd-4d8a-9879-aa853ed18885",0.8, 50), new QoSResult("1e29bd54-8acc-433a-ae7d-28ae5fc192a1",0.5, 20) });var player2 = new Player( "ac35c771-291c-4e7e-9a0e-6351faf261c6", new Dictionary<string, object> { {"hero", "support"} }, new List<QoSResult> { new QoSResult("75721794-e9fd-4d8a-9879-aa853ed18885",0.2, 75), new QoSResult("1e29bd54-8acc-433a-ae7d-28ae5fc192a1",0.5, 10) });var players = new List<Player>{ player1, player2};// Set options for matchmakingvar options = new CreateTicketOptions( "Default" // The name of the queue defined in the previous step, new Dictionary<string, object>());// Create ticketvar ticketResponse = await MatchmakerService.Instance.CreateTicketAsync(players, options);// Print the created ticket idDebug.Log(ticketResponse.Id);
Party ticket creation with Unity SDK

Using Unity Lobby

Sharing player data like Quality of Service results with the party leader can be difficult. To simplify sharing data, it is possible to use the Unity Lobby service. Players store the data that is be added on the ticket by the party leader. The party leader is responsible for creating the matchmaking ticket on behalf of the party. Once the ticket is matched, the party leader can save the information about the server allocation in the Lobby data, and players can use them to connect the match.