×
Community Blog Global Gaming Servers (2): Typical System Design and Case Study

Global Gaming Servers (2): Typical System Design and Case Study

This article series introduces several architecture designs for global gaming servers and discusses the advantages and disadvantages of each approach.

In the previous article of this series, we looked at several architecture designs for supporting global gaming servers, as well as evaluated the strengths and weaknesses of each design. In this article, we will look at specific examples of applying these designs to solve common issues in the gaming industry.

Typical System Design

Global Rankings Design

When designing a global rankings service, you must consider demand, analysis, data structure, rank data persistence, rank server SPOF issues, and other issues. A ranking service architecture is shown in the following figure:

9

This architecture uses Redis to implement data at regular intervals. The game server reports rank data to the rank server. Clients pull rank data from the game server and the game server pulls rank data from the rank server.

Game Time Design

All the game servers use GMT Jan 1, 1970 00:00:00 offset (generally an absolute value of 1 for the second count) to express the in-game time. This time is synced to game clients, who use the time zone set on the cell phone to compute the game time to be displayed in the client. The specifications are shown in the figure below.

10

Why is the game time synchronization necessary?

  • To prevent client modifications to the local time from confusing the game logic, the client must use the server time.
  • Basically all techniques to solve game status synchronization problems, such as predictive pull or server verification sync, require time synchronization.
  • In games, some timed events or time-related gameplay features require a standard and uniform game server time to ensure fair play.
  • During the client and server communication, a more secured method is to add a timestamp to each packet so that the server can verify the validity of the packets.

Game Data Synchronization

Solution 1: Use a Cache for Instant Data Writeback

In this method, data is stored centrally and the local caches instantly write data back to the database. The specific architecture is shown in the following figure.

11

Currently, there are two main scenarios that involve data synchronization:

Scenario 1 Players log on in their local regions (explanation marked in red text in the previous figure).

  • The database proxy reads role data from the database.
  • The database proxy inserts the role data into the cache.
  • The role data read from the cache is used in computing.
  • When the data changes, the cache data and database data are updated simultaneously.
  • When players exit the game, the data in the cache is deleted.

Scenario 2 Players log on across regions.

  • First, the system checks if the player is logged on in another region. If yes, it goes to step 2. If no, it goes to step 3.
  • The player's role data is written back to the database and deleted from the cache when the player is logged out.
  • The database proxy reads role data from the database.
  • The database proxy inserts the role data into the cache.
  • The role data read from the cache is used in computing.
  • When the data changes, the cache data and database data are updated simultaneously.
  • When players exit the game, the data in the cache is deleted.

Solution 2: Real-time Regional Database Synchronization

The various regional databases are synchronized in real time. You can accomplish this using Message Service or Alibaba Cloud DTS. Each of the regional databases store data for all players.

12

  • Advantages:

    The players can play the game from different regions, their data need not be migrated. All regions support local data reading and writing.

  • Disadvantages:

    The asynchronous data synchronization can produce data inconsistencies. If the player uses a VPN to access the game, a transient VPN disconnection can cause the player to log on again in another region. If data synchronization messages are lost or delayed, the data read when a player logs in again may not be up to date.

    The various regions contain all player data, so real-time synchronization may put a high level of pressure on the database. Real-time synchronization between regional databases demands a great deal of cross-region leased line bandwidth.

Solution 3: Cross-Region Data Update

When a player logs on from a different region, the player's local server must remotely read combat data. The combat results call an API to trigger a data update on the local server.

13

  • Advantages:
    For players in the same region, role data is read/written to/from the nearest local node.
  • Disadvantages:
    The implementation logic is complicated. All gameplay results must be abstracted to an interface and data is centrally changed by the original server interface.

Solution 4: Remote Data Migration

When a player logs on from a different region, the player data is remotely migrated from the player's previous server. Each time a player logs on, the system must check if data migration is required.

14

Game Localization Solutions

Game localization is an important factor for consideration of games seeking to enter overseas markets. Games, either being released overseas or looking to expand to new regions must be attentive to localization work. The general approach is to build a standard client installation package, which contains several basic material packages, art material packages for different languages, and some program materials. This allows the game to be dynamically rendered based on the phone's language version.

There are three common installation strategies:

  • After the client installation package is downloaded, the user manually sets the language version. Such large packages contain various language packs and support one-click language selection.
  • When the game is installed on the client, it detects the language used by the mobile device to dynamically select the language version to install. These installation packages generally have a built-in default language and, if another language is needed, a language pack is downloaded from the Internet.
  • Different language versions of the client installation package are submitted to the app store. Then, different installation package versions are served to different regions. Each installation package must be customized.

Case Study

Case Study 1: Game A

Game A is a global server card game. Currently, the game server is deployed in the Alibaba Cloud US West 1 region. The gameplay is not very sensitive to network latency and a latency below 300ms does not affect the gaming experience. Therefore, the customer did not plan for any network access optimization or distributed deployment, adopting the fully-centralized deployment architecture.

15

Case Study 2: Game B

Game B is a global real-time multiplayer war game. The game adopted the global server game reference architecture with centralized deployment and network optimization.

The game's access layer, business logic layer, and data layer services are all deployed in the Alibaba Cloud US West 1 region. Chinese players use Alibaba Cloud public network BGP to access Express Connect and connect to the VPC for the US West 1 region. Global Acceleration is deployed in China North 2 and set as the access layer's public network portal, with intelligent DNS used for traffic scheduling. This layout improves the game access speed for players on the Chinese mainland.

16

How Alibaba Cloud Can Help

  • Unified Management of Resources
    Alibaba Cloud provides features that match games with global players and mass data with ease.
    • Data centers with high compute power across multiple regions worldwide.
    • One account for maintenance and resource management.
    • Centralized presale and aftersales service system along with the localized support.
  • Sustained and Secure Availability
    Alibaba Cloud provides stable and low-latency network to guarantee global players seamless access and fair competition.
    • Dedicated and consistent network connection by using Express Connect to link data centers across the world.
    • High network quality and low latency level specified in SLAs.
  • Comprehensive Suite of Products
    Alibaba Cloud offers properly designed architectures and flexible deployment plans to fulfill the business logic of different genres of games.
    • Reliable global serverless architecture and customizable deployment plans.
    • Customer-based solutions for network latency, data consistency, and other technical difficulties.

Summary and Future Prospects

By describing business needs, technical difficulties, cloud products, player acceleration methods, reference architectures, and typical designs, this article aims to provide complete solutions to more customers who want to develop global server games.

Alibaba Cloud already offers the following technical solutions to address a series of technical difficulties (such as time synchronization, localization, and latency) faced by global server games:

  • Distributed deployment cross-region data synchronization
  • Global serverless game time (such as GMT)
  • Global serverless game localization (such as text, materials, and code)
  • Global serverless latency elimination (such as server frame sync)

In future, Alibaba Cloud plans to perfect and provide general solutions and solutions for different global server game architectures:

  • Distributed node traffic proxy construction best practices
  • Global server SLG game architecture solutions
  • Global server card/board game architecture solutions

In a nutshell, Alibaba Cloud's global data centers and Express Connect form a global network that assists the global deployment of games.

0 0 0
Share on

Alibaba Clouder

2,605 posts | 747 followers

You may also like

Comments