Matchvs is the first commercial GameServer engine in China. This article will take its GameServer “custom server framework as an example to share.
Different from Skynet and other open source frameworks for game servers, Matchvs, as a commercial version of game server engine, essentially integrates a set of networking functions into a highly available SDK. Developers only need to adjust the required parameters according to the game logic and through the API interface provided by the SDK. But the encapsulated API also brings the limitation of not being extensible enough. To this end, Matchvs provides a custom server framework called “GameServer” in addition to SDK basic networking services to address more complex networking needs.
GameServer architecture
The high interactivity of GameServer and the engine, as well as the game’s low latency requirements, meant that the GS and the engine had better be physically close. The GS hosting service provided by Matchvs game cloud is actually a PaaS service (providing the development and operation environment of application programs). As a PaaS platform serving a large number of CP, the introduction of GS into Matchvs engine needs to solve the following key problems:
(1) How to meet the requirements of different languages, framework dependencies and operating environments?
(2) How to control GS of multiple CP, and how to limit and allocate resources?
(3) How to ensure automatic shrinkage, expansion, monitoring and high availability?
In view of the above problems, we containerized THE GS developed by CP, and solved the problems of framework, dependency and other environmental differences through the basic image. GS is integrated into K8S cluster, and namespace is used to isolate resource scheduling and allocation of different CP. GS is abstracted as service and uses the corresponding capacity expansion and high availability mechanisms of K8S.
GameServer SDK framework and interface
GameServer and Matchvs Server use high-performance RPC component communication based on long connection and binary protocol, which can well support Matchvs full duplex low latency communication, authentication authorization and other functional requirements.
The gameServer Framework provides the following features:
1. Receive and process messages such as room matching and battle data;
2. Provide the ability to actively push data for gameServer SDK;
3. In a standalone deployment scenario, register gameServer with Matchvs.
The gameServer SDK provides developers with apis for rooms, players, versus data, and more. This allows the developer to capture and control the state of each room and player, leading to richer game features.
Custom server logic. Developers use the gameServer SDK to implement customized features such as game progression control, mediation, data persistence, and more.
GameServer and Matchvs Server use high-performance RPC component communication based on long connection and binary protocol, which can well support Matchvs full duplex low latency communication, authentication authorization and other functional requirements.
The gameServer Framework provides the following features:
1. Receive and process messages such as room matching and battle data;
2. Provide the ability to actively push data for gameServer SDK;
3. In a standalone deployment scenario, register gameServer with Matchvs.
The gameServer SDK provides developers with apis for rooms, players, versus data, and more. Developers can capture and control this
Each room and player state, thus realizing richer game features.
Custom server logic. Developers use the gameServer SDK to implement customized features such as game progression control, mediation, data persistence, and more.