CN112245932B - Game resource processing method and device and server device - Google Patents

Game resource processing method and device and server device Download PDF

Info

Publication number
CN112245932B
CN112245932B CN202011136979.7A CN202011136979A CN112245932B CN 112245932 B CN112245932 B CN 112245932B CN 202011136979 A CN202011136979 A CN 202011136979A CN 112245932 B CN112245932 B CN 112245932B
Authority
CN
China
Prior art keywords
resource
game
current
target
point set
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.)
Active
Application number
CN202011136979.7A
Other languages
Chinese (zh)
Other versions
CN112245932A (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011136979.7A priority Critical patent/CN112245932B/en
Publication of CN112245932A publication Critical patent/CN112245932A/en
Application granted granted Critical
Publication of CN112245932B publication Critical patent/CN112245932B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a processing method and device of game resources and server equipment, relates to the technical field of games, and solves the technical problem that a server cannot bear a large amount of game resource data at present. The method comprises the following steps: acquiring the position of the game resource in a game scene; clustering a plurality of game resources based on the positions to obtain a plurality of resource point sets; and creating resource management objects according to the resource point sets, wherein each resource management object corresponds to one resource point set, and the resource management objects are used for managing the resource data of game resources in the corresponding resource point sets, so that the number of the resource management objects can be reduced, and the resource management efficiency can be improved.

Description

Game resource processing method and device and server device
Technical Field
The present application relates to the field of game technologies, and in particular, to a method and an apparatus for processing a game resource, and a server device.
Background
In many game scenarios of online games, there are a certain number of game resources, such as vegetation, treasures, trash, etc. At present, the number of game resources to be managed in the traditional online game is small, about tens of game resources, so that the server only needs to process the game resources by adopting a simple process.
However, if the game scenario of the online game is very large (hundreds of square kilometers), the number of game resources involved therein is very large, and in the level of millions to tens of millions, the CPU overhead and the memory overhead at the time of starting up the server are both large, and the conventional server processing method cannot satisfy the management of a large number of game resources, so that the server cannot bear a large amount of game resource data.
Disclosure of Invention
The invention aims to provide a processing method and device of game resources and server equipment, so as to solve the technical problem that a server cannot bear a large amount of game resource data at present.
In a first aspect, an embodiment of the present application provides a method for processing a game resource, where the method includes:
acquiring the position of the game resource in a game scene;
clustering a plurality of game resources based on the positions to obtain a plurality of resource point sets;
and creating resource management objects according to the resource point sets, wherein each resource management object corresponds to one resource point set, and the resource management objects are used for managing the resource data of game resources in the corresponding resource point sets.
In one possible implementation, after the step of creating the resource management object from the set of resource points, the method further includes:
and loading a target resource management object corresponding to the game resource in a first preset range of the current position based on the current position of the virtual object controlled by the client in the game scene, so that the client can acquire resource data managed by the target resource management object.
In one possible implementation, the overall occupation area of the game scene is uniformly divided into a plurality of occupation areas according to a preset unit area; the step of loading the target resource management object corresponding to the game resource in the first preset range of the current position based on the current position of the virtual object controlled by the client in the game scene, so that the client obtains the resource data managed by the target resource management object, includes:
determining a target occupation area within a first preset range of the current occupation area from a plurality of occupation areas based on the current occupation area of the virtual object in the game scene;
and loading a target resource management object corresponding to a target resource point set in the target occupation area, so that the client acquires target resource data managed by the target resource management object and displays and/or controls target resources in the target resource point set based on the target resource data.
In one possible implementation, the step of determining, from a plurality of the footprints, a target footprints within a first preset range of the current footprints based on the current footprints in which the virtual objects are located in the game scene, includes:
determining at least one occupation area adjacent to the current occupation area from a plurality of occupation areas based on the current occupation area of the virtual object controlled by the client in the game scene;
and determining at least one occupied area adjacent to the current occupied area as a target occupied area.
In one possible implementation, after the step of creating the resource management object according to the set of resource points, the method further includes:
and writing the resource data managed by each resource management object into a Redis database based on a plurality of the resource management objects, wherein the Redis database is used for inquiring and/or calling the resource data managed by the resource management objects by loading the resource management objects.
In one possible implementation, after the step of writing the resource data managed by each of the resource management objects into the dis database based on the plurality of resource management objects, the method further includes:
Unloading the resource management object which does not have loading event in the preset time from the Redis database.
In one possible implementation, the step of clustering a plurality of game resources based on the positions to obtain a plurality of resource point sets includes:
traversing a plurality of said game resources, performing the following steps for each of said game resources:
inquiring whether a generated resource point set exists in a second preset range of the target position according to the target position of the current game resource in the game scene;
and if the generated resource point set exists in the second preset range, adding the current game resource into the generated resource point set nearest to the current game resource.
In one possible implementation, after the step of adding the current game resource to the generated resource point set closest to the current game resource, the method further includes:
and updating the central position of the collection based on the collection of the resource points added into the current game resource.
In one possible implementation, after the step of querying whether the generated resource point set exists in the second preset range of the target position according to the target position of the current game resource in the game scene, the method further includes:
If the generated resource point set does not exist in the second preset range, a new resource point set is newly established, the current game resource is added into the new resource point set, and the target position is used as the central position of the new resource point set.
In one possible implementation, the resource data includes any one or more of the following:
the identification of the game resource, the model path, the position coordinates of the game resource in the game scene and the rotation information in the game scene.
In a second aspect, there is provided a processing apparatus for a game resource, the apparatus comprising:
the acquisition module is used for acquiring the position of the game resource in the game scene;
the clustering module is used for clustering a plurality of game resources based on the positions to obtain a plurality of resource point sets;
the creation module is used for creating resource management objects according to the resource point sets, wherein each resource management object corresponds to one resource point set, and the resource management objects are used for managing the resource data of game resources in the corresponding resource point set.
In a third aspect, an embodiment of the present application further provides a server device, including a memory, and a processor, where the memory stores a computer program that can be executed on the processor, and the processor executes the method according to the first aspect.
In a fourth aspect, embodiments of the present application further provide a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method of the first aspect described above.
The embodiment of the application brings the following beneficial effects:
according to the game resource processing method, device and server side equipment, a plurality of game resources can be clustered based on the positions of the game resources in a game scene to obtain a plurality of resource point sets, then resource management objects are created according to the resource point sets, each resource management object corresponds to one resource point set, the resource management objects are used for managing resource data of game resources in the corresponding resource point sets, in the scheme, a large number of resource data are clustered, the resource data in each clustered resource point set are effectively managed by only one resource management object, the number of the resource management objects is only the number of the resource point sets, the number of the resource management objects is greatly reduced, and the effective management of the resource management objects is more convenient according to the management mode that the resource management objects are distributed according to the positions of the game resources in the game scene, so that the server can bear the large number of resource data and effectively manage the resource data.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for processing game resources according to an embodiment of the present application;
FIG. 2 is an example of an original file in a method for processing game resources according to an embodiment of the present application;
FIG. 3 is an example of a resource file in the method for processing game resources according to the embodiment of the present application;
FIG. 4 is an example of clustering results in the processing method of game resources provided in the embodiments of the present application;
FIG. 5 is a diagram illustrating an example of data stored in a database in a method for processing game resources according to an embodiment of the present application;
FIG. 6 is an example of a floor area in a method for processing game resources according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a processing device for game resources according to an embodiment of the present application;
fig. 8 shows a schematic structural diagram of a server device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The terms "comprising" and "having" and any variations thereof, as used in the embodiments of the present application, are intended to cover non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed but may optionally include other steps or elements not listed or inherent to such process, method, article, or apparatus. At present, the traditional online game resource management quantity is less, and is about tens of game resources, so that a server does not need special processing, a single process is the whole game world, the quantity of resources required to be managed for a single scene is limited, and the single process is adopted for simple processing. However, the game scene under the world technical framework (such as the MobileServer world technical framework) is huge, and a general world game scene is about three hundred square kilometers, and a large amount of game resources exist in the world game scene.
The applicant finds that the above-mentioned traditional online game resource management method has the following defects in the long-term game research process: (1) The traditional single-process processing method cannot meet the requirement of managing a large amount of game resources, so that a server cannot bear a large amount of game resource data by utilizing a single process. (2) The lack of game resources which are not accessed by users for a long time in the game is effectively managed, so that the part of game resources occupy server resources for a long time, and the performance consumption is increased.
For the game scene under the technical framework of the world, the performance consumption of the process of managing a large number of game resources by the server is larger, and the performance of the server can not be considered while effectively managing a large number of game resources in the server at present.
Based on the above, the embodiments of the present application provide a method and an apparatus for processing game resources, and a server device, by which the technical problem that a server cannot bear a large amount of game resource data at present can be alleviated.
Embodiments of the present invention are further described below with reference to the accompanying drawings.
Fig. 1 is a flow chart of a processing method of game resources according to an embodiment of the present application. The method may be applied to a server-side device (e.g., a server) of a game, among others. As shown in fig. 1, the method includes:
Step S110, the position of the game resource in the game scene is obtained.
The game resource may be any resource in the game scene that can interact with the player. Such as vegetation, treasures, trash, etc. resources that the player may collect.
In practical applications, the game scenario in the embodiments of the present application may be a game scenario under the above-mentioned world technical framework. The location of the game resource in the game scene may be represented in the form of scene coordinates.
Step S120, clustering a plurality of game resources based on the positions to obtain a plurality of resource point sets.
In the embodiment of the application, the server device may cluster a plurality of game resources according to the rule of proximity, that is, game resources with relatively close positions are clustered into the same class. In this step, the server device may traverse each game resource in the game original data file, cluster each game resource according to the location rule, and generate resource point sets corresponding to different clustering results.
Step S130, creating a resource management object according to the resource point set.
Each resource management object corresponds to one resource point set, and the resource management object is used for managing resource data of game resources in the corresponding resource point set.
It should be noted that a resource management object (Entity) is a concept in an application domain, and refers to an Entity object, which represents any hardware or software process that may send or receive information in a computer network. In general, an entity object is a particular software module. The resource management object in the embodiment of the present application is an entity object for managing resource data.
In the embodiment of the application, each resource point set clustered by the server device corresponds to one resource management object to manage the data of the resources, and the clustered data processing mode can greatly reduce the number of resource management objects of the resource management entity which need to be created when the server device operates, so that the server can bear a large amount of resource data, and the management mode of distributing the resource management objects according to the positions of game resources in a game scene is also more convenient for the efficient management of the resource management objects, so that the server can effectively manage a large amount of resource data.
In practical application, the processing method of the game resources provided by the embodiment of the application can also be used as a server massive (millions of levels) game resource management method based on a world technical framework (such as a mobile server), so that massive resource data in the server can be managed more effectively, the performance consumption of managing massive game resources in the world network game background can be relieved by reducing the number of resource management objects needing to be created, and the performance of the server is also considered while managing massive game resources (such as creation, refreshing and competing among players) is realized, so that smoother game experience is provided for players.
The above steps are described in detail below.
In some embodiments, the resource data of the game resource may include information on various aspects of the game resource, so that the resource data of the game resource is more comprehensive and is convenient to manage more comprehensively and effectively. Based on this, the resource data includes any one or more of the following:
the identification of the game resource, the model path, the location coordinates of the game resource in the game scene, and the rotation information in the game scene.
In practical application, the server device may guide out the resource data of the game resources and then cluster the game resources. For example, as shown in FIG. 2, the server device may utilize a raw data export tool to export raw data files of resource data from a running server of the game based on loading rules of the client scenario.
After the resource data are exported, the server device may store the resource data according to different game scenarios, respectively. For example, as shown in FIG. 3, each row of data represents a game resource; wherein the first column represents an identification (e.g., logic_id) of the game resource, the second column represents a model path of the game resource, and the later column represents data such as position coordinates and rotation information of the resource in the game scene.
The resource data of the game resource is more comprehensive through the data such as the identification of the game resource, the model path of the game resource, the position coordinates of the game resource in the game scene, the rotation information and the like, so that the game resource can be more comprehensively and effectively managed conveniently.
In some embodiments, the clustering process in step S120 may be implemented by querying the resource point set within a certain distance range, so as to obtain a more suitable size range of the clustering result. As an example, the step S120 may include the steps of:
traversing a plurality of game resources, for each game resource performing the steps of:
step a), inquiring whether a generated resource point set exists in a second preset range of the target position according to the target position of the current game resource in the game scene;
and b), if the generated resource point set exists in the second preset range, adding the current game resource into the generated resource point set nearest to the current game resource.
For step a) above, the server device may traverse all the resource data exported, for example. Assuming that the game resource corresponding to the i-th resource data is Di, inquiring whether a generated resource point set exists in a certain radius range (namely, a second preset range) around the Di coordinate as a center by utilizing the fixed radius length according to the position coordinate of Di in the game scene.
For step b) above, illustratively, if there is a generated set of resource points, the most suitable set of resource points is selected from the sets on the basis of the minimum center distance, i.e. the set of resource points whose center is closest to Di, e.g. set N, di is added to the list of set N. As shown in fig. 4, where multiple black dots in a circle represent the same clustering result (i.e., set of resource points).
In this embodiment, the above steps a) and b) may be repeatedly performed for each resource data until all the resource data are traversed.
It should be noted that, each set of resource points manages the portion of resource data in the set, where the radius (i.e., the cluster radius) of the set of resource points cannot be too small or too large. If the radius is too small, the number of resource point sets is too large, so that the number of resource management objects is large, the performance of the server is affected, and if the radius is too large, the game experience is poor, and the embodiment of the application can adopt a preset radius of 30 meters.
By means of the clustering method of the step a) and the step b), the range of the clustered resource point sets is not too small or too large, so that a more proper size range of the resource point sets is obtained, and better balance between game experience and server performance is achieved.
Based on the steps a) and b), the central position of the resource point set after the game resource is added can be updated, so that the central position of the resource point set is accurate in real time, and the clustering process of the next game resource can be conveniently executed. As an example, after step b), the method may further comprise the steps of:
and c), updating the central position of the collection based on the resource point collection after joining the current game resource.
For the step c), the updating process of the central position of the collection may be implemented by adopting an average value, for example, calculating an average value of all the game resource position coordinates in the resource point collection after the current game resource is added, that is, the central position of the resource point collection. The center position of the resource point set after the game resource is added is redetermined, so that the center position of the resource point set is accurate in real time, and the clustering process of the next game resource is conveniently executed.
Based on the above steps a), b), a new set of points may be created for the current game resource without finding the generated set of points. As an example, after step a), the method may further comprise the steps of:
And d), if the generated resource point set does not exist in the second preset range, a new resource point set is newly established, the current game resource is added into the new resource point set, and the target position is used as the central position of the new resource point set.
For step c) above, a new set Ni centered on Di (i.e. the current game resource) may be created, for example, to make the current game resource have its more suitable set of resource points.
In some embodiments, the resource data managed by the resource management object can be separately stored in a database, so that the formal running server of the game can quickly and efficiently query and call out the resource data from the database at any time. As an example, after step S130, the method may further include the steps of:
and e), writing the resource data managed by each resource management object into the Redis database based on the plurality of resource management objects.
Wherein, the Redis database is a high-performance kv type memory database. The Redis database is used for querying and/or calling the resource data managed by the resource management object through loading the resource management object. In this step, as shown in fig. 5, all the derived resource data may be written into a dis server according to the setting manner of the resource point set generated in step S120, where the dis server has a plurality of resource management objects, and the dis server may implement the functions of querying, retrieving, and updating the resource data by loading the resource management objects.
A large amount of resource data can be more efficiently stored through the Redis database, and a larger query range can be supported by utilizing the high performance of the Redis.
Based on the step e), in order to further alleviate the technical problem that CPU overhead and memory overhead are both large when the server is started, for a resource point set which is not checked by a player for a long time, a corresponding resource management object can be unloaded from the Redis database so as to reduce the memory consumption of the server. As an example, after step e), the method may further comprise the steps of:
and f), unloading the resource management object without loading event in the preset time from the Redis database.
For the step f), the resource management object corresponding to the resource point set which is not accessed for a long time in the game process can be unloaded from the Redis server according to a certain rule.
Through the unloading process in the step f), the number of resource management objects which are actually required to be created can be further reduced, and CPU (Central processing Unit) overhead and memory overhead in running of the server are further reduced.
In some embodiments, only resource management objects in the vicinity of the player may also be loaded nearby to reduce consumption of server performance while guaranteeing a complete player experience. As an example, after step S130, the method may further include the steps of:
And g), loading a target resource management object corresponding to the game resource in a first preset range of the current position based on the current position of the virtual object controlled by the client in the game scene, so that the client can acquire resource data managed by the target resource management object.
For the above step g), it is exemplary that, in the game scenario of the world technical framework, this larger game scenario may be split into multiple areas according to the physical location, and dispersed into multiple processes to carry its business logic running. After the server is started, the movement of the virtual object controlled by the player in the game scene involves the switching of the server process, so that seamless connection of area switching is achieved, and the player controlling the operation client can have no perception, so that the game experience game is improved.
It should be noted that, the virtual object and the game resource in this step refer to different objects in the game scene. The game resource is a resource which can be collected by a player, such as a dustbin, garbage, and the like, and is not directly controlled by a client. While the virtual object is an object that the player can directly control through the client, and is not content that the game itself is provided with, for example, a virtual character in the game that the player controls.
In practical application, the resource management object in the embodiment Of the application can combine with the management Of an Area Of Interest (AOI) to support the object individual in the game scene to process the game resource within a certain radius range, so that only the resource management object near the AOI is displayed at the client, and the number Of the resource management objects at the client is further reduced.
The resource management objects are created based on the resource point set clustered by the positions, and the resource management objects within a certain range of the player are only loaded, so that the number of the resource management objects which are actually required to be created can be further reduced, and CPU (Central processing Unit) overhead and running memory overhead when the server is started are further reduced.
Based on the above step g), the resource management object of the player vicinity range can be determined using the divided areas. As one example, the overall floor space of the game scene is uniformly divided into a plurality of floor areas according to a preset unit area; the step g) may include the steps of:
step h), determining a target occupation area in a first preset range of the current occupation area from a plurality of occupation areas based on the current occupation area of the virtual object in the game scene;
And i) loading the target resource management object corresponding to the target resource point set in the target occupation area, so that the client acquires target resource data managed by the target resource management object and displays and/or controls the target resources in the target resource point set based on the target resource data.
It should be noted that, in the embodiment of the present application, the target occupied area may further include a current occupied area where the virtual object is located in the game scene.
In practical applications, the world technical framework supports the division of a large game world (Space) into different footprints to balance the load. For each area division, the overall game scene can be divided into the areas according to a specific size (such as 50 meters by 50 meters). In order to save the performance consumption, only the resource management objects in the occupation area where the current coordinates of the player are and a plurality of surrounding occupation area ranges can be selected to be loaded, and meanwhile, the loading range of the resource management objects can be more reasonable and the quick confirmation is convenient.
For each land occupation area, a range query interface provided by the Redis database can be used for querying a resource point set list in the range of the local land occupation area, each resource point set corresponds to a resource management object of one server, and resource data of all game resources in the resource point set and interaction and communication between the game resources and players are managed.
In addition, the determination manner of the resource management object to be offloaded in the step e) can also be implemented by using the occupation area, that is, for the occupation area which is not observed by the player for a long time, the resource management object in the occupation area can be offloaded, so as to reduce the cost of the server performance. When the player enters the occupied area again, the resource management object in the occupied area can be loaded again.
Based on the steps h) and i), the occupation shape of the occupation area may not be specifically limited, so that the division of the occupation area is more flexible. Based on this, the occupation area of the occupation area in the game scene is a polygonal structure of any one of the following: triangle, square, rectangle, diamond, hexagon. By selecting one floor shape from a plurality of shapes, the division of the floor area can be made more flexible.
Based on this, the occupied area where the game resource needs to be loaded can include a plurality of occupied areas adjacent to the current occupied area, so that the game resource that the player should see is prevented from being displayed, and the experience of the player on the game is complete. As an example, the above step h) may include the steps of:
Step j), determining at least one occupation area adjacent to the current occupation area from a plurality of occupation areas based on the current occupation area of the virtual object controlled by the client in the game scene;
and k), determining at least one occupied area adjacent to the current occupied area as a target occupied area.
By loading a plurality of occupied areas adjacent to the occupied area where the current player is located, the situation that the game resources which the player should see are not displayed can be avoided, so that the player experience on the game is complete.
Based on the steps j) and k), the occupied area can be in a square structure, so that the division of the occupied area is more reasonable and convenient to manage. Based on the above, the occupation area of the occupation area in the game scene is of a square structure; the number of at least one land occupation area adjacent to the current land occupation area is eight.
In order to save the performance consumption, as shown in fig. 6, only the resource management objects in the occupation area where the current coordinates of the player are located and the eight occupation area ranges around the occupation area, namely, the occupation area of four sides of the upper, lower, left and right and four corners of the occupation area where the current coordinates of the player are located, may be loaded to form a nine-grid structure.
For example, each occupied area is in a square structure of 50 meters by 50 meters, so that a player can see resource points in a range of 50 meters nearby at least, and the shortest range can reach 50 meters, so that the field of view of the player is fully satisfied on the basis of saving performance consumption.
The area division result can be more reasonable through the occupied area of the square structure, and the formed nine-square structure can also enable the loading range to be confirmed quickly, so that the resource loading management process is facilitated.
FIG. 7 provides a schematic structural diagram of a processing device for game resources. The device can be applied to the server equipment. As shown in fig. 7, the processing apparatus 700 of the game resource includes:
an obtaining module 701, configured to obtain a position of a game resource in a game scene;
a clustering module 702, configured to cluster a plurality of game resources based on the location, to obtain a plurality of resource point sets;
the creating module 703 is configured to create resource management objects according to the resource point sets, where each resource management object corresponds to one resource point set, and the resource management objects are used to manage resource data of game resources in the corresponding resource point set.
In some embodiments, the apparatus further comprises:
And the loading module is used for loading the target resource management object corresponding to the game resource in the first preset range of the current position based on the current position of the virtual object controlled by the client in the game scene after the resource management object is created according to the resource point set, so that the client can acquire the resource data managed by the target resource management object.
In some embodiments, the overall footprint of the game scene is evenly divided into a plurality of footprints according to a preset unit area; the loading module is specifically used for:
determining a target occupation area in a first preset range of the current occupation area from a plurality of occupation areas based on the current occupation area of the virtual object in the game scene;
and loading the target resource management object corresponding to the target resource point set in the target occupation area, so that the client acquires target resource data managed by the target resource management object and displays and/or controls target resources in the target resource point set based on the target resource data.
In some embodiments, the loading module is further to:
determining at least one occupation area adjacent to the current occupation area from a plurality of occupation areas based on the current occupation area of the virtual object controlled by the client in the game scene;
At least one of the current footprint and a footprint adjacent to the current footprint is determined as a target footprint.
In some embodiments, the apparatus further comprises:
and the writing module is used for writing the resource data managed by each resource management object into the Redis database based on a plurality of resource management objects after the resource management objects are created according to the resource point set, wherein the Redis database is used for inquiring and/or calling the resource data managed by the resource management objects by loading the resource management objects.
In some embodiments, the apparatus further comprises:
and the unloading module is used for unloading the resource management objects without loading events in a preset time period from the Redis database after the resource data managed by each resource management object are written into the Redis database based on the plurality of resource management objects.
In some embodiments, the clustering module 702 is specifically configured to:
traversing a plurality of game resources, for each game resource performing the steps of:
inquiring whether a generated resource point set exists in a second preset range of the target position according to the target position of the current game resource in the game scene;
and if the generated resource point set exists in the second preset range, adding the current game resource into the generated resource point set nearest to the current game resource.
In some embodiments, the clustering module 702 is further to:
after adding the current game resource to the generated resource point set nearest to the current game resource, updating the center position of the set based on the resource point set added to the current game resource.
In some embodiments, the clustering module 702 is further to:
after inquiring whether the generated resource point set exists in a second preset range of the target position according to the target position of the current game resource in the game scene, if the generated resource point set does not exist in the second preset range, a new resource point set is newly built, the current game resource is added into the new resource point set, and the target position is used as the central position of the new resource point set.
In some embodiments, the resource data includes any one or more of the following:
the identification of the game resource, the model path, the location coordinates of the game resource in the game scene, and the rotation information in the game scene.
The processing device for game resources provided by the embodiment of the application has the same technical characteristics as the processing method for game resources provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
As shown in fig. 8, a server device 800 provided in the embodiment of the present application includes a memory 801 and a processor 802, where a computer program capable of running on the processor is stored in the memory, and the processor implements the steps of the method provided in the embodiment when executing the computer program.
Referring to fig. 8, the server device further includes: a bus 803 and a communication interface 804, the processor 802, the communication interface 804, and the memory 801 being connected by the bus 803; the processor 802 is configured to execute executable modules, such as computer programs, stored in the memory 801.
The memory 801 may include a high-speed random access memory (Random Access Memory, simply referred to as RAM), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. Communication connection between the system network element and at least one other network element is achieved through at least one communication interface 804 (which may be wired or wireless), and the internet, wide area network, local network, metropolitan area network, etc. may be used.
Bus 803 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 8, but not only one bus or type of bus.
The memory 801 is configured to store a program, where the processor 802 executes the program after receiving an execution instruction, and the method executed by the apparatus defined by the process disclosed in any embodiment of the present application may be applied to the processor 802 or implemented by the processor 802.
The processor 802 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the methods described above may be performed by integrated logic circuitry in hardware or instructions in software in the processor 802. The processor 802 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but may also be a digital signal processor (Digital Signal Processing, DSP for short), application specific integrated circuit (Application Specific Integrated Circuit, ASIC for short), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA for short), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 801 and the processor 802 reads the information in the memory 801 and in combination with its hardware performs the steps of the above method.
Corresponding to the above game resource processing method, the embodiment of the application further provides a computer readable storage medium, where the computer readable storage medium stores computer executable instructions, where the computer executable instructions, when invoked and executed by a processor, cause the processor to execute the steps of the game resource processing method.
The processing device of the game resource provided by the embodiment of the application may be specific hardware on the device or software or firmware installed on the device. The device provided in the embodiments of the present application has the same implementation principle and technical effects as those of the foregoing method embodiments, and for a brief description, reference may be made to corresponding matters in the foregoing method embodiments where the device embodiment section is not mentioned. It will be clear to those skilled in the art that, for convenience and brevity, the specific operation of the system, apparatus and unit described above may refer to the corresponding process in the above method embodiment, which is not described in detail herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
As another example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments provided in the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, or in a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the processing method of the game resource described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It should be noted that: like reference numerals and letters in the following figures denote like items, and thus once an item is defined in one figure, no further definition or explanation of it is required in the following figures, and furthermore, the terms "first," "second," "third," etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the foregoing examples are merely specific embodiments of the present application, and are not intended to limit the scope of the present application, but the present application is not limited thereto, and those skilled in the art will appreciate that while the foregoing examples are described in detail, the present application is not limited thereto. Any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or make equivalent substitutions for some of the technical features within the technical scope of the disclosure of the present application; such modifications, changes or substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application. Are intended to be encompassed within the scope of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A method of processing a game resource, the method comprising:
acquiring the position of the game resource in a game scene;
clustering a plurality of game resources based on the positions to obtain a plurality of resource point sets;
creating resource management objects according to the resource point sets, wherein each resource management object corresponds to one resource point set, and the resource management objects are used for managing resource data of game resources in the corresponding resource point sets;
the step of clustering a plurality of game resources based on the positions to obtain a plurality of resource point sets comprises the following steps:
traversing a plurality of said game resources, performing the following steps for each of said game resources:
inquiring whether a generated resource point set exists in a second preset range of the target position according to the target position of the current game resource in the game scene;
if the generated resource point set exists in the second preset range, adding the current game resource into the generated resource point set nearest to the current game resource;
after the step of adding the current game resource to the generated resource point set closest to the current game resource, the method further comprises:
And updating the central position of the collection based on the collection of the resource points added into the current game resource.
2. The method of processing game resources according to claim 1, wherein after the step of creating a resource management object from the set of resource points, the method further comprises:
and loading a target resource management object corresponding to the game resource in a first preset range of the current position based on the current position of the virtual object controlled by the client in the game scene, so that the client can acquire resource data managed by the target resource management object.
3. The method for processing game resources according to claim 2, wherein the overall occupation area of the game scene is uniformly divided into a plurality of occupation areas according to a preset unit area; the step of loading the target resource management object corresponding to the game resource in the first preset range of the current position based on the current position of the virtual object controlled by the client in the game scene, so that the client obtains the resource data managed by the target resource management object, includes:
determining a target occupation area within a first preset range of the current occupation area from a plurality of occupation areas based on the current occupation area of the virtual object in the game scene;
And loading a target resource management object corresponding to a target resource point set in the target occupation area, so that the client acquires target resource data managed by the target resource management object and displays and/or controls target resources in the target resource point set based on the target resource data.
4. A method of processing a game resource according to claim 3, wherein the step of determining a target floor area within a first preset range of the current floor area from among a plurality of the floor areas based on the current floor area in which the virtual object is located in the game scene comprises:
determining at least one occupation area adjacent to the current occupation area from a plurality of occupation areas based on the current occupation area of the virtual object controlled by the client in the game scene;
and determining at least one occupied area adjacent to the current occupied area as a target occupied area.
5. The method for processing game resources according to claim 1, further comprising, after the step of creating a resource management object from the set of resource points:
And writing the resource data managed by each resource management object into a Redis database based on a plurality of the resource management objects, wherein the Redis database is used for inquiring and/or calling the resource data managed by the resource management objects by loading the resource management objects.
6. The method for processing game resources according to claim 5, wherein after the step of writing the resource data managed by each of the resource management objects into the dis database based on the plurality of the resource management objects, the method further comprises:
unloading the resource management object which does not have loading event in the preset time from the Redis database.
7. The method for processing game resources according to claim 1, wherein after the step of querying whether the generated set of resource points exists within the second preset range of the target position according to the target position of the current game resource in the game scene, the method further comprises:
if the generated resource point set does not exist in the second preset range, a new resource point set is newly established, the current game resource is added into the new resource point set, and the target position is used as the central position of the new resource point set.
8. The method of processing game resources according to any one of claims 1 to 7, wherein the resource data includes any one or more of:
the identification of the game resource, the model path, the position coordinates of the game resource in the game scene and the rotation information in the game scene.
9. A processing device for game resources, the device comprising:
the acquisition module is used for acquiring the position of the game resource in the game scene;
the clustering module is used for clustering a plurality of game resources based on the positions to obtain a plurality of resource point sets;
the resource management object is used for managing the resource data of game resources in the corresponding resource point set;
the clustering module is specifically used for:
traversing a plurality of game resources, for each game resource performing the steps of:
inquiring whether a generated resource point set exists in a second preset range of the target position according to the target position of the current game resource in the game scene;
If the generated resource point set exists in the second preset range, adding the current game resource into the generated resource point set nearest to the current game resource;
the clustering module is also used for:
after adding the current game resource to the generated resource point set nearest to the current game resource, updating the center position of the set based on the resource point set added to the current game resource.
10. A server device comprising a memory, a processor, the memory having stored thereon a computer program executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the method according to any of the preceding claims 1 to 8.
11. A computer readable storage medium storing computer executable instructions which, when invoked and executed by a processor, cause the processor to perform the method of any one of claims 1 to 8.
CN202011136979.7A 2020-10-21 2020-10-21 Game resource processing method and device and server device Active CN112245932B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011136979.7A CN112245932B (en) 2020-10-21 2020-10-21 Game resource processing method and device and server device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011136979.7A CN112245932B (en) 2020-10-21 2020-10-21 Game resource processing method and device and server device

