CN101795275B - Parallel optimization technology of multiplayer online network game server - Google Patents

Parallel optimization technology of multiplayer online network game server Download PDF

Info

Publication number
CN101795275B
CN101795275B CN2010101052429A CN201010105242A CN101795275B CN 101795275 B CN101795275 B CN 101795275B CN 2010101052429 A CN2010101052429 A CN 2010101052429A CN 201010105242 A CN201010105242 A CN 201010105242A CN 101795275 B CN101795275 B CN 101795275B
Authority
CN
China
Prior art keywords
entity
server
interest
frame
hash table
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN2010101052429A
Other languages
Chinese (zh)
Other versions
CN101795275A (en
Inventor
赵沁平
杨硕磊
郝爱民
***
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beihang University
Original Assignee
Beihang University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beihang University filed Critical Beihang University
Priority to CN2010101052429A priority Critical patent/CN101795275B/en
Publication of CN101795275A publication Critical patent/CN101795275A/en
Application granted granted Critical
Publication of CN101795275B publication Critical patent/CN101795275B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Multi Processors (AREA)

Abstract

The invention relates to a parallel optimization technology of a multiplayer online network game server. The method comprises the following four steps: performing parallel processing to the two tasks of generating entity interest area update hash table and synchronous hash table based on the mode of group task, wherein the two hash tables can ensure that the server can not calculate the information of the interest area of entity and synchronous entity frame by frame; performing parallel computation to the interest list of each entity based on the decomposition mode of data, wherein the interest list records which client end is interested in the entity; performing parallel processing to the game logic of the server based on the decomposition mode of data, wherein the game logic comprises entity position update, damage computation, collision detection and the like; and performing parallel synchronization to the information of the client end and server based on the decomposition mode of data. The invention distributes calculated loads such as interest filtration and server logic treatment to a plurality of treatments, thus increasing the real-time property of game and the number of loaded players.

Description

The parallel optimization technology of the online network game server of a kind of many people
Technical field
The present invention relates to a kind of optimisation technique of utilizing the server end of multiprocessor in the online online game of many people
Background technology
In the online online game of many people based on client server mode, server need be the client of the forwards of a client generation to other.In fact not all client all is concerned about this message, transmits dead message and has caused that the network bandwidth excessively takies and the resource lot of consumption, thereby make the network bandwidth and resource become the bottleneck of influence response time-delay and server frame rate.The interest administrative skill under the prerequisite that increases processor load, has effectively been alleviated bandwidth occupancy and resource consumption through calculating the method to the interested client of incident.
The interest filtration technology results from the real-time distribution analogue system of supporting DIS (Distributed Interactive Simulation) agreement; Mainly find application in fields such as Military Simulation, MMOGs; Like ModSAF (ModularSemi-Automated Forces) is a constructing analog system towards septic yanks, is created in the nineties.NPSNET (Naval Postgraduate School NET) [6] adopts hexagonal mesh to come the actual circle " area-of-interest " of approximate expression.When the entity propulsion, after it added the limit, forward position of new grid, the tail that leaves old grid was before the limit, and the radius of this grid is " area-of-interest " of entity.
The interest administrative skill has increased the computational load of server when having filtered useless message through computational entity interesting areas (AOI).
In order to support a large amount of computational loads; The multiserver technology is a solution; The multiserver technology is divided into several regions with virtual scene, and each server is responsible for a zone, and the method with the maintained shadow object between zone and zone realizes seamless moving.Yet the data sync of safeguarding multiserver has increased additional calculation expense and offered load.
Emerging in recent years single-chip multi-core system structure is a kind of massively parallel processing(MPP) that the chip level of multithreading is supported.Make the flow process parallelization of server, the computing capability that makes full use of multiprocessor can increase the number of players that server is supported.
Obtain more high performance concurrent application and need adopt suitable programming model in order to develop the concurrency of this chip fast.OpenMP becomes a rational candidate as the industrial standard of writing the concurrent program of shared drive system.Advantages such as OpenMP originates from ansi standard, and it has simply, transplantability is good and can expand are industrial standards sharing the storage system programming.OpenMP is not a new language, and it is the expansion to basic language (like Fortan77, Fortan90, C, C++ etc.).Define in the OpenMP standard guidance command, Runtime Library and environmental variance, can make the user under the prerequisite of the portability of the program of assurance, according to standard with the progressively parallelization of existing serial program.
The present invention is with the parallelization of server flow process, and the algorithm after utilization OpenMP will walk abreast is realized.
Summary of the invention
The technical problem that the present invention will solve is: in the online online game of many people, overcome the deficiency that server serial flow process can only be utilized uniprocessor, can make full use of the resource of multiprocessor.
The technical scheme that the present invention adopts is: with flow process parallelizations such as the interest filtration of server, synchronizing informations, its characteristics are to have comprised following four steps:
(1) the pattern parallel processing based on minute group task generates entity region-of-interest renewal hash table and synchronous these two tasks of hash table.Thereby use these two hash tables can make server increase the number of players that server can be born by the region-of-interest of frame computational entity and the information of synchronization entity;
(2) based on the interest list of the resolution model parallel computation entity of data, it is interested in this entity that which client is this interest list write down;
(3) based on the game logic of the resolution model parallel processing server of data, game logic comprises that provider location upgrades, injures calculating, collision detection etc.;
(4) based on the information of the resolution model parallel synchronous client and server of data.
What said entity region-of-interest upgraded hash table and the record of hash table synchronously is that each frame need upgrade region-of-interest and two two-dimensional arrays that need synchronization entity information.
Suppose that server requirement travels through all entities and carries out the region-of-interest entity and upgrade in the k frame, and hypothesis has N entity, then each frame entity number that need upgrade is that N/k is individual.In order to support the parallel data resolution model, designed a two-dimensional array AoIRefreshTable here IjStore the list of entities that every frame need upgrade.If c representes current frame number, one-dimension array AoIRefreshTable iThe list of entities that need upgrade when representing the i=c%k frame.Fig. 1 upgrades hash table for the region-of-interest when k equals 30.
In addition based on similar strategy; The entity state that each frame of server end is safeguarded according to certain logic; These logics comprise physical rules, game rule etc., upgrade but needn't carry out entity state to client by frame, can carry out (comprising positional information, motion state etc.) synchronously at a distance from frame.The cycle of assumes synchronization is the s frame, and server adopts a two-dimensional array SYNRefreshTable IjStore every frame and need the synchronizing entity tabulation.Suppose that c representes current frame number, one-dimension array SYNRefreshTable iNeed the synchronizing entity tabulation when representing the i=c%s frame.
Use this two arrays, the region-of-interest that needn't every all entities of frame and the information of all entities have synchronously reduced the load of network and processor.
Like the quantity of sporocarp change (if having that the player withdraws from, lands, entity destruction etc.) is arranged; Then need upgrade hash table and generate the synchronous hash table of entity from newly-generated entity region-of-interest; Generative process is for same frame no dependence; Can use the section compiling guidance statement of OpenMP, carry out tasks in parallel based on the resolution model of minute group task.
In the interest list of said parallel computation entity, it is interested in this entity that which client is interest list write down.
The region-of-interest that in traditional server flow process, needs all entities of calculating of serial.
In order to break through with limit; The present invention uses region-of-interest to upgrade hash table AoIRefreshTable and writes down the entity that this frame need calculate region-of-interest; Suppose that server requirement travels through all entities and carries out the renewal of region-of-interest entity in the k frame; And hypothesis has a N entity, and then each frame entity number that need upgrade is that N/k is individual.The entity number that needs to upgrade has reduced to N/k by N.
There are not data dependence and order correlation between the renewal of the region-of-interest of this N/k entity mutually.Can use resolution model to carry out parallel optimization based on data.For example on a server that two processors are arranged, can use processor 1 to calculate [1, N/2k-1] this N/2k-1 entity, processor 2 calculating [N/2k, N/k] these entities have been realized the parallel processing of data like this.
The game logic of said parallel processing server is that the parallel computation provider location upgrades, injures calculating, collision detection etc.
Server need be handled the game logic of all entities at each frame, supposes that whole virtual scene has N entity, in traditional server flow process, is needing handle this N entity successively.
Because in the process of the calculating game logic of entity, there is not correlation between mutually, the resolution model based on data among the present invention carries out parallel optimization.For example on a server that two processors are arranged, can use processor 1 to calculate [1, N/2-1] this N/2-1 entity, processor 2 calculating [N/2, N] these entities have been realized the parallel processing of data like this.
The information of said parallel synchronous client and server is the variation of parallel computation client, and these variations and client are kept synchronously.
In traditional server flow process, server needs the information of synchronous all entities of each frame serial.
Strategy based on similar parallel renewal region-of-interest; The present invention uses the synchronous hash table SYNRefreshTable of entity to write down this frame need count synchronizing entity; Suppose that server has N entity; Requirement travels through all entities and carries out synchronously in the k frame, then to need the synchronizing entity number be N/k to each frame.Need the synchronizing entity number to reduce to N/k by N.There are not data dependence and order correlation between the renewal of the region-of-interest of this N/k entity mutually.Adopt strategy run simultaneously identical with the interest list of parallel computation entity.
Description of drawings
Renewal hash table when Fig. 1 is 30 frames for server frame rate used in the present invention;
Fig. 2 is not for using traditional server flow process figure of parallel optimization;
The server flow process figure that Fig. 3 makes for the present invention;
The online game prototype that Fig. 4 realizes for the present invention;
Fig. 5 is for using renewal hash table of the present invention, and changing the update cycle under specific circumstances is 1,2,4, and 8,15,30 o'clock, the CPU usage of server end;
Fig. 6 for the present invention under specific circumstances, the performance representation of data on multiprocessor.
Embodiment
In order to realize and verify the present invention; We design the game on line prototype TankWar 0.1 that has realized instant strategic type; The client-side program of recreation uses Microsoft DirectX DLL, has realized simple three-dimensional scenic drafting: comprise the terrain mesh generation based on height map, the sky sylphon of dynamic texture.The interface of client is as shown in Figure 4.
The server end of recreation adopts and based on the OpenMP DLL algorithm is handled.Processing procedure is utilized compiling guidance statements such as the for, section of OpenMP.
At first, server end receives and handles player's message.This step server receives the message of client, and message is made response.For example message is the new player of adding message, directly in player's chained list, adds player's entity and notifies other client to have the player to add.And notify interested player's entity to delete message.If the message of mobile object, this object marker for moving, and assignment such as destination, speed of giving object.
The quantity of second step like sporocarp has the then parallel entity region-of-interest that generates of change to upgrade hash table and hash table synchronously, has designed a two-dimensional array AoIRefreshTab1e here IjStore the list of entities that every frame need upgrade.If c representes current frame number, one-dimension array AoIRefreshTable iThe list of entities that need upgrade when representing the i=c%k frame.Fig. 1 upgrades hash table for the region-of-interest when k equals 30.The realization that generates synchronous hash table is identical with the method that generates entity region-of-interest renewal hash table, adopts a two-dimensional array SYNRefreshTable IjStore every frame and need the synchronizing entity tabulation., one-dimension array SYNRefreshTable iNeed the synchronizing entity tabulation when representing the i=c%s frame.These two steps have been used the section compiling guidance statement of OpenMP, carry out tasks in parallel based on the resolution model of minute group task.The false code that realizes is following:
if?(objModified)
If upgrading, the change of { // have object, renewal interest list be listed as the diffusing table of the synchronous row of the table that looses
#pragma?omp?sections?private(i)
{
#pragma omp section // renewal interest list is upgraded the diffusing table of row
for(Object i;in?objArray)
AOIFreshTable[i%IMFrame].push_back(Object i);
#pragma omp section // renewal is the diffusing table of row synchronously
for(Object i;in?objArray)
SYNFreshTable[i%SYNFrame].push_back(Object i);
}
objModified=false;
}
The 3rd step was upgraded interest list, gave the client player with the change notification before and after the interest list.Each entity has a NewAoIList and LastAoIList to write down in this frame (this computation cycles of server) and the previous frame (the last computation cycles of server) set to interested other entity of this entity respectively.
After having upgraded the region-of-interest of entity, upgrade player's discovery entity and the message that entity leaves, for entity in objANewAoIList, and not in the LastAoIList of objA.Then send and find entity message to the affiliated player playerA of objA.Otherwise for entity in the LastAoIList of objA, and not in the NewAoIList of objA.The message of then leaving to the affiliated player playerA sending entity of objA.
Calculate interest list and guide statement, carry out tasks in parallel based on the resolution model of data with the for compiling that the change notification before and after the interest list adopts OpenMP for the client player.
The 4th step processing server game logic.In this step processing attack, injure calculating, information such as collision detection.This step adopts omp for instruction to be deployed on a plurality of threads and carries out, and realizes the parallel computation of data.
The 5th step was upgraded player's entity state.After preceding step calculating; The entity state of server end change (like positional information, motion state etc.); This step carries out state with the information in the hash table SYNRefreshTable to player's entity according to entity state and upgrades; Adopt omp for instruction will be deployed on a plurality of threads and carry out, realize the parallel computation of data.
Above-mentioned realization false code is following:
The interest list that #pragma omp for // this frame of renewal need upgrade, and feed back to client
for?(Object i;in?AOIFreshTable[framecount%IMFrame])
{
GenerateAOIList (Object i); The interest list that this frame of // renewal need upgrade
ReflectPlayerAOI(Object i);
} // feed back to client
#pragma?omp?for
// parallel processing, the server logic of this frame (can here be handled and attack as colliding, moving
Information such as hit)
for?(Object i;in?objArray)
HandleLogic(Object i);
#pragma?omp?for
// this frame needs synchronous client synchronously
for?(Object i;in?SYNFreshTable[framecount%SYNFrame])
SynchPlayer(Object i);
Fig. 3 is the flow chart of server end on two processors behind the employing foregoing invention parallel optimization, can contrast serial flow process (Fig. 2) contrast serial and parallel difference.
As shown in Figure 5, be of the influence of the value of region-of-interest update cycle IMFrame to the load of server CPU.This test realizes in local area network (LAN), guarantees that server frame speed is 25 frame per seconds.It is 50 that the position synchronous cycle is set, and promptly positional information of 50 frame synchronization starts 25 clients altogether in the local area network (LAN), and each client adds 200 entities.When the server end Thread Count equals the processor number, change entity by the update cycle IMFrame of list of players interested, the occupancy of testing server end CPU.Test data can be found out the inversely prroportional relationship that the load by the update cycle IMFrame of list of players interested and CPU of entity becomes.This shows that the invention of region-of-interest renewal hash table can reduce the computational load of server to a great extent.
Fig. 6 is the performance performance of this invention on multiprocessor servers, and it is 50 that the position synchronous cycle is set, i.e. positional information of 50 frame synchronization.In order to increase the load of CPU, the every frame of server end carries out interest filtration.Start 25 clients in the local area network (LAN) altogether, each client adds 200 entities successively.Test the largest frames speed that serial algorithm on different server (single-threaded) and parallel algorithm (thread be processor number two times time) server can keep respectively and calculate speed-up ratio and CPU availability.
Speed-up ratio S (P) is the time of implementation of program under the serial situation and the ratio of executed in parallel time, and definition is as doing
S ( P ) = T ( 1 ) T ( P )
Efficient E (P) is defined as speed-up ratio divided by the processor number, and shown in the following formula, wherein P is the processor number.
E ( P ) = S ( P ) P = T ( 1 ) PT ( P )
Every frame was consuming time when wherein T (1) was for serial, and T (P) is the consuming time of concurrent program.
Test specification after employing OpenMP carries out parallel optimization, utilized the resource of CPU fully, the largest frames speed that makes service to keep is able to promote.When Thread Count the time greater than the check figure of CPU, can not rise and do not have a small amount of decline on the contrary because thread derives from the overhead performance of polymerization, as in the table 6.6, on the server of 4 processors, slightly fall when performance is than 4 threads in the time of 8 threads.This has explained that this invention can on multiprocessor servers, making server performance promote, can find application in the online online game of many people.

