-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Introduction to Lord of Pomelo
Lord of pomelo (LOP) is a distributed MMO RPG game Demo based on pomelo framework.
Lord of Pomelo covers core content of the mainstream MMORPGs: it has three game scenes, eight different role types, various game tasks, and a variety of items and weapons, as well as a variety of monsters and boss. Players can shuttle multiple virtual scene, complete various of tasks, enhance the level and interact with other players.
In order to investigate the ability of the pomelo server response, LOP with a real-time battle mode, most of the player's behavior behavior, including attack, use skills, the seizure of the props and the use of real time. After multiple rounds of optimization to achieve the load capacity of the single scene 800, the same time can guarantee a good response time, specific optimization of the process and results see (Link).
LOP is developed under pomelo framework standard. by using cluster server management, it can support 800 concurrent access in a single scene. And the capability can be increased by adding more scene servers.
As shown above, LOP including two types of servers: game-server and web-server. web-server is a http web server, which used as the entry of the game demo. It also includes player register and OAuth authentication logic. After player complete registration and verification, he(or she) will enter the game-server, which supports real game experience. Game-server is the hard core of LOP server cluster, it includes a websocket server cluster as front-end server and a game logic server cluster as backend server, game-server architecture is shown below:
The Clients in the above picture can be any kind of client support support websocket。 The client in LOP is implement by html5, it can be run not only at PC browser, but also any html5 compatible terminal(such as iphone or high performance android device). Players in different platform can interaction with each others.
The Game-server also can be divided into two different types: Frontend server and Backend Server. Frontend server is a websocket server cluster, it is used to communicate with websoket clients, response the client request and forwarding or filtering message.Frontend servers are also used to broadcasting messages to client.
Backend Servers are mainly used to process the game logic, including various games server types. Wherein the area server is the most important server。 It is primarily responsible for the maintenance of the game scene: update the game data regularly and maintenance the game scene operation, these features need multiple modules cooperative work co complete. Scene server is also scalable, each scene corresponding to a single area server, by increasing the scenes in a game, you can balance the load to multiple servers.
Lord of Pomelo is developed under Pomelo framework standard, the boot process adopt Pomelo's startup mode, [pomelo start, please read before reading the following content]
App.js is the entrance of LOP start process, it's duty mainly includes three different parts: loading components, start the master server, start other servers.
In LOP use script-based statistics method, by running custom scripts , the monitor module can collect servers' running data and information to generate reports.
![Monitor] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/monitor.png)
Lord of The Pomelo startup also load area configuration to create the mapping between scenes and area servers.
![Area map] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/areaMap.png)
In order to routing among the servers, LOP loaded custom routing components.It uses scene mapping to make sure players can be routed to correct area server.
![Route] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/route.png)
In addition to the server generic configuration, app is also responsible for the initialization of the different services, such as global server initialization and the area server initialization, as well as path finding servers. The initialization process will distinguish between different servers, depending on the type of the server.
![Area init] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/areaInit.png)
Path finding services and mysql initialization.
![Path mysql] (http://pomelo.netease.com/resource/documentImage/lordofpomelo/path_mysql.png)
The Master component responsible for starting all other services. The startup process is divided into two step: in step one, master will start all other server via ssh command. After a server is started, the monitor component will connect to master, indicating that the server is booted. At step two, after all the server is booted, mater will call all the server on afterStart interface, to do after start job.
- [Lord of The Pomelo code structure] (https://github.com/NetEase/pomelo/wiki/Lord-of-Pomelo-%E4%BB%A3%E7%A0%81%E7%BB%84%E7%BB%87)
- [Lord of The Pomelo server] (https://github.com/NetEase/pomelo/wiki/Lord-of-Pomelo-%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%BB%8B%E7%BB%8D)