Publications (2)

Publication Number Publication Date
CN112245932A CN112245932A (en) 2021-01-22
CN112245932B true CN112245932B (en) 2024-03-22

Family

ID=74263503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011136979.7A Active CN112245932B (en) 2020-10-21 2020-10-21 Game resource processing method and device and server device

Country Status (1)

Country Link
CN (1) CN112245932B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032044A (en) * 2021-03-22 2021-06-25 上海哔哩哔哩科技有限公司 Resource loading method and device
CN113546416A (en) * 2021-08-16 2021-10-26 网易(杭州)网络有限公司 Game scene processing method and device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108499103A (en) * 2018-04-16 2018-09-07 网易(杭州)网络有限公司 The display methods and device of situation elements
CN109550254A (en) * 2019-01-10 2019-04-02 网易(杭州)网络有限公司 A kind of method and device of game adjustment, electronic equipment, storage medium
CN110652728A (en) * 2019-09-24 2020-01-07 北京金山安全软件有限公司 Game resource management method and device, electronic equipment and storage medium
CN111467808A (en) * 2020-04-20 2020-07-31 网易(杭州)网络有限公司 Game entity updating method and device
CN111563031A (en) * 2020-03-24 2020-08-21 完美世界(北京)软件科技发展有限公司 Game resource checking method, system, storage medium and computing device
CN111603768A (en) * 2020-05-27 2020-09-01 网易(杭州)网络有限公司 Game map storage method and device and game map display method and device
US10803665B1 (en) * 2017-09-26 2020-10-13 Amazon Technologies, Inc. Data aggregation for augmented reality applications

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10803665B1 (en) * 2017-09-26 2020-10-13 Amazon Technologies, Inc. Data aggregation for augmented reality applications
CN108499103A (en) * 2018-04-16 2018-09-07 网易(杭州)网络有限公司 The display methods and device of situation elements
CN109550254A (en) * 2019-01-10 2019-04-02 网易(杭州)网络有限公司 A kind of method and device of game adjustment, electronic equipment, storage medium
CN110652728A (en) * 2019-09-24 2020-01-07 北京金山安全软件有限公司 Game resource management method and device, electronic equipment and storage medium
CN111563031A (en) * 2020-03-24 2020-08-21 完美世界(北京)软件科技发展有限公司 Game resource checking method, system, storage medium and computing device
CN111467808A (en) * 2020-04-20 2020-07-31 网易(杭州)网络有限公司 Game entity updating method and device
CN111603768A (en) * 2020-05-27 2020-09-01 网易(杭州)网络有限公司 Game map storage method and device and game map display method and device