Claims (2)

1. the parallel optimization method of the online network game server of people more than a kind is characterized in that comprising following four steps:
(1), generates the entity region-of-interest and upgrade hash table and hash table synchronously based on the parallel processing of the pattern of minute group task; Thereby use these two hash tables to make server increase the number of players that server can be born by the region-of-interest of frame computational entity and the information of synchronization entity;
(2) upgrade hash table according to the region-of-interest that obtains in the step (1), based on the interest list of the resolution model parallel computation entity of data, said interest list has write down the interested client of this entity;
(3) based on the game logic of the resolution model parallel processing server of data, game logic comprises that provider location upgrades, injures calculating, collision detection;
(4) according to the synchronous hash table that obtains in the step (1), based on the information of the resolution model parallel synchronous client and server of data;
Said needn't specifically being by the region-of-interest of frame computational entity and the information of synchronization entity:
(a) adopt at a distance from frame region-of-interest entity update strategy: suppose that server requirement travel through all entities and carries out the region-of-interest entity and upgrade in the k frame, and suppose to have N entity that then each frame entity number that need upgrade is that N/k is individual;
(b) like the sporocarp number change is arranged, then calculate region-of-interest and upgrade hash table and hash table synchronously, these two tabulations have been write down each frame respectively and need have been upgraded and synchronizing entity, are kept in the two-dimensional array;
(c) adopt strategy run simultaneously identical with the interest list of parallel computation entity; Server end is safeguarded entity state by frame according to certain logic; These logics comprise physical rules, game rule, upgrade but by frame client is not carried out entity state, but carry out synchronously at a distance from frame.
2. the parallel optimization method of the online network game server of a kind of many people according to claim 1, the processing that wherein said pattern based on minute group task is parallel and based on the game logic of the resolution model parallel processing server of data is further characterized in that:
(1) generation entity region-of-interest upgrades the process of hash table and hash table synchronously, does not have dependence successively each other, does not also have data dependency, therefore carries out parallel processing based on the pattern of minute group task;
(2) interest list of computational entity; The game logic of processing server, these three steps of the information of sync client and server need be handled a plurality of entities, do not have dependence successively between the entity that is processed is mutual; Therefore there is not data dependency, based on the resolution model parallel processing of data yet.
CN2010101052429A 2010-02-03 2010-02-03 Parallel optimization technology of multiplayer online network game server Expired - Fee Related CN101795275B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010101052429A CN101795275B (en) 2010-02-03 2010-02-03 Parallel optimization technology of multiplayer online network game server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010101052429A CN101795275B (en) 2010-02-03 2010-02-03 Parallel optimization technology of multiplayer online network game server

