In the previous article, we introduced how to use pomelo to build a chat server. In this article, we show you how to use the Pomelo framework to build an MMO RPG server, and analyze its design ideas and implementation methods. In order to help you better understand and use the pomelo framework, Understanding pomelo Framework game development of the basic process, the use of methods and design concepts.
In this paper, the game server architecture, just to illustrate the pomelo development concept and design ideas, not based on pomelo development of the only solution, developers can completely according to their actual application environment design different server architecture.
Before you start
Pomelo Framework and MMO RPG
We have introduced the Pomelo architecture in the first article in this series. Let's start with a brief review of what Pomelo has to offer for our game development:
Extensible server architecture. The server-side is abstracted from the pomelo, the server is divided into the front-end server connecting the bearer chain and the back-end server responsible for the business logic, and provides convenient and efficient distributed extension support, so that the user can realize the extension of the service end without modification or even change.
Complete Communication framework: Pomelo a complete encapsulation of the communication between the client and the server, between the server and the server. Developers only need to follow the default rules to fill out the service code to complete the interface of the release and call, regardless of the internal implementation.
A lot of game development base: In addition to the basic server framework, Pomelo also provides a lot of game development need to use the basic library, such as task scheduling, AI control, Seek road, etc., and these libraries will be further improved with the development of pomelo.
Based on Node.js lightweight development environment, as well as a large number of modules. Compared with the traditional development language, Node.js has a lightweight, fast feature (0.3 version of the launch of a server consisting of 10 servers integration only need less than 4S). And the active open source community also provides a large number of third-party modules.
As an introduction to pomelo game development, the focus of this article will be on the construction of the game infrastructure, so this article will mainly introduce the following three aspects of the content: the game server-side of the building, communication with the client, the expansion of the servers.
The reference examples in this article
We use demo Treasures as a reference example for this article, the screenshot of the game is as follows: