Battle Match

Last updated: 2021-04-20 16:24:07

    This document describes how to use GSE in combination with GPM to enhance your gaming experience.

    Prerequisites

    Process Architecture

    The process architecture of GSE+GPM is as follows:

    Matchmaking Status

    To request GSE resources for the GPM matchmaking result, your MatchTicket will have the following statuses:

    Note:

    For more information about MatchTicket, see MatchTicket Parameters.

    Directions

    Step 1: initiate a matchmaking request on the client

    You need a server to process matchmaking requests from your players, and call the StartMatching API to initiate matchmaking requests to GPM. A successful call of the StartMatching API generates a unique MatchTicket. You need to track the MatchTicket status to complete your matchmaking process.

    You can call the CancelMatching API to cancel the matching MatchTicket.

    Step 2: track the matchmaking status through event notifications

    After a matchmaking request is initiated, you can configure a notification address to receive GPM event notifications. Meanwhile, you can set a timer to periodically process event notifications. For more information about event notification, see Event Notifications.

    Step 3: process completed MatchTicket

    • For a completed MatchTicket, GPM has already started a game server session on the game server queue, and filled in the relevant MatchTicket fields with game connections.
    • You need to parse MatchTicket based on the protocol and obtain game connections as well as player ID and player session ID in the same battle.
    • Players can access the active GSE game server session after receiving the game connections and player session ID. For more information about how to connect to a game server session, see Connecting Client to gRPC Server of GSE.
    • For cancelled/timeout/failed ticket, you can notify players according to the actual business logic, or initiate a matchmaking request again for players.

    (Recommended) Step 4: use the DescribeMatchingProgress API to complement event notifications

    If you failed to configure a notification address or receive event notifications, you can call the DescribeMatchingProgress API to track the MatchTicket status. For more information about the statuses, see MatchTicket Status.

    FAQs

    1. How does the region latency of players affect GPM and GSE?

    • For GPM
      • If there is no latency rule in the GPM rule script, the region latency of players will not be used.
      • If there is a latency rule in the GPM rule script, the region latency of all players matched to a battle should be satisfied in at least one region.

    For more information about region latency in GPM, see Latency Rule.

    • For GSE
      • If the region latency is not passed in when a matchmaking request is initiated, GSE will choose a fleet to place the game server session according to fleet priority in the queue.
      • If the region latency is passed in when a matchmaking request is initiated, GSE will use the region latency based on whether the queue is configured a latency policy.
        • No latency policy: GSE will place the game server session in the common region according to fleet priority.
        • Latency policy configured: GSE will place the game server session in the common region according to latency policy. If there are multiple eligible regions, GSE will choose the region according to fleet priority.

    For more information about region latency in GSE, see Nearby Resource Scheduling.

    2. What is the difference between timeouts in GPM and GSE?

    • GPM timeout

      This timeout is the longest period during which GPM will search for a MatchTicket, and the MatchTicket is in SEARCHING status. If no other players are matched during the period, the MatchTicket status will change to TimedOut.
    • GSE timeout

      This timeout is the longest period for retaining a game session request during which GSE will search for eligible fleet in the queue after a placement request is received. If no fleet is found during the period, the status of all MatchTickets involved in this placement change to Failed.

    Note:

    The time consumed for a matchmaking service mainly includes the GPM searching and GSE placing.