FlexMatch backfill rejoining

I’m getting an undesired behavior with matchmaking when a player leaves a match and tries to rejoin. If a player is matched on a server and then leaves (or never joins/times out) then the matchmaker autobackfill will never place that player back in the match. Instead it will place the player on a new server/game session.

I can see how this might be desired behavior in some cases but it’s not the behavior I would like. I expect players to at least be able to retry if a join fails (speaking of which, join time out seems excessively short).

What can I do to accomplish this behavior?

Player session timeout should be 60s from the time of player session creation, even with FlexMatch delays I would expect you to be getting 45-50s per ticket to connect a player in. I know there is a GameLift backlog item to configure the timeout values for player session life.

As to the FlexMatch issue, unfortunately, there are some limitations in the current auto-backfil hooks. GameLift will find players for your game session; if it starts with players missing, then it will autobackfil if enabled. If players subsequently leave/disconnect, the current implementation will not submit an auto-backfil ticket on your behalf. You will have to manually submit a backfil request here.

You may need to manage the matchmaking data manually and not rely on auto-backfill to enable customization of what happens to players that disconnect ie:

  • Player connects - AcceptPlayerSession
  • Player disconnects - start a ‘disconnection timer’ on server
  • Either Player reconnects into existing player session and matchmaking data is not updated
  • Or player fails to re-connect in time - RemovePlayerSession on server, update matchmaking data and call MatchbackfillRequest. Player has to make a new matchmaking request

Or something similar, will need to handle edge cases for player of game session ending etc.

Thanks Pip, that makes sense.

I don’t think that would entirely address the issue I see now. Here’s an example flow:

  1. Player starts matching
  2. Player matches into a server and starts a game session with <MaxPlayers; autobackfill enables
  3. a) Player connects; Player then disconnects; Server calls RemovePlayerSession
    OR
    b) Player fails to connect and gets flagged as timed-out
  4. Player tries to match again
  5. Player matches into a new server / fails to backfill into previous match

At this point other players who were not previously in the game session can and will successfully backfill the game session.

I could cache the player’s previous server/session info and try manually reconnecting the player to the last known server but this feels a bit hacky. Now the client needs to manage logic for retrying a previous session and properly handling edge cases for when the server is unavailable.

Hey @ig_tyler, I believe one way to ensure that a player joins back to the match he/she just left is to keep track of existing player sessions in an external database like DynamoDb for example. When, player sessions are made, you can write an item to a table in DynamoDb. And when the game session for that player session is over, you can remove the item from that same table. This way, as long as information about a player’s existing active player sessions and game sessions exists for a specific client, then that client should be able to retrieve that info and use it to reconnect to a game session that he/she left.

Hope that made sense! :smiley:

@chrisgong Thanks; I’ll try out that approach.