By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Multiple Game Session Issue With Setting minPlayers to 1 in FlexMatch

0

Hello,

So I have a matchmaking ruleset that sets the minplayers to 1. When I do this, I noticed that if 2 players try to join a match with no active game sessions in a relatively short amount of time, GameLift will create two separate game sessions, and each player will join a separate game session, and they won't be matched together. However, if the game session is already active, and a player tried to join, they would be matched to that game session. Why does this happen?

Is it because when there are no active game sessions, and two players quickly join, GameLift doesn't yet know who to place, and it creates two sessions? What would be the fix for this?

asked a month ago38 views
1 Answer
0

The behavior you're observing with Amazon GameLift FlexMatch is related to how the matchmaking service processes requests when there are no active game sessions and multiple players attempt to join in quick succession.

When you set minPlayers to 1 in your matchmaking ruleset, you're essentially allowing FlexMatch to create a match as soon as a single player is available. This can lead to the scenario you've described.

Here's what's likely happening:

  1. When there are no active game sessions and two players try to join almost simultaneously, FlexMatch processes these requests independently.

  2. For each player, FlexMatch sees that the minimum player requirement (1) is met, so it proceeds to create a new game session for each player separately.

  3. This results in two separate game sessions being created, with one player in each, instead of matching the players together.

  4. Once a game session is active, subsequent players will be matched to that existing session as you've observed.

This behavior occurs because FlexMatch is designed to create matches as quickly as possible when the minimum requirements are met, and it doesn't have a built-in mechanism to wait for potential additional players when minPlayers is set to 1.

To address this issue, you have a few options:

  1. Increase minPlayers: Set minPlayers to 2 or higher in your ruleset. This will force FlexMatch to wait for at least two players before creating a match.

  2. Implement a waiting period: In your game logic, you could implement a short waiting period before requesting a match. This gives more time for other players to join the queue.

  3. Use FlexMatch's backfill functionality: If your game can start with one player but you want to add more as they become available, you can use FlexMatch's backfill feature to add players to existing game sessions.

  4. Adjust your matchmaking configuration: You might want to tweak other parameters in your FlexMatch configuration to optimize for your specific use case, such as adjusting the maximum time to match or implementing more complex rules.

By implementing one or more of these strategies, you can better control how matches are created and reduce the likelihood of creating multiple single-player game sessions when multiple players are available.
Sources
Adding FlexMatch matchmaking - Amazon GameLift
How Amazon GameLift FlexMatch works - Amazon GameLift
FlexMatch rule set examples - Amazon GameLift

profile picture
answered a month ago
  • Ok, well suppose I set the minPlayers to 2, and 4 players try to simultaneously join a match? Would GameLift create other game sessions for players 3 and 4? My goal is to basically place players in a game session based on a certain criteria.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions