Open Match
Example Projects
Product Page
Product Docs
👀 Overview
Open Match is an open-source game matchmaking framework that simplifies building a scalable and extensible Matchmaker. It is designed to give the game developer full control over how to make matches while removing the burden of dealing with the challenges of running a production service at scale.
📄 Open Match Concepts
Ticket
A basic matchmaking entity in Open Match that represents a player (or group of players) requesting a match.
Assignment
A mapping from a game server assignment to a Ticket.
Match
A collection of Tickets and some metadata of a match.
📝 Components users need to implement
Match Function(MMF)
The core matchmaking logic is implemented as a service. It is invoked by Open Match to generate matches. It takes lists of tickets (which meet certain constraints) as input and returns any number of Matches. For this basic demo, the Match Function simply pairs any two players into a Match.
Director
A component that requests Open Match for matches and then sets Assignments on the Tickets in the matches found.
Client
A service that translates in-queued players into Tickets in Open Match understandable language - instructs Open Match a player is currently looking for a match.
🌊 General Matchmaking Flow
🗺 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. 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 the 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 component 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.
-
Game Front End On Creating a Ticket
sequenceDiagram title Create Ticket participant Game Client participant Game Backend participant OpenMatch Frontend participant Redis Game Client->>Game Backend:request Matchmaking note over Game Backend:get player data Game Backend->>OpenMatch Frontend:request CreateTicket with player data inserted note over OpenMatch Frontend:generate ticket OpenMatch Frontend->>Redis:store ticket OpenMatch Frontend-->>Game Backend:return Ticket Game Backend-->>Game Client:return Ticket
-
Game Front End On Connecting player to Game Server
sequenceDiagram title Connect to GameServer participant Game Server participant Game Client participant Game Backend participant OpenMatch Frontend Game Client->>Game Backend:request Matchmaking note over Game Backend:get player data Game Backend->>OpenMatch Frontend:request CreateTicket with player data inserted note over OpenMatch Frontend:generate ticket OpenMatch Frontend-->>Game Backend:return Ticket Game Backend-->>Game Client:return Ticket loop check ticket Game Client->>Game Backend:request GetTicket Game Backend->>OpenMatch Frontend:request GetTicket OpenMatch Frontend-->>Game Backend:return Ticket Game Backend-->>Game Client:return Ticket note over Game Client:check if ticket assigned end alt ticket assigned Game Client->>Game Server:connect to gameserver end
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 create Game Server Assignments from these details in Open Match, via communicating with the Open Match Backend.
-
Director On Creating a Match
sequenceDiagram title Create Match participant Director participant OpenMatch Backend participant Match Function participant OpenMatch Query participant Redis note over Director:generate match profile Director->>OpenMatch Backend:call FetchMatches with MatchProfile OpenMatch Backend->>Match Function:execute Run with MatchProfile Match Function->>OpenMatch Query:call QueryTickets with MatchProfile OpenMatch Query->>Redis:query tickets based on MatchProfile Redis-->>OpenMatch Query:return Tickets OpenMatch Query-->>Match Function:return Tickets note over Match Function:run matchmaking logic and generate matches Match Function-->>OpenMatch Backend:return Matches alt matches found note over OpenMatch Backend:set the matches tickets to "pending" state OpenMatch Backend-->>Director:return Matches note over Director:request gameserver allocation Director->>OpenMatch Backend:call AssignTickets with allocated gameserver address OpenMatch Backend-->>Director:return Assignment result end
-
Director on Game Server Allocation
sequenceDiagram title GameServer Allocation participant Agones participant Director participant OpenMatch Backend loop Director->>Agones:get gameserver list Agones-->>Director:return gameserver list note over Director:query for available gameserver alt gameserver available note over Director:generate MatchProfile Director->>OpenMatch Backend:call FetchMatches with MatchProfile note over OpenMatch Backend:execute Run in Match Function OpenMatch Backend-->>Director:return Matches alt match found Director->>Agones:allocate gameserver Agones-->>Director:return gameserver info Director->>OpenMatch Backend:call AssignTickets with allocated gameserver address OpenMatch Backend-->>Director:return Assignment result end end end
No Comments