question

contact-18 avatar image
contact-18 asked

Unreal - Create Matchmaking Ticket for a Group

Hi guys, I have a question about create-matchmaking-ticket:

https://learn.microsoft.com/en-us/rest/api/playfab/multiplayer/matchmaking/create-matchmaking-ticket?view=playfab-rest#entitykey

Generally everything works as it should, players are matched and connected to a server. (When Create matchmaking is called by each player individually. ) I'm trying to register several players at the same time in matchmaking. e.g. a group of 2 players. (which are on a list server.) My Rquest looks like this:

 [2023.01.23-18.03.12:276][835]LogPlayFab: Request: {
     "Creator":
     {
         "Attributes":
         {
             "DataObject":
             {
                 "Latencies": [
                     {
                         "region": "NorthEurope",
                         "latency": "50"
                     }
                 ]
             }
         },
         "Entity":
         {
             "Id": "UserIDPlayer1",
             "Type": "title_player_account",
             "TypeString": "title_player_account"
         }
     },
     "GiveUpAfterSeconds": 120,
     "MembersToMatchWith": [
         {
             "Id": "UserIDPlayer2",
             "Type": "title_player_account"
         }
     ],
     "QueueName": "Survival"
 }

The matchmaking queue is configured to need at least 2 players.

As a response I always get Waiting for Players

 [2023.01.23-18.03.22:885][220]LogPlayFab: Response : {"code":200,"status":"OK","data":{"TicketId":"aab0aeda-ff91-4c7c-b480-b1fa63adc0fc","QueueName":"Survival","Created":"2023-01-23T18:03:13Z","Status":"WaitingForPlayers","GiveUpAfterSeconds":120,"MembersToMatchWith":[{"Id":"UserIDPlayer2","Type":"title_player_account","TypeString":"title_player_account"}],"Members":[{"Entity":{"Id":"UserIDPlayer1","Type":"title_player_account","TypeString":"title_player_account"},"Attributes":{"DataObject":{"Latencies":[{"region":"NorthEurope","latency":"50"}]}}}],"Creator":{"Id":"UserIDPlayer1","Type":"title_player_account","TypeString":"title_player_account"},"ChangeNumber":10}}

I would have expected a match to happen automatically. Since we are already talking about two players here.

unrealMatchmaking
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

contact-18 avatar image contact-18 commented ·

ok i guess by now that every group member has to call CreateMatchmakingTicket and MembersToMatchWith is then used by the matchmaking system internally to assign the players to the same ticket.

0 Likes 0 ·
Simon Cui avatar image
Simon Cui answered

For multiple user in a group to matchmake, you can refer to Matchmaking quickstart - PlayFab | Microsoft Learn. Only the “group leader” needs to create a Matchmaking Ticket and add the identities of the other group members into MembersToMatchWith. After shared TicketId with the other group members and each members has joined the ticket by calling JoinMatchmakingTicket, the ticket status will become WaitingForMatch.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

contact-18 avatar image
contact-18 answered

So in the meantime I have the following setup: Client A and Client B enter each other in the MembersToMatchWith list. Both clients then call a CreateMatchmakingTicket. A ticket is created for each client and the tickets have the status Waiting for Match. Which all looks correct at first.

Then on client C and D CreateMatchmakingTicket are called. These clients create tickets with MembersToMatchWith =null. This also looks correct to me.

But only client C and D are matched and connected to a Playfab server. Client A and B remain forever in the Waiting for Match state. (here also GiveUpAfterSeconds : 120 is not called).

