Partager via


Xbox Live Cross Network Multiplayer Implementation Example: Multiplayer Game

Version 1.0, 3/1/2020

This example scenario is intended to illustrate the recommended cross-network functionality and flow in a traditional multiplayer game or MOBA. It shows one possible design and implementation path.

In this scenario, the title supports the following multiplayer functionality:

  • Custom matchmaking

    The title implements a custom matchmaking service. This service first (optionally) matches players into teams and then matches teams and players together.

  • Dedicated servers

    All gameplay for the title is executed on dedicated servers. All traffic (including chat traffic) is also routed through these servers.

  • Custom leaderboards

    Title services implement custom leaderboards that include deep information about player progress.

  • Multiple game modes/settings

    The title supports multiple game modes such as co-op versus team-based and allows the player to configure map, game size, rules, and other settings for these modes.

  • In-game currency

    The title provides an in-game store with purchasable (premium) in-game currency. This currency enables players to purchase power-ups for the team. Cosmetic items can also be purchased for player characters.

  • DLC

    Purchasable downloadable content includes new maps and additional characters.

Title services

One of the custom title services in this example is an authentication service. This service is used for account linking of an Xbox Live (or other multiplayer network) account to a title-specific player account. When a player first connects to the service, account linking is performed silently and a new cross-network player identity is created. For Xbox Live, the player's XUID is used as a unique player identifier that is linked to the title-specific account. XUID access needs to be approved prior to use and must be discussed with a DAM.

The title-specific account has a unique ID (GUID) that allows all title services to handle players regardless of network origin and stores metadata about the player. In this example, the multiplayer network and basic gameplay player stats are stored in this account.

Title services use multiplayer network information in the title-specific account to ensure that multiplayer functionality can be restricted to Xbox Live players only.

Title flow

For a typical multiplayer game, a compliant flow for cross-network functionality first starts when the player enters the multiplayer mode.

In this example the title takes the following steps:

  1. Validate privileges

    Before starting multiplayer, a title validates the multiplayer privilege (254 and 189). If the privilege is denied, a title does not enter multiplayer mode.

    The title should also checks the communications privilege (252) and end/disable voice and text chat accordingly.

  2. Validate cross-network privilege

    For this example, the title integrates cross-network gameplay into the default matchmaking experience. When a player enters the matchmaking experience, the title validates the cross-network play privilege (185). If the privilege is denied, only matchmaking within Xbox Live is possible.

    The first time a player is placed into cross-network gameplay the title presents a notification that cross-network gameplay is active.

  3. Team matchmaking

    The title matchmaking service first forms a team from a cross-network players based on matchmaking rules.

  4. Create and join team/lobby MPSD session

    The title matchmaking service creates an MPSD lobby session through service-to-service calls to Xbox Live. All Xbox Live users join this lobby session and the service uses custom properties to additionally provide hints about the non-Xbox Live users in the session. These hints can then be used by client logic for setting session state in the next step.

  5. Set team/lobby MPSD session

    Xbox Live clients set the lobby session as the Activity Session. Session joinability and closed status must be set accordingly to cross-network player status. Xbox Live players remain in this session as long as they remain in the cross-network team.

    If the session is full (or becomes full later in the flow), the service or a lobby arbiter must set the session to closed. An Activity Session that has no more player slots must never be joinable.

  6. Team lobby

    In the team lobby, both Xbox Live players and players from other multiplayer platforms are present. Voice chat is enabled between Xbox Live players through a custom title service.

    Voice chat between all players (Xbox Live/Xbox Live and Xbox Live/non-Xbox Live) is only enabled after validating all required privacy and permission checks. For non-Xbox Live friend relationships the title uses non-Xbox Live network friend relationship data.

    In the team lobby, Xbox Live players and non-Xbox Live players are uniquely identified by the title account identity. All players identifiers also show gamertags and equivalent player names for other multiplayer networks.

    An example of the player roster in the lobby UI is as follows.

    Image showing an example of the player roster in the lobby UI.

    In the lobby UI, the team leader selects match properties (such as level or custom rules) for the next step to find a game session with another team, and then kicks off the match request.

  7. Game session matchmaking

    In this step, the existing cross-network teams are submitted to matchmaking with additional match properties set by the team leader. These properties are used to identify the best match and result in a new set of two teams for a match. At this point, the match service also identifies the dedicated server for both teams.

  8. Create and join game MPSD session

    The result of the anonymous game session matchmaking is an MPSD game session that is created by the match service or dedicated service through service-to-service calls to Xbox Live. All Xbox Live users join this game session, and the service uses custom properties to additionally provide hints about the non-Xbox Live users in the session.

    These hints can then be used by client logic for setting session state.

  9. Connect to dedicated server

    In the final step, all clients connect securely to the dedicated server and initiate cross-network gameplay. All traffic between multiplayer networks must be routed through the dedicated server, no peer-to-peer connections are permitted.

  10. Completing gameplay

    After the gameplay match is completed, teams can choose to:

    • Replay the match

      Players remain connected to the server and in the MPSD game session. Players start a new gameplay match.

    • Search for new opponents

      Players disconnect from the server and leave the MPSD game session. Players remain in the lobby session and return to the lobby screen for a next round of matchmaking.