Also Published As

Publication number Publication date
CN112245932A (en) 2021-01-22

Similar Documents

Publication Publication Date Title
CN112245932B (en) Game resource processing method and device and server device
US7537523B2 (en) Dynamic player groups for interest management in multi-character virtual environments
CN105205014A (en) Data storage method and device
CN109144696A (en) A kind of method for scheduling task, device, electronic equipment and storage medium
CN103530220A (en) Display method and system and terminal for application program icons
CN103064797B (en) Data processing method and virtual machine management platform
CN110413412B (en) GPU (graphics processing Unit) cluster resource allocation method and device
US10628066B2 (en) Ensuring in-storage data atomicity and consistency at low cost
CN110716766A (en) Game scene loading method and device, computer readable medium and electronic equipment
CN106202092A (en) The method and system that data process
CN103064955A (en) Inquiry planning method and device
CN111143039A (en) Virtual machine scheduling method and device and computer storage medium
CN113112208A (en) Electric power material storage management method based on three-dimensional visualization model
US20130111386A1 (en) Logical cpu division usage heat map representation
CN110134646B (en) Knowledge platform service data storage and integration method and system
CN110245978A (en) Policy evaluation, policy selection method and device in tactful group
CN104021085A (en) Mobile terminal internal memory cleaning method and device
CN111340790B (en) Bounding box determination method, device, computer equipment and storage medium
CN116186571B (en) Vehicle clustering method, device, computer equipment and storage medium
CN102780780B (en) Method, equipment and system for data processing in cloud computing mode
CN113449052A (en) Method for establishing spatial index, method and device for querying spatial region
CN110674134A (en) Geographic information data storage method, query method and device
CN104408056A (en) Data processing method and device
CN114691630A (en) Smart supply chain big data sharing method and system
CN113722415A (en) Point cloud data processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant