Skip to main content

Overview

The matchmaking service matches some players into one battle based on a specific ruleset. The key processes include searching for players and battle placement on a dedicated server. It supports solo and multiple players' matchmaking. With the help of PGOS SDK, developers can create, query, and cancel a matchmaking request.

1. Key Concepts

  • Matchmaking Ruleset: A JSON object that describes matching rules and dependent data. The matchmaking service ensures that the matched players meet the constraints described in the rulesets. Each ruleset can be associated with multiple matchmaking configurations.
  • Matchmaking Configuration: A matchmaking ruleset describes how the matchmaking engine will output a match, and a matchmaking configuration contains several process-related parameters, as well as the crucial information of where the match will be placed. Two placement targets are supported: Placer and Local Placer.

2. Architecture Diagram

2.1 Service Architecture

The game client accesses the matchmaking service through the PGOS client SDK, and there are two types of interactions.

  • Invoke matchmaking interfaces using PGOS SDK.
  • Receive matchmaking notifications pushed by the matchmaking service when the status of the matchmaking request changes.

Matchmaking Service supports retrieving Player Data from Player Management. PGOS DS SDK helps dedicated servers maintain the associated battle session through the lifecycle of a battle.

mm.drawio

2.2 Matchmaking Process

The matchmaking service is responsible for selecting suitable requests from the matchmaking request pool to form a battle, and then to place the battle on the appropriate DS according to the player's latency. Specifically, the processing flow of a matchmaking request is as follows:

1663146677973

  • Preparation: (optional) When a multiple-player matchmaking request is created, all players in the request should actively decide whether to join or reject the request within a specified time.
  • Searching: The request is put into the matchmaking request pool, waiting for the matchmaking engine to pick it for a proposed battle.
  • Acceptance: (optional) When the Acceptance option is on, each player in a proposed battle should actively accept participation in the battle within a specified time. When the Auto Continue option is on, all the other 's' matchmaking requests will return to the Searching phase if any players refuse the battle proposal. Note that the searching timeout will be reset each time a matchmaking request enters the searching phase.
  • Placement: The Matchmaking service tries to find an appropriate DS for each proposed battle.

3. Integration Steps

The matchmaking works with the DS Hosting and Management services. Please follow the steps below to integrate PGOS's matchmaking with your game:

  • Steps to set up a match configuration
    • Write a ruleset that defines teams and conditions to find players for a match
    • Create a DS placer to place the battle sessions generated from matchmaking
    • Create a match configuration and fill in the required fields
  • Integrate matchmaking into your game client
    • Preparations
    • Start a matchmaking request
    • Track matchmaking request status
    • Confirm the multiplayer matchmaking request
    • Connect to battle
  • Integrate Your Game Server
    • Initialize the game server process
    • Report game server process health
    • Handle the battle session placement event