Client A

 [2023.01.23-21.26.55:859][100]LogPlayFab: Request: {
     "Creator":
     {
         "Attributes":
         {
             "DataObject":
             {
                 "Latencies": [
                     {
                         "region": "NorthEurope",
                         "latency": "50"
                     }
                 ]
             }
         },
         "Entity":
         {
             "Id": "ClientAId",
             "Type": "title_player_account",
             "TypeString": "title_player_account"
         }
     },
     "GiveUpAfterSeconds": 120,
     "MembersToMatchWith": [
         {
             "Id": "ClientBId",
             "Type": "title_player_account"
         }
     ],
     "QueueName": "Survival"
 }
 [2023.01.23-21.26.56:172][112]LogPlayFab: Response : {"code":200,"status":"OK","data":{"TicketId":"f4a7cca0-80cf-4292-912f-5bbdaa48b938"}}
 [2023.01.23-21.27.06:163][498]LogBlueprintUserMessages: [GI_MP_Steam_C_2147482487] PFGetMatchmakingTicket Waiting for Match
 [2023.01.23-21.27.06:163][498]LogPlayFab: Request: {
     "EscapeObject": false,
     "QueueName": "Survival",
     "TicketId": "f4a7cca0-80cf-4292-912f-5bbdaa48b938"
 }
 [2023.01.23-21.27.06:465][510]LogPlayFab: Response : {"code":200,"status":"OK","data":{"TicketId":"f4a7cca0-80cf-4292-912f-5bbdaa48b938","QueueName":"Survival","Created":"2023-01-23T21:26:56Z","Status":"WaitingForPlayers","GiveUpAfterSeconds":120,"MembersToMatchWith":[{"Id":"ClientBId","Type":"title_player_account","TypeString":"title_player_account"}],"Members":[{"Entity":{"Id":"ClientAId","Type":"title_player_account","TypeString":"title_player_account"},"Attributes":{"DataObject":{"Latencies":[{"region":"NorthEurope","latency":"50"}]}}}],"Creator":{"Id":"ClientAId","Type":"title_player_account","TypeString":"title_player_account"},"ChangeNumber":10}}

Client B:

 [2023.01.23-21.26.55:872][984]LogPlayFab: Request: {
     "Creator":
     {
         "Attributes":
         {
             "DataObject":
             {
                 "Latencies": [
                     {
                         "region": "NorthEurope",
                         "latency": "50"
                     }
                 ]
             }
         },
         "Entity":
         {
             "Id": "ClientBId",
             "Type": "title_player_account",
             "TypeString": "title_player_account"
         }
     },
     "GiveUpAfterSeconds": 120,
     "MembersToMatchWith": [
         {
             "Id": "ClientAId",
             "Type": "title_player_account"
         }
     ],
     "QueueName": "Survival"
 }
 [2023.01.23-21.26.56:840][ 23]LogPlayFab: Response : {"code":200,"status":"OK","data":{"TicketId":"bf379520-6899-4197-a4a9-444c56e8d39b"}}
 [2023.01.23-21.27.06:837][422]LogBlueprintUserMessages: [GI_MP_Steam_C_2147482487] PFGetMatchmakingTicket Waiting for Match
 [2023.01.23-21.27.06:838][422]LogPlayFab: Request: {
     "EscapeObject": false,
     "QueueName": "Survival",
     "TicketId": "bf379520-6899-4197-a4a9-444c56e8d39b"
 }
 [2023.01.23-21.27.07:143][434]LogPlayFab: Response : {"code":200,"status":"OK","data":{"TicketId":"bf379520-6899-4197-a4a9-444c56e8d39b","QueueName":"Survival","Created":"2023-01-23T21:26:57Z","Status":"WaitingForPlayers","GiveUpAfterSeconds":120,"MembersToMatchWith":[{"Id":"ClientAId","Type":"title_player_account","TypeString":"title_player_account"}],"Members":[{"Entity":{"Id":"ClientBId","Type":"title_player_account","TypeString":"title_player_account"},"Attributes":{"DataObject":{"Latencies":[{"region":"NorthEurope","latency":"50"}]}}}],"Creator":{"Id":"ClientBId","Type":"title_player_account","TypeString":"title_player_account"},"ChangeNumber":10}}

