What is a Game Frontend? How does it interact with Open Match?
Matchmaking using Open Match
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.
Game Services 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.
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.
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.
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.
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:
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.
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.
Here is an overview of how a Game Client gets assigned to a Game Server in this architecture.
Creating a Matchmaking request
- A Game Client (for the Player) intending to find a match connects to the Game Frontend requesting for an Assignment.
- 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
- The Director periodically calls FetchMatches on Open Match Backend to generate Matches for a MatchProfile.
- Open Match Backend triggers MatchFunction execution for this MatchProfile.
- The MatchFunction fetches all the Tickets from the active matchmaking Pool that match the filters in the MatchProfile from Open Match QueryService API.
- The MatchFunction generates a Match using a subset of the queried Tickets.
- 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
- With a fetched Match needing an allocation, the Director requests the DGS allocation system for a Game Server for the Match.
- The Director then creates an Assignment containing the details of connecting to the allocated Game Server.
- 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.
- The Game Frontend fetches the Assignment from the Open Match Backend and returns it back to the Game Client.
- The Game Client connects to the Game Server and starts the game.
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:
What is the Director? How does it interact with Open Match?
What is a Match Function? What should it do?
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified September 23, 2022