Matchmaking using Open Match

A deep dive into building an Open Match based Matchmaker.

Objective

The guide presents a high-level Online Game Services architecture that leverages Open Match for matchmaking. It explains in details the core customizations that need to be added to Open Match to build your Matchmaker. It also takes a deep dive into the external components that interact with Open Match. Along the way, it covers the Open Match concepts needed for building these components.

This guide is a pre-reading for the tutorial for building a basic Matchmaker. You can use this Tutorial Solution as a reference when going through each component in this guide.

Game Services Architecture

Architecture

Open Match Core

Open Match comprises of a set of services hosted in a Kubernetes cluster. These services expose the core functionality of Open Match over gRPC and HTTP

Open Match FrontendService

The Open Match FrontendService is used to create, delete and get details of the current state of a Ticket.

Open Match BackendService

The Open Match BackendService is used to generate Matches and create Assignments for the Matches when invoked by the Director, and returning Assignments to the Open Match Frontend when requested.

Open Match QueryService

The QueryService enables querying the Tickets that meet certain constraints from the current Ticket pool.

Customized Components

To build a custom Matchmaker using Open Match, the user needs to provide the following customizations. These can be authored as services exposed over gRPC or HTTP endpoints.

Match Function

The core matchmaking logic is implemented as a Match Function service. Open Match Backend triggers the Match Function service when it receives a request to generate Matches. The Match Function execution receives MatchProfiles, fetches Tickets that match the profile from QueryService and returns Matches.

Evaluator (Optional)

Open Match allows for concurrent Match Functions to execute on the same player pool. The Matches generated by such concurrent Match Function executions may have overlapping Tickets. Given that one Ticket should only be used by one resulting Match, Open Match allows the user to plug in an Evaluator component to deduplicate Match proposals before returning results. Open Match provides a default Evaluator which suffices for most common use cases. See Evaluator Guide for details on proposal evaluation.

External Components

Although Open Match based Matchmaker offers core matchmaking functionality, other Game Services will be needed to handle key features such as handling player connections, fetching DGS (Dedicated Game Server) allocations etc. These services interact with Open Match to enable game specific matchmaking scenarios. Here is an overview of these services that are external to an Open Match based Matchmaker but are a part of an end to end setup:

Game Frontend

This is the component that receives the matchmaking request from the game client and eventually provides the game client with the Assignment. The Game Frontend typically authenticates the player, fetches player data and creates a matchmaking request in Open Match and fetches the Assignment for the Ticket.

Director

This is the component that understands the types of matches (MatchProfiles) that can be served and fetches matches from the Open Match Backend. The Director also interfaces with the DGS allocation system to fetch Game Servers for Matches and creating Game Server Assignments from these details in Open Match, via communicating with the Open Match Backend.

Matchmaking Flow

Here is an overview of how a Game Client gets assigned to a Game Server in this architecture.

Matchmaking request creation

Creating a Matchmaking request

  1. A Game Client (for the Player) intending to find a match connects to the Game Frontend requesting for an Assignment.
  2. The Game Frontend validates the player, fetches its properties from the platform services and calls Open Match Frontend to create a Ticket for this player. Open Match creates a Ticket and indexes its SearchFields.

Now the Ticket representing this player is a part of a Ticket Pool actively being considered for matchmaking by Open Match.

Creating a Match

  1. The Director periodically calls FetchMatches on Open Match Backend to generate Matches for a MatchProfile.
  2. Open Match Backend triggers MatchFunction execution for this MatchProfile.
  3. The MatchFunction fetches all the Tickets from the active matchmaking Pool that match the filters in the MatchProfile from Open Match QueryService API.
  4. The MatchFunction generates a Match using a subset of the queried Tickets.
  5. The Open Match Backend returns this Match to the Director.

At this point, the Ticket representing the Player is a part of the Match but does not have an assignment yet.

Setting an Assignment

Matchmaking request creation

  1. With a fetched Match needing an allocation, the Director requests the DGS allocation system for a Game Server for the Match.
  2. The Director then creates an Assignment containing the details of connecting to the allocated Game Server.
  3. The Director calls SetAssignment to set this Assignment on all the Tickets in the Match. This stores the Assignment on the Ticket in Open Match State Store.
  4. The Game Frontend fetches the Assignment from the Open Match Backend and returns it back to the Game Client.
  5. The Game Client connects to the Game Server and starts the game.

Next Steps

Now that you are familiar with building an Open Match based Matchmaker, its time to build one!

Please proceed with the step-by-step tutorial for building a basic Matchmaker

Components Deep Dive

The Below sections take a deepdive into how each of these components interact with Open Match and explains the core Open Match concepts needed to build these components:


Game Frontend

What is a Game Frontend? How does it interact with Open Match?

Director

What is the Director? How does it interact with Open Match?

Match Function

What is a Match Function? What should it do?


Last modified January 18, 2024