Turning off automatic backfill near end of game session (FlexMatch matchmaking)
Hi, I have enabled "automatic backfill" in my matchmaking configuration per the instructions in the docs: "Turn on automatic backfill" section of https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-backfill.html. The backfilling itself works well. Calls from my client service to "StartMatchmaking" will, when expected, return a match to an existing game session. The problem I'm trying to solve now is that I don't want players to be backfilled into a game that's almost over. Item #4--"Turn off automatic backfill for a game session"--doesn't seem to work when I try to implement it on my game server:
4. Turn off automatic backfill for a game session. You can opt to stop automatic backfill at any point during an individual game session. To stop automatic backfill, add code to your game client or game server to make the GameLift API call StopMatchmaking. This call requires a ticket ID. Use the backfill ticket ID from the latest backfill request. You can get this information from the game session matchmaking data, which is updated as described in the previous step.
What confuses me here is that I want to stop backfilling near the end of the game regardless of whether the game session has backfilled any players yet. The line "Use the backfill ticket ID from the latest backfill request" doesn't make sense if no backfill tickets have been received in the game session.
Intuitively, it feels like there should just be some API I can call that opts a particular game session out of future backfill requests but I'm not seeing it.
Any help would be greatly appreciated.
So for automatic backfill, unless things have changed since I last experimented with it, when a match is made, if there is still player capacity, one backfill ticket will be created automatically that lasts either until the end of the game session or until the backfill request gets fulfilled/expires. But afaik, your server won't get the backfill ticket id directly. Technically, whatever's subscribed to the SNS topic that receives FlexMatch event notifications will get information about the backfill ticket but since you want to stop backfill conditionally, it would probably be easier to do manual backfill in order to call StopMatchBackfill with a matchmaking request ticket id. In this case, that ticket id would be returned from a call to StartMatchBackfill. Hopefully, someone from AWS can shed some more light on this topic but what I remember is that automatic backfill is somewhat limited.
Hey, so for stopping backfill in this situation, I believe that it would be better handled by the server through the server SDK, not the client service. Yes, you can call
StopMatchmaking from the client/client service while passing the backfill ticket id but since you want the server logic controlling when backfill stops (in this case when the game is almost over), I would recommend taking a look at either calling StopMatchBackfill in the gamelift server SDK or calling StopMatchmaking in the AWS SDK from the server.
Backfill requests are basically like regular matchmaking requests. In the case you specified, you would have to make a new backfill request (after canceling the current backfill request) to account for that player leaving because the existing backfill request won't automatically adjust to that since the matchmaking is independent of the game server/player logic. If you don't make a new backfill request, then the old one is going to continue to be processed by flexmatch and gamelift will keep trying to backfill the original 6 players.
FlexMatch large match backfill not workingAccepted Answerasked 2 years ago
GameLift FlexMatch Matchmaking Configuration WITH_QUEUE placement timeoutasked 2 months ago
Better understanding how automatic backfill worksAccepted Answer
Turning off automatic backfill near end of game session (FlexMatch matchmaking)Accepted Answerasked 3 months ago
Matchmaking issueasked 3 years ago
Flexmatch - Filling a session to full in backfill whilst in Standalone modeAccepted Answerasked 4 months ago
OnUpdateGameSession handler function is not invoked when a backfill request is cancelled due to duplicate player ids
Matchmaking event of type MatchmakingSucceeded did not contain player session ids of new incoming playersAccepted Answer
Backfill argument not working in cliasked 3 years ago
About automatic backfillasked a year ago