Client C

 [2023.01.23-21.40.23:804][425]LogPlayFab: Request: {
     "Creator":
     {
         "Attributes":
         {
             "DataObject":
             {
                 "Latencies": [
                     {
                         "region": "NorthEurope",
                         "latency": "50"
                     }
                 ]
             }
         },
         "Entity":
         {
             "Id": "ClientCId",
             "Type": "title_player_account",
             "TypeString": "title_player_account"
         }
     },
     "GiveUpAfterSeconds": 120,
     "MembersToMatchWith": null,
     "QueueName": "Survival"
 }
 [2023.01.23-21.40.24:144][433]LogPlayFab: Response : {"code":200,"status":"OK","data":{"TicketId":"44157e1b-3e7f-42cf-b557-9ae5ccd0530a"}}
 [2023.01.23-21.40.37:706][685]LogBlueprintUserMessages: [GI_MP_Steam_C_2147482487] PFGetMatchmakingTicket Waiting for Match
 [2023.01.23-21.40.37:707][685]LogPlayFab: Request: {
     "EscapeObject": false,
     "QueueName": "Survival",
     "TicketId": "44157e1b-3e7f-42cf-b557-9ae5ccd0530a"
 }
 [2023.01.23-21.40.38:038][687]LogPlayFab: Response : {"code":200,"status":"OK","data":{"TicketId":"44157e1b-3e7f-42cf-b557-9ae5ccd0530a","QueueName":"Survival","Created":"2023-01-23T21:40:24Z","Status":"WaitingForMatch","GiveUpAfterSeconds":120,"Members":[{"Entity":{"Id":"ClientCId","Type":"title_player_account","TypeString":"title_player_account"},"Attributes":{"DataObject":{"Latencies":[{"region":"NorthEurope","latency":"50"}]}}}],"Creator":{"Id":"ClientCId","Type":"title_player_account","TypeString":"title_player_account"},"ChangeNumber":20}}

Client D

 [2023.01.23-21.36.23:320][705]LogPlayFab: Request: {
     "Creator":
     {
         "Attributes":
         {
             "DataObject":
             {
                 "Latencies": [
                     {
                         "region": "NorthEurope",
                         "latency": "50"
                     }
                 ]
             }
         },
         "Entity":
         {
             "Id": "ClientDId",
             "Type": "title_player_account",
             "TypeString": "title_player_account"
         }
     },
     "GiveUpAfterSeconds": 120,
     "MembersToMatchWith": null,
     "QueueName": "Survival"
 }
 [2023.01.23-21.36.23:624][722]LogPlayFab: Response : {"code":200,"status":"OK","data":{"TicketId":"558d77c0-daab-4b22-9d91-3b0ec090b326"}}
 [2023.01.23-21.36.38:136][ 76]LogBlueprintUserMessages: [GI_MP_Steam_C_2147482487] PFGetMatchmakingTicket Waiting for Match
 [2023.01.23-21.36.38:136][ 76]LogPlayFab: Request: {
     "EscapeObject": false,
     "QueueName": "Survival",
     "TicketId": "558d77c0-daab-4b22-9d91-3b0ec090b326"
 }
 [2023.01.23-21.36.38:411][ 88]LogPlayFab: Response : {"code":200,"status":"OK","data":{"TicketId":"558d77c0-daab-4b22-9d91-3b0ec090b326","QueueName":"Survival","Created":"2023-01-23T21:36:24Z","Status":"WaitingForMatch","GiveUpAfterSeconds":120,"Members":[{"Entity":{"Id":"ClientDId","Type":"title_player_account","TypeString":"title_player_account"},"Attributes":{"DataObject":{"Latencies":[{"region":"NorthEurope","latency":"50"}]}}}],"Creator":{"Id":"ClientDId","Type":"title_player_account","TypeString":"title_player_account"},"ChangeNumber":20}}
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Simon Cui avatar image Simon Cui commented ·

In your scenario, if a group of 2 players such as Client A and Client B wants to play with other group teams, then only Client A (supposing Client A is the “leader” of this group) needs to create a Matchmaking Ticket and add the identities of the Client B into MembersToMatchWith. After it, Client B needs to call JoinMatchmakingTicket to join the ticket that Client A just created. If Client A has joined this ticket, the status of ticket will become WaitingForMatch.

Please refer to the documentation link that I mentioned before, as shown in this screenshot too: 5430-groupmatchmake.png

As I can see from your codes of Client A and Client B, the ticket status is WaitingForPlayers, which means the MembersToMatchWith have not joined the ticket.

0 Likes 0 ·
groupmatchmake.png (47.7 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.