Open Match Deep Dive

Jon Foust
4 min readSep 11, 2020

--

If you’re still following along from my previous blog post, this is all about Open Match. Open Match is a flexible, scalable, and extensible matchmaking framework that grows with your game. To accomplish this, we utilize Kubernetes, Redis, and gRPC. Here is a breakdown of how Open Match uses these technologies to assist in your matchmaking.

Flexible, Scalable, and Extensible — If you’re familiar with Kubernetes, these are buzzwords for this open-source software. Kubernetes allows you to containerize and manage the services for your matchmaker. Before we understand the role Kubernetes plays in Open Match, we should explore the Open Match services to see where Open Match benefits from container orchestration.

Open Match Architecture

All matchmakers have standard functionality, such as receiving requests for matches, performing matchmaking logic, and assigning you to a game server. Open Match was built with this in mind and included that functionality as part of its Core services. Let’s examine these services.

Open Match Frontend Service

When you make your initial matchmaking request from your game, the Frontend service is responsible for handling it. The Frontend service is accountable for this and other requests, including creating or deleting a Ticket and getting details of a Ticket. Once a request is received, it’ll generate Tickets and store them in a state store(in this case, Redis). Tickets are stored as key-value pairs that allow quick reads/writes to improve access throughout the various services.

Open Match Backend Service

The Backend service is responsible for generating matches and assigning dedicated game servers to Tickets when the Director invokes it. The Backend service will return assigned Tickets to the Open Match Frontend.

Open Match Query Service

In my previous post, we talked about profiles. Profiles set the criteria for matches using filters for strings, tags, and float ranges. When a Ticket fits within one of these filters you have defined, it will enter a Ticket pool for the Profile. The Query service triggers the match function, which selects Tickets from these Ticket pools to generate proposed matches.

Custom Open Match Services

We’ve covered the typical matchmaking functionality and how Open Match core services provide the tools to build them. But how do you implement the unique match logic for your game? The custom Open Match services are what your matchmaker will need to place players in fair and enjoyable matches.

Match Function Service

The match function service is the custom logic you provide Open Match to create your matches. The Query service triggers the match function service to look at the Ticket pools and generates matches.

Evaluator

You may want to provide some additional evaluation for match quality when you have complex search fields(latency, skill level, queue entry time, and game mode), overlapping match profiles, and complex match function logic. Open Match ships with a default evaluator that weighs all matches equally but has the functionality to support a custom evaluator for your complex matchmaking needs. Custom evaluation can include prioritizing latency and skill for matches and assigns the proposed match a score. Matches with the highest quality are prioritized and ensure that your matchmaker gives your users the best experience.

Benefits of Kubernetes and Open Match

Now that we’ve covered all the Open Match services that will make your matchmaker a hit with your players, let’s talk about the advantages of using Kubernetes for Open Match.

Scalability

Your multiplayer game has become a hit sensation, causing a surge of players way beyond your expectations. We’ve heard all the stories of matchmaking not being able to meet player demand. Imagine hundreds of thousands (possibly millions) of players hitting your Open Match cluster deployed in US-West to put this in perspective. With the help of Kubernetes, you can automatically scale horizontally by increasing the number of pods should a service’s RAM utilization go over 60%, and back down once it has normalized(or below 60% in this example).

Run Open Match Anywhere (you can run containers)

A feature of Kubernetes is it works with any container runtime. Various cloud providers have Kubernetes runtimes/offerings, allowing you to run publicly (in the cloud). You can also run Kubernetes locally on-prem. A hybrid deployment will enable you to run on a mix of cloud providers and on-prem. Being able to run Open Match with on-prem, publicly, or on hybrid environments gives developers the power to deploy their matchmaker or services optimally or where their players are available regionally.

Self-healing

If your matchmaker suddenly goes down, Kubernetes can repair the services that fail or restart containers after failed health checks. Because Open Match services communicate with one another, several issues would arise if, for example, the Query service went down. Kubernetes would quickly restart the entire container without exposing your matchmaker to your players, getting them back in your game in no time.

Wrap-Up

There you have it! Open Match is an excellent solution for anyone who wants to run on a matchmaker on a global scale without having to build from scratch. It grows with your game, is highly available, and offers the customizable options to make it your own.

Look forward to more Open Match content coming soon, including:

  • How to write a match function
  • How to submit a matchmaking request from your game

For Open Match content, check out:

If you have any questions, feel free to reach out to me on Twitter

--

--

Jon Foust
Jon Foust

Written by Jon Foust

Developer Advocate @ Google. Gamer. Maker. Trying to make things easier for others by doing the hard stuff myself. Opinions are my own.

No responses yet