Publications (2)

Publication Number Publication Date
CN101795275A CN101795275A (en) 2010-08-04
CN101795275B true CN101795275B (en) 2012-10-31

Family

ID=42587700

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010101052429A Expired - Fee Related CN101795275B (en) 2010-02-03 2010-02-03 Parallel optimization technology of multiplayer online network game server

Country Status (1)

Country Link
CN (1) CN101795275B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699413B (en) * 2013-12-24 2017-05-03 北京世界星辉科技有限责任公司 Method and system for optimizing game operating environment, client and server
CN105117296B (en) * 2015-09-11 2018-10-12 网易(杭州)网络有限公司 The method and system of the state of object in synchronous game
CN108479072A (en) * 2018-03-23 2018-09-04 广州悦世界信息科技有限公司 A kind of method of data synchronization and system for policy class game large scene
CN110860086B (en) * 2019-11-08 2023-08-15 武汉微派网络科技有限公司 Data processing method, readable storage medium, and electronic device
CN111459626B (en) * 2020-03-11 2021-06-01 完美世界(北京)软件科技发展有限公司 Method and device for realizing non-branching seamless game world

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266633A (en) * 2006-11-29 2008-09-17 优万科技(北京)有限公司 Seamless super large scale dummy game world platform

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101266633A (en) * 2006-11-29 2008-09-17 优万科技(北京)有限公司 Seamless super large scale dummy game world platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Rob Minson."An Evaluation of Push-Pull Algorithms in Support of Cell-Based Interest Management".《Proceeding DS-RT "07 Proceedings of the 11th IEEE International Symposium on Distributed Simulation and Real-Time Applications IEEE Computer Society》.2007,39-47.

