Gaming API Design Decisions

Let's learn about the workflow and design considerations of a multiplayer gaming API.

Introduction

In the last lesson, we looked at some of the factors that make a gaming experience enjoyable and also learned about the intricacies of various components involved. In this lesson, we’ll explore the overall architecture of the system and use our understanding to decide which architectural style and protocol to use for communication between different components

Design overview

There are many services and components in a modern game system. For simplicity, we’ll only focus on the functional requirements defined in the requirements lesson. We can classify the services associated with the gaming API into the following categories:

  • Main stack services: This category manages the incoming client's requests.

  • Gaming cluster: This category manages the interactive gameplay.

  • Persistent layer: This category manages the user data and game assets.

The diagram below shows only the most common components and services required to design our game API:

Press + to interact
Architecture of the game API
Architecture of the game API

The table below describes the basic role performed by each component and service shown in the diagram above:

Components & Services Details

Component or Service

Details

Match service

  • Handles requests related to player assets, leader boards, tournaments, events, etc.


Patch controller

  • Handles security and maintains error logs
  • Makes sure that players have upgraded to the latest version of the game
  • Issues security patches as soon as they are available


Zone cluster (ZC) controller

  • Configures game simulations on the game servers
  • Redirects players to the nearest game server
  • Handles interzone server communication
  • Takes periodic backups of game servers to resume the game in case of failure


Game server (GS)

  • An authoritative server that runs game simulations
  • Keeps track of game states
  • Provide a smooth gaming experience


Virtual private cloud

  • Helps gaming clusters collaborate with main stack services
  • Allows customized network performance and secure data transmission
  • Carries messages across different servers and clusters


Pub-Sub service

  • Queues events that can be operated elastically, such as thumbnail creation for a newly uploaded avatar
  • Sends and receives events from the match service to the ZC and vice versa

CDN server

  • Delivers static assets such as maps, inventory, weapons, etc.
  • Delivers security and version updates

The table above doesn’t discuss the services covered in the previous chapters. If you’re feeling unsure about the working of services like chat, audio, payment, etc., we highly recommend going back and refreshing the prerequisite concepts.

Workflow

We have divided the workflow into two different categories depending on the nature of the operation.

  • Elastic: ...