Session management

To adhere to all Xbox Requirements, the title creates two MPSD sessions for Xbox Live players:

  • Lobby session

    This session is created by the matchmaking service through service-to-service calls to Xbox Live. It contains reservations for all Xbox Live players in a team upon creation. It is the session that players can send invites for or join in progress. Invites and join-in-progress must use Xbox Live systems and cannot be across networks. All Xbox Live players therefore set this session as their activity session.

  • Game session

    This session is created by the matchmaking service through service-to-service calls to Xbox Live. It contains reservations for all Xbox Live players in a game session (across teams). It is used to track the multiplayer activity of Xbox Live players.

Non-Xbox Live players are not directly represented in the MPSD sessions as session members. The title only tracks their presence in a custom session property:

{{"name":"jackplayer"},{"name":"johnplayer"},{"name":"joeplayer"}}

This list and the Xbox Live session members can be used to determine if the session is full. If it is full, the invite and join-in-progress functionality for Xbox Live has to be disabled for correct behavior. A player (or the server) sets the closed property on the session to disable this functionality.

The MPSD session used to track players in gameplay has to enable the gameplay capability to adhere to Xbox Requirements.

Player communication blocking/reporting

Player blocking in the title is supported on the title level:

  • Xbox Live player blocking

    The title uses check_multiple_permissions_with_multiple_target_users to check privileges for multiplayer and chat with another Xbox Live player and the player classes of non-Xbox Live players/non-Xbox Live friends. The title also provides access to the profile of another player through ShowProfileCardAsync. Blocking can be performed in the profile UI of a player.

  • Non-Xbox Live player blocking

    The title uses an in-title block list to support blocking of communication with non-Xbox Live players. This list is maintained on a title service and checked for multiplayer permissions. Cross-network chat is not available by default. A non-Xbox Live player can be blocked in the title through a custom title UI.

    Blocking a non-Xbox Live player through a custom title UI

  • Xbox Live player reporting

    The title also allows reporting of players. For Xbox Live, reporting is done by the player through the profile UI. Xbox Live enforcement handles player reports.

  • Non-Xbox Live player reporting

    For non-Xbox Live users, the title provides a custom reporting UI flow. The title handles player reports accordingly for the title and/or based on guidelines by other multiplayer networks.

Marketplace

Purchases of in-game currency on Xbox Live and other multiplayer networks are tracked on a title service. The title provides a shared virtual currency wallet and in-game item inventory between all title versions.

For non-Xbox Live title versions the following restrictions apply:

  • Player Skins

    Player skins can be purchased through in-game currency only. In-game currency is managed in a unified in-game wallet that is available across all networks. All player skins are identical across all title versions.

  • Consumables

    Consumables can be purchased through in-game currency only. Like currency, consumable items are managed in a unified in-game inventory.

  • Downloadable content

    On Xbox Live platforms, downloadable content (new maps and character types) is managed through the Microsoft store. Entitlemens from other stores are not shared.

    All players need to have a valid entitlement in their respective store to play in the same map together. Non-purchased character type is visible but not playable for a player that does not have the matching entitlement.

Achievements

The title has multiple achievements that are based on multiplayer actions, including multiplayer games played. Achievement progress for this (and similar) achievements include cross-network multiplayer game sessions.

The title does not have any achievements that are limited to cross-network gameplay. Achievement progress for Xbox One title achievements is possible through gameplay on other title versions.

Player progress

Player progress is shared between the all title versions. The custom title account holds parts of the player progress.

Game DVR/broadcasting

The title provides support for Game DVR and screenshots as well as broadcasting in cross-network multiplayer matches.

Leaderboards

The leaderboard for the title is implemented through a title service that provides extensive leaderboard functionality beyond Xbox Live leaderboards. The service creates multiple underlying leaderboards and updates them in parallel: one leaderboard for each multiplayer network, and one merged leaderboard that combines results from all multiplayer networks.

When cross-network multiplayer is enabled, the merged leaderboard is displayed. All players are represented in the same way as in the multiplayer lobby.

Image of a merged leaderboard

The Xbox Live-only leaderboard is displayed when a player has disabled the cross-network gameplay functionality.

A title-specific account is used to identify all players on the leaderboard service internally. The external identifiers for Xbox Live players depend on the querying title instance. On Xbox Live title instances, the XUID is returned and the client performs a lookup to determine the gamertag string of the player. On non-Xbox Live title instances, the gamertag or DisplayName string of the player is returned directly. The service retrieves this string from a service-to-service call to Xbox Live and caches it for up to 4 hours.