Skip to main content

Opt in and out of joining in-progress games

Last updated on October 24, 2024

Overview

By default, when a player or party creates a matchmaking ticket, that ticket can either be matched with other players to create a new game, or matched into an existing, in-progress game (or "backfill").

Some players may not want to join a game in the middle of a match, so AccelByte Gaming Services (AGS) Matchmaking gives you the ability to opt players out of joining matches that are in progress. This article provides information on how to implement this feature.

Prerequisites

To complete the steps in this article, you will need an understanding of:

Considerations for using this feature

While some players may prefer to not join in-progress games, there are some things you should consider before relying on this feature.

The most prevalent is the potential lack of players willing to join in-progress game sessions. If too many players opt out of matching into in-progress games, in-progress games will struggle to find new players to fill it with, resulting in those games feeling less balanced or exciting. Here are some things you can do to avoid this problem:

  • To make the in-progress games more fun for new players, don’t create tickets for in-progress games that are almost over. This reduces the likelihood that players will want to opt out of joining in-progress games.
  • Avoid giving players an easily-accessible way to manually opt out of joining in-progress games. Instead, consider opting out on their behalf based on some trigger, such as after they have been matched into a certain number of in-progress games in a row or over a period of time.

Another suboptimal scenario for players opting out of in-progress games is when players attempt to play the game during periods when the playerbase is lower, such as during unpopular play times, at which it could be difficult for players to find a match that isn't already in progress.

One final thing to keep in mind is that this feature considers an in-progress game to be any game that has been successfully created by AGS Matchmaking. This may include games that have not yet started from a player standpoint, including when using the auto-backfill feature.

Implement opting in and out of joining games in progress

Follow the steps in these sections to implement this feature.

Matchmaking process

The matchmaking process varies in the following scenarios:

By default, a player will join an in-progress game session without needing to add the new_session_only attribute. The new_session_only = true attribute only needs to be defined when the player wants to opt out of joining in-progress sessions.

The player has opted out of in-progress games

If a player has opted out of joining in-progress games and instead wants to always start a new session, the matchmaking process starts with the "new_session_only": true attribute using the following API:

POST {baseURL}/match2/v1/namespaces/{namespace}/match-tickets

{
“matchPool”: “game”
“attributes”: {
“new_session_only”: true // The default value, when not defined, will be false.
}
}
info

If the parameter value is true, the player will not be backfilled into any available session and will be preferred to be matched in a new game session.

The following image shows the matchmaking process for when a player wants to start a new session:

Image shows the matchmaking process for when a player wants to start a new session

Player has opted to join in-progress games

In order to choose to join in-progress games, the player can set the "new_session_only": false attribute using the following API:

POST {baseURL}/match2/v1/namespaces/{namespace}/match-tickets

{
“matchPool”: “game”
“attributes”: {
“new_session_only”: false // The default value, when not defined, will be false.
}
}
info

If the parameter value is false, the player may be backfilled into any available session.

note

The default value for the new_session_only attribute is false, so omitting the attribute would have the same effect.

The following image shows the matchmaking process for when a player has opted to join in-progress games:

Image shows the matchmaking process for when a player has opted to join in-progress games