question

bsmith avatar image
bsmith asked

Single Player Matchmaking

Hello,

I am working on a prototype game that requires a single-player server allocation. At the moment I noticed that matchmaking queues must have a minimum of 2 players in order for a game server allocation can occur.

I already looked at Backfill tickets prior related with a post ( https://community.playfab.com/questions/52310/matchmaking-for-single-player.html ), and found that the Backfill tickets are primarily meant for game servers; which leaves me in a dilemma, how does a game server send this to PlayFab and notify PlayFab of how many players that this server has when the game server doesn't exist in the first place.

I would like to have a simple self-contained way for PlayFab's services to allocate a game server when someone enters a matchmaking queue, and additional players can join at a later time while the player is connected.

Thanks

multiplayerMatchmaking
10 |1200

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

Gosen Gao avatar image
Gosen Gao answered

You can call API RequestMultiplayerServer for the first player to start the server. After the API RequestMultiplayerServer returned successfully, you can obtain the server details in its response. With the server detail you get, you could call API CreateServerBackfillTicket to search for other players, so that the matched players can get the corresponding IP address and Port in the response of GetMatch.

5 comments
10 |1200

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

bsmith avatar image bsmith commented ·

So at the moment I'm still at step 1, RequestMultiplayerServer.

I'm currently getting this:

{'code': 429, 'status': 'TooManyRequests', 'retryAfterSeconds': 1, 'error': 'MultiplayerServerTooManyRequests', 'errorCode': 1380, 'errorMessage': "MultiplayerServerTooManyRequests - NoHostsAvailableInRegion - No Hosts available in regions 'EastUs', please retry."}

My Input Request Body:

{'SessionId': '4d5be23d-8850-4c63-a2a7-956ac65503a9', 'PreferredRegions': ['EastUs'], 'BuildId': '57cd1c2b-66a1-40cd-9e0f-b4600a86f58d'}

I'm generating the SessionId myself, and the BuildId comes from PlayFab.

I set my Regions like:

I do not want Standby Servers when there's no players, and I want them to allocate when players are RequestMultiplayerServer.


Thanks!

0 Likes 0 ·
bkjdc.png (15.8 KiB)
bsmith avatar image bsmith bsmith commented ·

Nevermind, it was a gotcha; `EastUs` vs `East Us`; weird that it doesn't follow the other REST API body requests.

0 Likes 0 ·
bsmith avatar image bsmith bsmith commented ·

Scratch my "fix."

0 Likes 0 ·
bsmith avatar image bsmith bsmith commented ·

Further research on the problem here (also help from GameStack Discord),

the error is caused because there is no available virtual machine to place a new multiplayer server upon. Which is unfortunate that PlayFab is unable to request for a new multiplayer server, EVEN IF it doesn't have room at the moment via standby servers, instead the behavior that was expected was:

1. Request a Multiplayer Server.

2. PlayFab checks for available standby servers, and there's none.

2.a. PlayFab checks if it can create another Virtual machine in the region (checks if the current active/standby doesn't exceed the Maximum in the region)

3. If there's room for a new Virtual Machine in the region, create one; and we as a client can wait (we are queuing for a reason, and waiting a minute or two that's fine).

4. Start a Multiplayer Server.

5. Client joins Multiplayer Server.

6. Multiplayer Server is accepting Matchmaking clients, EVEN while Active.

0 Likes 0 ·
bsmith avatar image bsmith bsmith commented ·

(Extended Message)

So there's two issues that I am facing:

1. Virtual Machines aren't being created with RequestMultiplayerServer

2. As a client I cannot connect to Active Multiplayer Servers that aren't filled up yet via CreateServerBackfillTicket, because Server Backfill Tickets aren't available for clients, and only available for admin access. And CreateMatchmakingTicket doesn't look for active game servers that have enough room for player(s) to join.

0 Likes 0 ·
Gosen Gao avatar image
Gosen Gao answered

>>Virtual Machines aren't being created with RequestMultiplayerServer

API RuquestMultiplayerServer doesn’t work like that. In the Lifecycle of a multiplayer server build region, API RuquestMultiplayerServer plays a role who will check for standby servers, and turn the server from standby to active, then return the server detail. If there are no standby servers, it will return an error. So we suggest you set at least 1 target standby server before calling the API RequestMultiplayerServer to avoid standby pool starvation. To learn about how to scale the standby servers in your need, please check the documentation -- https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/scaling-standby.

>> As a client I cannot connect to Active Multiplayer Servers that aren't filled up yet via CreateServerBackfillTicket, because Server Backfill Tickets aren't available for clients, and only available for admin access. And CreateMatchmakingTicket doesn't look for active game servers that have enough room for player(s) to join.

CreateServerBackfillTicket should be called on the server-side. For your case, you can call the API CreateServerBackfillTicket on the requested server directly. The server can fill its own server details into the API request. Please check the documentation -- https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/matchmaking/backfill-tickets to learn more about the server backfill tickets. This API will create a backfill matchmaking ticker as a server. A backfill tacker represents an ongoing game. The matchmaking service automatically starts matching the backfill ticket against other matchmaking 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.