question

Danielle Eliav avatar image
Danielle Eliav asked

Match 2-4 players together

I want players to be able to play together using a game code. I plan to use a string equality rule to match players with the same game code. My issue is I'm unclear on how Playfab's matchmaking can be used to match more than two players. I don't know how many friends will be playing together, so I need it to keep matching until it reaches the maximum (4) or the players decide to start the game. Can players join an existing match?

Ideally, players will be able to see the matches as they match. For instance, if player 1 and player 2 matched they would see each other in a lobby and would both see player 3 when he matches and joins.

Is this possible?

I'm using Playfab's multiplayer servers and matchmaking and the game is being built in Unity.

Thank you

Matchmaking
10 |1200

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

1 Answer

·
Seth Du avatar image
Seth Du answered

Yes, it is possible.

You may configure the match size of the queue with Min as 2 and Max as 4. It is possible that the ticket is matched with 2-4 players. Meanwhile, if you enable the server auto allocation, a server instance will be initialized and those matched players can connect to the server.

The key idea is after those players are connected to the server, and if the count is less than 4, server can keep creating backfill ticket via API CreateServerBackfillTicket until the player number reaches the maximum. In addition, you may also add logic on server build, which allows players to start the game immediately.

Please also refer to the documentation: https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/matchmaking/backfill-tickets

10 |1200

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

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.