Also Published As

Publication number Publication date
CN101795275A (en) 2010-08-04

Similar Documents

Publication Publication Date Title
Navarro et al. A survey on parallel computing and its applications in data-parallel problems using GPU architectures
CN101795275B (en) Parallel optimization technology of multiplayer online network game server
Kuzmin et al. Parallel overlapping community detection with SLPA
US20110057937A1 (en) Method and system for blocking data on a gpu
Lastra et al. A high performance memetic algorithm for extremely high-dimensional problems
Song et al. Supporting real-world network-oriented mesoscopic traffic simulation on GPU
Zheng et al. Architecture-based design and optimization of genetic algorithms on multi-and many-core systems
Zhong et al. Medusa: A parallel graph processing system on graphics processors
Makarov et al. Supercomputer technologies in social sciences: Agent-oriented demographic models
Xiao et al. OpenABLext: An automatic code generation framework for agent‐based simulations on CPU‐GPU‐FPGA heterogeneous platforms
Wu et al. GPU-accelerated large scale analytics
Arenas et al. GPU computation in bioinspired algorithms: a review
Husselmann et al. Spatial data structures, sorting and gpu parallelism for situated-agent simulation and visualisation
Fakhi et al. New optimized GPU version of the k-means algorithm for large-sized image segmentation
Dinneen et al. Using OpenCL for implementing simple parallel graph algorithms
Wenjie et al. An expansion-aided synchronous conservative time management algorithm on GPU
Sui et al. On the distributed orchestration of stochastic discrete event simulations
Tzy-Luen et al. Parallel Cuckoo Search algorithm on OpenMP for traveling salesman problem
Kosiachenko Efficient GPU Parallelization of the Agent-Based Models Using MASS CUDA Library
dos Santos et al. Parallel multi-speed pursuit-evasion game algorithms
Yasar et al. PGAbB: A Block-Based Graph Processing Framework for Heterogeneous Platforms
Perelygin et al. Graphics processing units and open computing language for parallel computing
Vigueras et al. On the use of GPU for accelerating communication-aware mapping techniques
Jin Associative Operations from MASC to GPU
Quang-Hung et al. Implementing genetic algorithm accelerated by Intel Xeon Phi

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121031

Termination date: 20150203

EXPY Termination of patent right or utility model