×
Community Blog The Practice of MQTT in Game Operation and Release

The Practice of MQTT in Game Operation and Release

This article explains the usefulness of Alibaba Cloud Message Queue for MQTT in the gaming industry.

Preface

The gaming ecosystem consists of game developers, operators, and publishers. The operation of a game is divided into two stages, R&D and operation. The former stage includes individuals, independent studios, and gaming R&D companies.

The gaming R&D company mainly focuses on game content R&D, resulting in an insufficient investment of workforce personnel and financial resources during game release and operation. Therefore, the game release and operation businesses are formed, with independent operators and publishers. Currently, many large game manufacturers in the market outsource publishing and operation to operators and publishers. Some game distribution channels also provide specific joint operation services based on their traffic.

1

The interaction in the preceding figure involves:

  1. The operation interaction of the game happens between the client and server, most of which uses Socket long procedures for communication.
  2. The interaction between the game client and the game publisher platform includes login, payment, and others. These operations are requested actively by players to perform procedure communication via HTTP.

The solutions for the interaction of these two parts are relatively fixed.

However, in scenarios about operation information and advertisement push, services are more actively pushed by game operators and publishers. These services include marquee information of server O&M and updates, account kick-out information, floating window advertising, and normal message pushing. It troubles a lot to choose a more suitable interaction mode with millions of game players.

This article explains the usefulness of Alibaba Cloud Message Queue for MQTT in the gaming industry. This chapter describes how to better support information operation and notification technically.

Features and Requirements of Push from Operators and Publishers

  1. Large Number of Target Customers: The total number of customers of a successful game often exceeds millions (or even tens of millions), with high simultaneous online numbers.
  2. Different Timeliness of Messages: Some messages take effect within a certain time, whether customers are online or not, such as the O&M upgrade notification of the main game server. If online, customers will receive the message immediately. Otherwise, it will come at the next login. Some messages are only useful to customers currently online, such as account kick-off information.
  3. Precise Mass Pushing: The pushed messages are tailored to customer groups with certain characteristics. For example, different advertisements target the corresponding levels of game players.
  4. Lightweight Consumption of Connections: This type of data interacts less frequently than game operations. So, the traffic of data push, such as the game client and advertising, takes up as little client running resources as possible.
  5. Less SDK-Dependent Resources: In the gaming industry, the R&D team generates the parent game package, and game operators and publishers will embed the SDK packages needed for operation, such as functions of payment and data push. Therefore, the smaller push-dependent resource package is better.

Analysis of Alternative Technical Solutions

1.  HTTP Polling Solution

Advantages:

  • Less dependency on the game client and easy to implement

Disadvantages:

  • More Invalid Polling: Multiple clients lead to many different types of polling. Due to the low frequency of this type of message, most of the polling is invalid.
  • Complex Implementation on the Operations Side: Additional code logic is required to maintain the read state.
  • High Resource Occupation: The peripheral call chain, log information, and concurrent processing capability cause an increase in resource occupation.

2.  Socket Solution

Advantages:

  • Less dependency on the game client and easy to implement

Disadvantages:

  • Connection Maintenance: Operators may divide applications into different types. For example, advertising and system management may be seen separately. Thus, different sockets connected to different types of applications are necessary for data push. As a result, the connection between game clients will increase, occupying more resources.
  • Complex Implementation on the Operation Side: Additional code logic is required to maintain the subscription and pushing. During the push process, code is required to filter for accurate delivery to target groups. It is required to additionally record push status to ensure the push quality (arrived or not). The timeliness of pushed data needs additional control, especially for some expired messages, such as service O&M time notification.

3.  Kafka Solution

Advantages:

  • Simple Access: The mature message-oriented middleware supports a variety of implementation languages. Only the connection to the Kafka node itself is needed. Direct connection with the publisher application is not required for natural decoupling.
  • Powerful Functions: Kafka allows state maintenance and storage of pushed data.

Disadvantages:

The number of client connections is insufficient to support a large number of gamers (clients) through simple clusters.

4.  MQTT Solution:

Advantages:

  • Simple access and simple protocols that support various implementation languages
  • Support various subscription relationships
  • Support p2p messages
  • Support the QoS of various messages delivered
  • Check the connection status of the client
  • Support millions of connections

Disadvantages:

  • It is not as popular as other solutions.

MQTT Technical Solution

Based on the comparison of the preceding three solutions, the MQTT solution is very suitable for the interaction scenario where game operators, publishers, and game clients perform data push. Its design principles are listed below:

  1. Lightweight and efficient micro-messages, simplified MQTT protocol, and simple message header
  2. Two-way communication based on the Pub/Sub communication mode
  3. Support message storage and persistence by topic
  4. Support subscription relationship setting, p2p mode, and broadcast mode
  5. Support connection of millions of devices
  6. Provide message service quality management
  7. Applicable to unstable networks with low bandwidth and high latency

2

The comparison between Alibaba Cloud Message Queue for MQTT and open-source MQTT is listed below:

3

Summary

On the platform of game release and operation, Alibaba Cloud Message Queue for MQTT can be used in data push scenarios between the operation platform and game clients. It ensures a million-level device connection, reduces resource utilization, and implements the management and control of complex message releases and subscriptions.

4

0 0 0
Share on

Aliware

51 posts | 4 followers

You may also like

Comments

Aliware

51 posts | 4 followers

Related Products

  • AliwareMQ for IoT

    A message service designed for IoT and mobile Internet (MI).

    Learn More
  • AlibabaMQ for Apache RocketMQ

    AlibabaMQ for Apache RocketMQ is a distributed message queue service that supports reliable message-based asynchronous communication among microservices, distributed systems, and serverless applications.

    Learn More
  • Message Queue

    Message Queue is a distributed message queue service that supports reliable message-based asynchronous communication among microservices, distributed systems, and serverless applications.

    Learn More
  • Gaming Solution

    When demand is unpredictable or testing is required for new features, the ability to spin capacity up or down is made easy with Alibaba Cloud gaming solutions.

    Learn More