Discussion on the development of game service side (i)

Source: Internet
Author: User
Tags redis

Last year, from the traditional software company resigned, determined to turn the Internet, because of the love of the game, went to a game company, spent nearly 10 months, participated in the development of an action card player tour, the game finally online. Recently took time to write about the past on the game back to some of the feelings of it. Recently went to another game company to participate in the development of an MMO hand tour. Ready to start from the action card player to talk about MMO Hand tour, is also a game to develop some sentiment.

Action card games, relatively, the delay requirements are not so high, so the architecture is not so complex, but also worth learning. This article focuses on the structure of the card game.

The entire back-end architecture is divided into 5 main modules, followed by a new 2 modules, mainly used for cross-service battle.


The entire game is structured as shown above.

Each zone suit corresponds to such a set of processes:

Loginserver, DBServer, Gameserver, Worldserver,gmserver, and then Matchserver and pvpserver are used for cross service systems.

Each interprocess communication uses a socket, and the communication protocol uses PROTOBUF to serialize and deserialize the message packet. Account data and log information are stored in MySQL and the role data is stored in the Redis. This is the reason for this design, the role of the data requirements of high latency, and is often written, so the use of Redis can improve throughput, and account data and log information is basically unchanged, and the use of MySQL to meet the basic requirements, and stability is relatively high, but also facilitate the operation of the background maintenance. Here can optimize the place is to be able to separate the log out, made a log server.

The following is a brief introduction to the functions of each module, followed by the analysis of the meaning of such design, as well as the implementation of the function.

Loginserver: Log on to the server, there are mainly two kinds, the first is the center login service, all the client connection to the server to get the server list information, the second is the ordinary logon clothing, used to select the zone after the login verification.

Gameserver: A logical server that manages the basic logic of the game, including the basic systems.

Worldserver: World Server, management of some of the game's data, including portal data, arena, the world boss and other data.

DBServer: Database server, the main management of MySQL, including login verification and log storage.

GMSERVER:GM server, generally only one (can be made into multiple nodes), mainly for the operation of the background management, including mail delivery, prop hair

Send and so on function.

Matchserver: Generally only one (can be made into multiple nodes), mainly used for cross service system matching, and monitoring Pvpserver server.

Pvpserver: For managing cross-service battlefield, and gameserver using the same code, but initialization is not the same.

The structure of this action card game is basically the case, mainly because the number of people in a single suit is not too high, so such a framework can basically meet the actual demand.

The maximum number of online players in the game is generally not more than 5000, so the design is perfectly reasonable. If it's an MMO game, the architecture will have a big

The difference. The following will be some of the more important places such as login process, network low-level, combat systems, and other services to focus on analysis, and give

Some optimization schemes.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.