Overview
The matchmaking service matches a number of players into one battle based on a specific ruleset. The key processes includes searching for players, and battle placement on 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 are 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're two types of interactions.
- Invoke matchmaking interfaces using PGOS SDK.
- Receive matchmaking notifications pushed by matchmaking service when the status of matchmaking request changes.
Matchmaking Service supports retrieving Player Data from Player Management. PGOS DS SDK helps dedicated servers to maintain the associated battle session through the lifecycle of a battle.
2.2 Matchmaking Process
The matchmaking service is responsible for selecting suitable requests from the matchmaking request pool to form up a battle, and then to place the battle on the appropriate DS according to the playerc latency. Specifically, the processing flow of a matchmaking request is as follows:
- Preparation: (optional) When a multiple players 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 matchamking request pool, waiting for the matchmaking engine to pick it into 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 theAuto Continue
option is on, all the other's matchmaking request will return to Searching phase if any players refused the battle proposal. Note that the searching timeout will be reset each time a matchmaking request enter the searching phase. - Placement: 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 the required fields
- Integrate matchmaking into your game client
- Preparations
- Start a matchmaking request
- Track matchmaking request status
- Confirm multiplayer matchmaking request
- Connect to battle
- Integrate Your Game Server
- Initialize the game server process
- Report game server process health
- Handle battle session placement event