Game #

The Game Loop describes the workflow for how players connect with their friends, match with other players, and get into the game.

sequenceDiagram participant Player participant Party as Party Service participant Matchmaking as Matchmaking Service participant Session as Session Service participant MatchLifecycle as Match Lifecycle Service participant MatchCapacity as Match Capacity Service participant GameServer as Game Server Player->>Party: Enter matchmaking Party->>Matchmaking: Send party to matchmaking Matchmaking->>Session: Set party members IN_MATCHMAKING Matchmaking->>Matchmaking: Match parties Matchmaking->>MatchLifecycle: Start match MatchLifecycle->>Session: Set party members IN_MATCH MatchLifecycle->>MatchCapacity: Start match GameServer->>MatchCapacity: Report available capacity MatchCapacity->>GameServer: Start these matches GameServer->>MatchLifecycle: Match is ready MatchLifecycle->>Player:Send match details Player->>GameServer:Connect with match details GameServer->>GameServer:Play match GameServer->>MatchLifecycle:Match end MatchLifecycle->>MatchLifecycle: Process match end MatchLifecycle->>Party:Recreate original parties from match Party->>Session: Set party members IN_PARTY

Session #

There are key aspects of session management particular to the Game Loop.

Players who leave an in-progress game create a bad experience for other players. In addition to systems deliberately tailored to prevent AFK and other disruptive behaviors, live-service games often want to manage the game loop such that players are not able to leave a match and start another.

The Game Loop services coordinate with the Session service to ensure the platform understands where the player is at all times. This enables several features, including:

  • Allowing players to reconnect to an in-progress match after a client crash or disconnect.
  • Requiring that players reconnect to an in-progress match rather than starting a new one.
  • Preventing abuse cases such as filling up the matchmaking queue with stale records.
  • Allowing clients to recover from intermittent network issues while players are going through the game loop.

Attribute keys #

Within the Session service, players are assigned session attribute keys, which can be found within the OnGameSessionChangedV1Notification event. These keys indicate which part of a game loop a player is in.

keystatus
PARTY_IDin the Party service before matchmaking
MATCHMAKING_IDentered matchmaking
MATCH_IDmatch found
Once a player makes it through this loop and reaches MATCH_ID status, the game client waits for a OnMatchReady or OnFailedToFindMatch event.

Contents #

TopicDescription
PartyAllows players to create a party with their friends and configure their game before entering matchmaking.
MatchmakingConnects parties to create matches. Utilitizes game mode and queue configuration, matchmaking rules, and matchmaking.
Game Server ManagementLaunch matches, manage player sessions, support reconnect, and process match end results.
Match EndGrant content, update quests and progression data, and grant rewards.