Game scene data processing method and device, storage medium and computer device
By constructing a two-layer binary tree for hierarchical collision detection, the lock conflict problem during game scene data updates was resolved, improving game loading speed and player experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
- Filing Date
- 2021-09-30
- Publication Date
- 2026-06-23
AI Technical Summary
In existing technologies, locking conflicts are prone to occur when modifying dynamic data of game scene data. Locking time is long, resulting in a large workload for updating game scene data, slow game loading speed, and poor player gaming experience.
By constructing a two-level binary tree structure, including a first-level binary tree and a second-level binary tree structure, hierarchical collision detection is performed. Only the second-level binary tree structure corresponding to the changed object is updated, reducing lock conflicts, shortening locking time, and reducing update workload.
This allows all player-owned homestead plots to be displayed within the same game scene, reducing lock conflicts, shortening locking time when modifying dynamic data, improving game loading speed, and enhancing the player's gaming experience.
Smart Images

Figure CN115888079B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, storage medium, and computer equipment for processing game scene data. Background Technology
[0002] Currently, large-scale survival games can be divided into a survival area and a home area. The survival area is a public area where any player can go and do anything. In the home area, players can build a home system through an independent home instance. In the home system, players can freely build, add, delete, and modify the furniture arrangement.
[0003] In existing technologies, each player's homestead system is a copy, requiring players to enter and exit these copies to observe each other's homes. This prevents multiple players from seeing each other's homes simultaneously, resulting in poor intuitiveness and a subpar user experience. Furthermore, game scene data is constructed by unifying the game scene data of all homestead systems into an AABB tree to represent the relative positions of each homestead system and its furniture. However, furniture within a homestead system can be freely placed. When the position of any furniture changes, the entire AABB tree of the game scene must be reconstructed. This leads to lengthy locking times when modifying dynamic data, a significant workload for updating game scene data, slow loading speeds, and a poor player experience. Summary of the Invention
[0004] In view of this, this application provides a method, apparatus, storage medium and computer equipment for processing game scene data, which can solve the technical problems that easily occur when modifying dynamic data, such as lock conflicts and long locking time, resulting in a large workload for updating game scene data, slow game loading speed and poor player gaming experience.
[0005] According to one aspect of this application, a method for processing game scene data is provided, the method comprising:
[0006] Receive a scene change request from a game player. The scene change request carries scene change data, which includes the object to be changed, the first position data of the object before the request for change, and the second position data of the object to be changed.
[0007] The first location data is compared with the first level binary tree to perform a first collision detection, and the first level node corresponding to the changed object is determined. The first level binary tree includes a home scene plot belonging to at least one game player, and the home scene plot is displayed in the same game scene.
[0008] The second location data is compared with the second-level binary tree corresponding to the first-level node to perform a second collision detection. The second-level binary tree includes at least one scene object within the home scene plot corresponding to the first-level node.
[0009] If the second collision detection result is that there is no collision, then the object to be changed is changed from the first position corresponding to the first position data to the second position corresponding to the second position data, and the second hierarchical binary tree is updated.
[0010] According to another aspect of this application, a game scene data processing apparatus is provided, characterized in that it includes:
[0011] The receiving module is used to receive scene change requests from game players. The scene change requests carry scene change data, which includes the object to be changed, the first position data of the object before the request for change, and the second position data of the object to be changed.
[0012] The first collision detection module is used to perform a first collision detection between the first location data and the first hierarchical binary tree to determine the first level node corresponding to the changed object. The first hierarchical binary tree includes a home scene plot belonging to at least one game player, and the home scene plot is displayed in the same game scene.
[0013] The second collision detection module is used to perform a second collision detection between the second location data and the second-level binary tree corresponding to the first-level node. The second-level binary tree includes at least one scene object within the home scene plot corresponding to the first-level node.
[0014] The update module is used to change the object from the first position corresponding to the first position data to the second position corresponding to the second position data if the second collision detection result is that there is no collision, and update the second hierarchical binary tree.
[0015] According to another aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the above-described method for processing game scene data.
[0016] According to another aspect of this application, a game account control device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-mentioned method for processing game scene data.
[0017] By means of the above technical solution, the game scene data processing method, apparatus, storage medium and computer equipment provided in this application can, after receiving a scene change request from a game player, first extract scene change data from the scene change request, wherein the scene change data includes the object to be changed, the first position data of the object before the request for change and the second position data of the object to be changed; then, perform a first collision detection on the first position data and a first-level binary tree constructed based on the home scene plots to determine the first-level node corresponding to the object to be changed, and then perform a second collision detection on the second position data and a second-level binary tree corresponding to the scene object of the first-level node; if the second collision detection result is that there is no collision, then change the object from the first position corresponding to the first position data to the second position corresponding to the second position data, and update the second-level binary tree. The technical solution in this application enables all player homestead plots to reside within the same game scene. Furthermore, through the hierarchical construction and collision detection of a two-layer binary tree, when a scene change occurs, only the second-level binary tree corresponding to the changed object needs to be updated. This localizes the impact of rebuilding the binary tree corresponding to the game scene data, reduces lock conflicts, shortens the locking time when modifying dynamic data, further reduces the workload of updating game scene data, ensures game loading speed, and thus creates a better gaming experience for players.
[0018] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0020] Figure 1 A flowchart illustrating a method for processing game scene data according to an embodiment of this application is shown;
[0021] Figure 2 A flowchart illustrating another method for processing game scene data provided in an embodiment of this application is shown;
[0022] Figure 3 This illustration shows a schematic diagram of a game scene data processing device provided in an embodiment of this application;
[0023] Figure 4 A schematic diagram of another game scene data processing device provided in an embodiment of this application is shown. Detailed Implementation
[0024] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.
[0025] To reduce lock conflicts between different homestead systems, shorten the locking time when modifying dynamic data, further reduce the workload of updating game scene data, and ensure game loading speed, this application provides a method for processing game scene data, such as... Figure 1 As shown, the method includes:
[0026] 101. Receive scene change requests from game players. The scene change requests carry scene change data, which includes the object to be changed, the first position data of the object before the request for change, and the second position data of the object to be changed.
[0027] Scene change requests can be requests uploaded to the server by game players after they trigger scene objects or input scene change commands on the game terminal via touch or non-touch. Specifically, these requests can carry data on modifications made by the player to resources within the game scene, such as adding or deleting a scene object, changing a scene object within a home scene plot from style 1 to style 2, or moving a scene object from its first position to its second position. Any of these modifications to a scene object will result in a change in the game scene data, specifically a change from the data at the first position to the data at the second position. The first location data is the location data of the scene object before the change, and the second location data is the location data of the scene object after the change. When a scene object is newly added, the first location data can be null, and the second location data is the final added location of the scene object in the home system. When a scene object is deleted, the first location data can be the historical added location of the scene object, and the second location data is null. For other changes to scene objects, such as changes in style or movement of location, the corresponding first location data can be the historical added location of the scene object, and the second location data can be the final changed location of the scene object. The changed object can be any scene object designed by the game developer for the home scene plot when the game is created. This can include terrain (such as mountains, rivers, etc.), landforms (such as deserts, gravel, fallen petals, etc.), items (such as houses, furniture, statues, etc.), and plants (such as various kinds of flowers and grasses).
[0028] In specific application scenarios, game scene data is often stored in a hierarchical binary tree. When scene data changes, the hierarchical binary tree needs to be dynamically updated in real time to ensure the normal operation of the game. In existing virtual games with a homestead system, each player's homestead system is an independent instance, separate from the main map. When storing game data, the homestead data of all players in the entire game scene is uniformly constructed into a hierarchical binary tree. When scene data changes in any player's homestead system, the entire hierarchical binary tree of the game scene needs to be reconstructed. This can easily lead to lock conflicts between different homestead systems, and the locking time when modifying dynamic data is long, resulting in a large workload for updating game scene data, which can easily cause slow loading speeds and a poor player experience. To address this, this application proposes setting multiple salable plots on the main game map, each of which can be used to build a homestead system. In this way, different player homestead systems can be displayed in the same game scene, and players can see each other's homesteads, enriching the player experience. In this homestead system construction method, since the location of each homestead system's homestead scene plot on the main game map is fixed, the location and area of the homestead itself will not change. Therefore, for this application, a two-level binary tree structure can be constructed. For homestead scene plots with relatively stable scene changes, a first-level hierarchical binary tree can be constructed. On the first-level binary tree, a second-level hierarchical binary tree corresponding to the scene object of each homestead system can be constructed. When any player in the homestead system generates scene change data, it is only necessary to retrieve the first-level node corresponding to the player's homestead scene plot in the first-level binary tree, match the corresponding second-level hierarchical binary tree based on the first-level node, and further update the second-level hierarchical binary tree based on the scene change data. Through this game data update method of this application, lock conflicts can be reduced when updating the hierarchical binary tree, the locking time when modifying dynamic data can be shortened, the workload of updating game scene data can be further reduced, and the game loading speed can be guaranteed.
[0029] The execution entity in this embodiment can be a game scene data processing device or equipment, which can be configured on the server side or the client side, and can be used to control the dynamic updating of game scene data when changes occur in game scene objects.
[0030] 102. Perform a first collision detection between the first position data and the first-level binary tree to determine the first-level node corresponding to the object to be changed. The first-level binary tree includes a home scene plot belonging to at least one player. The home scene plots are displayed within the same game scene.
[0031] Specifically, the first-level binary tree and the second-level binary tree in step 103 of the embodiment can be constructed by an axis-aligned bounding box (AABB) structure. In this embodiment, the hierarchical binary tree can also be referred to as an AABB tree. The AABB structure is the smallest cuboid that encloses an object parallel to the coordinate axes.
[0032] In this embodiment, after extracting the first position data of the object to be changed before the request for change based on the scene change data, the first position data can be used to perform collision detection with each leaf node in the first-level binary tree based on the 3D object AABB collision detection algorithm, and the first-level node of the plot of the home scene where the object to be changed is located can be further extracted.
[0033] 103. Perform a second collision detection on the second location data and the second-level binary tree corresponding to the first-level node. The second-level binary tree includes at least one scene object within the home scene plot corresponding to the first-level node.
[0034] Accordingly, after extracting the first-level node of the home scene plot where the object to be changed is located based on step 102 of the embodiment, the second position data of the object to be changed can be extracted from the scene change data, and the second-level binary tree with the first-level node as the root node can be extracted. Further, the second position data can be used to perform collision detection with each leaf node in the second-level binary tree based on the 3D object AABB collision detection algorithm. Based on the collision detection result, it can be determined whether there is an existing scene object at the second position. If there is no object, it can be determined that the current scene change request can be executed. Otherwise, the scene change request cannot be executed, that is, the object to be changed cannot be moved to the second position.
[0035] 104. If the second collision detection result is that there is no collision, the object to be changed is changed from the first position corresponding to the first position data to the second position corresponding to the second position data, and the second-level binary tree is updated.
[0036] In specific application scenarios, the second-level binary tree is pre-built for scene objects in each homestead system and needs to be dynamically updated in real time as the game scene data changes. In this embodiment, when it is detected that the second position data requested by the changed object does not collide with the second-level binary tree, it indicates that there are no other scene objects at the second position. Therefore, in response to the change request, the changed object can be changed from the first position corresponding to the first position data to the second position corresponding to the second position data. Since the change in the object's position leads to an update of the game scene data, it is necessary to further reconstruct the second-level binary tree of the homestead scene plot where the changed object is located. It should be noted that collision detection is only one of the conditions for updating the second-level binary tree; the construction of the second-level binary tree itself does not require collision detection.
[0037] This embodiment provides a method for processing game scene data. After receiving a scene change request from a player, the method first extracts scene change data from the request. The scene change data includes the object to be changed, its first position data before the request, and its second position data to be changed. Then, the first position data is compared with a first-level binary tree constructed based on the home scene plots to determine the first-level node corresponding to the object to be changed. Next, the second position data is compared with the second-level binary tree corresponding to the scene object. If the second collision detection result is no collision, the object to be changed from the first position corresponding to the first position data to the second position corresponding to the second position data, and the second-level binary tree is updated. The technical solution in this application enables all player homestead plots to reside within the same game scene. Furthermore, through the hierarchical construction and collision detection of a two-layer binary tree, when a scene change occurs, only the second-level binary tree corresponding to the changed object needs to be updated. This localizes the impact of rebuilding the binary tree corresponding to the game scene data, reduces lock conflicts, shortens the locking time when modifying dynamic data, further reduces the workload of updating game scene data, ensures game loading speed, and thus creates a better gaming experience for players.
[0038] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, and to fully illustrate the implementation methods of this embodiment, this embodiment also provides another method for processing game scene data, such as... Figure 2 As shown, the method includes:
[0039] 201. Construct the first-level binary tree of the home scene plots, and construct the second-level binary tree of scene objects within the home scene plots.
[0040] The first-level binary tree includes at least one home scene plot belonging to a player, and these home scene plots are displayed within the same game scene. The second-level binary tree includes at least one scene object within the home scene plot corresponding to the first-level node.
[0041] In specific application scenarios, as an optional approach, a first-level binary tree can be constructed based on the location distribution of each homestead system's corresponding homestead scene on the game's main map. Specifically, scene data containing the location distribution of homestead scene plots can be extracted, and the homestead scene plots can be divided into regional-level groups according to the location distribution. Then, the game's main map is used as the root node of the first-level binary tree, the divided groups are used as branch nodes of the first-level binary tree, and the individual homestead scene plots within the lowest-level group are used as leaf nodes of the first-level binary tree. Accordingly, step 201 of the embodiment can specifically include: obtaining the first scene data of at least one homestead scene plot corresponding to a game player in the game scene from the server; and constructing a first-level binary tree of homestead scene plots based on the first scene data.
[0042] Accordingly, as an optional approach, it is also necessary to construct a second-level binary tree of scene objects on the home scene plots based on the location distribution of scene objects within each home system. Specifically, the scene display data of each scene object in the home scene plot (such as the style, size distribution, display position, setting direction, and area occupied by the scene object) can be determined, and then the home scene plot is used as the root node of the second-level binary tree. According to the scene display data, each scene object is used as a different leaf node of the second-level binary tree. Accordingly, step 201 of the embodiment may specifically include: obtaining second scene data of at least one scene object in the home scene plot from the server, the second scene data being the scene display data set by the game player for the scene object within a historical time period; and constructing a second-level binary tree of scene objects on the home scene plot based on the second scene data.
[0043] 202. Receive scene change requests from game players. The scene change requests carry scene change data, which includes the object to be changed, the first position data of the object before the request for change, and the second position data of the object to be changed.
[0044] 203. Perform a first collision detection between the first position data and the first leaf node in the first level binary tree, and extract the first level nodes that have collisions from the first leaf node. The first leaf node is used to represent the plot of land in the home scene.
[0045] In this embodiment, after receiving a scene change request and extracting the object to be changed, the first location data of the object before the request for change, and the second location data of the object to be changed from the scene change request, the home scene plot to which the object to be changed belongs can be determined firstly based on the first location data in the first hierarchical binary tree. Specifically, the first location data and any first leaf node in the first hierarchical binary tree can be subjected to a first collision detection to extract the first level node that has a collision in the first leaf node. The first level node is the home scene plot to which the object to be changed belongs. This application embodiment can be applied to 3D game scenes. When performing AABB collision detection on scene objects in a 3D game scene, a 3D AABB bounding box can be constructed first. The 3D AABB bounding box is represented as a hexahedron, and each edge of the hexahedron is parallel to a coordinate plane. Then, the two largest and two smallest vertices can be selected from the eight vertices of scene object a at the first position data and the eight vertices of the home scene plot B stored at the first leaf node for comparison. If the bounding boxes of the two are found to intersect, the convex hulls of scene object a at the first position data and the home scene plot B stored at the first leaf node can be generated respectively. The convex hulls are used for the next collision detection step. If an intersection is detected between the convex hulls, a collision can be determined. Given that the AABB tree has a very good mathematical property, the bounding box of the parent node can be completely obtained from the bounding boxes of its child nodes. The bounding box of the child node is completely covered by the bounding box of the parent node. Therefore, it can be determined that scene object a belongs to home scene plot B.
[0046] Accordingly, in this embodiment, the first bounding box under the first location data corresponding to the changed object can be determined first, and the second bounding box under the current position corresponding to any first leaf node in the first hierarchical binary tree can be determined. Then, by performing overlap detection between the first bounding box and the second bounding box, the first step of collision detection can be performed. If there is no intersection between the detected bounding boxes, it can be determined that no collision has occurred. Conversely, if there is an intersection between the detected bounding boxes, in order to further verify whether a collision has occurred, it is necessary to further generate the convex hull under the first location data corresponding to the changed object and the convex hull under the current position corresponding to any first leaf node in the first hierarchical binary tree, and then determine whether the two convex hulls have intersected. If there is an intersection, it can be determined that a collision has occurred. At this time, the first-level node that collides with the changed object under the first location data can be extracted, that is, the leaf node of the home scene plot to which the changed object belongs in the first hierarchical binary tree. As an optional approach, step 203 in this embodiment may specifically include: determining the first bounding box corresponding to the first location data, and the second bounding box of the first leaf node in the first hierarchical binary tree; performing overlap detection on the first bounding box and any second bounding box; if overlap is detected, generating a convex hull and performing collision detection based on the convex hull; if a collision is determined, determining the first leaf node corresponding to the second bounding box as the first hierarchical node with the collision.
[0047] 204. Extract the second-level binary tree with the first-level node as the root node, and perform a second collision detection between the second position data and the second leaf node in the second-level binary tree. The second leaf node is used to represent scene objects.
[0048] In this embodiment, after determining the first-level node of the home scene plot where the object to be changed is located, a second-level binary tree with the first-level node as the root node can be further extracted. The second position data requested by the object to be changed is then compared with the second leaf node in the second-level binary tree for a second collision detection. If a collision occurs, it can be determined that there are other scene objects at the second position to be changed of the object at the current moment; otherwise, it is determined that there are no other scene objects. The specific implementation process of AABB collision detection in the 3D game scene in this embodiment can be found in the relevant description in step 203 of the embodiment, and will not be repeated here. Based on the example in step 203 of the embodiment, if it is determined that scene object a belongs to home scene plot B, then a second collision detection can be performed on the second leaf node of the second-level binary tree corresponding to scene object a and home scene plot B. If it is determined that the bounding boxes of scene object a and the second leaf node c in home scene plot B overlap, then it is necessary to further generate the convex hull of scene object a under the second position data and the convex hull of any second leaf node c in the second-level binary tree corresponding to the current position, and then determine whether the two convex hulls intersect. If there is an intersection, it can be determined that a collision has occurred. Therefore, it can be determined that scene object a and scene object c corresponding to the second leaf node c have a spatial position conflict. Correspondingly, as an optional method, step 204 of the embodiment may specifically include: determining the third bounding box corresponding to the second position data and the fourth bounding box of the second leaf node in the second-level binary tree; performing overlap detection on the third bounding box and any fourth bounding box. If overlap is detected, a convex hull is generated, and collision detection is performed based on the convex hull; if a collision is determined, it is determined that the second position data and the second leaf node corresponding to the fourth bounding box have a collision. It should be noted that the overlap in the steps of the embodiments of this application includes nested overlap and partial intersecting overlap.
[0049] 205. If the second collision detection result indicates that a collision exists, then refuse to change the object from the first position corresponding to the first position data to the second position corresponding to the second position data, and output a prompt message indicating an abnormal change.
[0050] Collision detection is necessary between scene objects because in the real world, two or more impenetrable objects cannot exist within the same spatial area. As virtual reality technology becomes increasingly prevalent in daily life, users are demanding higher levels of realism (i.e., real-time performance and accuracy) from virtual game systems. Furthermore, 3D geometric models are becoming increasingly complex, and the scale of virtual environments is expanding. Collision detection is fundamental to the interaction between dynamic and static objects, or between dynamic objects themselves, in virtual reality. In this embodiment, to achieve natural and accurate human-computer interaction in the game's home system, key technical issues such as collision detection must be addressed. Accordingly, if the second collision detection result indicates a collision, meaning that other scene objects exist at the current location where the object to be changed is to be located, to prevent overlapping of scene objects displayed in the home system, the change of the object from the first location corresponding to the first location data to the second location corresponding to the second location data can be refused. Simultaneously, to allow the game user to continue interacting in a state of awareness, an error message can be output when the second collision detection result indicates a collision, allowing the game user to re-determine the second location to which the object should be changed. The prompts may include one or more of the following: text prompts, image prompts, audio prompts, video prompts, light prompts, vibration prompts, etc.
[0051] 206. If the second collision detection result is that there is no collision, the object to be changed is changed from the first position corresponding to the first position data to the second position corresponding to the second position data, and the second level structure binary tree is updated.
[0052] In this embodiment, if the second collision detection result indicates no collision, meaning it is determined that there are no other scene objects at the second position of the object to be changed at the current moment, then in response to the scene change request, the object can be changed from the first position corresponding to the first position data to the second position corresponding to the second position data, and the second-level binary tree can be updated or reconstructed. Given that the AABB tree has a very good mathematical property—the bounding box of a parent node can be completely derived from the bounding boxes of its child nodes—this solution can also be applied to this property to complete the bottom-up dynamic update or reconstruction of the second-level binary tree starting from the leaf nodes.
[0053] In specific application scenarios, as an optional approach, when changing the object from the first position corresponding to the first position data to the second position corresponding to the second position data, and updating the second-level binary tree, step 206 of the embodiment may specifically include: moving the object from the first position corresponding to the first position data to the second position corresponding to the second position data, and determining the scene change data corresponding to the object, as well as the second scene data of scene objects other than the object in the home scene plot; and reconstructing the second-level binary tree based on the scene change data and the second scene data.
[0054] Using the above-described method for processing game scene data, upon receiving a scene change request from a player, scene change data is first extracted from the request. This data includes the object to be changed, its first position data before the change request, and its second position data for the requested change. Then, a first collision detection is performed between the first position data and a first-level binary tree constructed based on the home scene plots to determine the first-level node corresponding to the object to be changed. Next, a second collision detection is performed between the second position data and the second-level binary tree corresponding to the scene object at the first-level node. If the second collision detection result indicates no collision, the object to be changed from its first position corresponding to the first position data to its second position corresponding to the second position data, and the second-level binary tree is updated. The technical solution in this application enables all player homestead plots to reside within the same game scene. Furthermore, through the hierarchical construction and collision detection of a two-layer binary tree, when a scene change occurs, only the second-level binary tree corresponding to the changed object needs to be updated. This localizes the impact of rebuilding the binary tree corresponding to the game scene data, reduces lock conflicts, shortens the locking time when modifying dynamic data, further reduces the workload of updating game scene data, ensures game loading speed, and thus creates a better gaming experience for players.
[0055] Furthermore, as Figure 1 and Figure 2 The specific implementation of the method shown in this application provides a game scene data processing device, such as... Figure 3 As shown, the device includes: a receiving module 31, a first collision detection module 32, a second collision detection module 33, and an updating module 34;
[0056] The receiving module 31 can be used to receive scene change requests from game players. The scene change request carries scene change data, which includes the object to be changed, the first position data of the object before the request for change, and the second position data of the object to be changed.
[0057] The first collision detection module 32 can be used to perform a first collision detection between the first location data and the first hierarchical binary tree to determine the first level node corresponding to the changed object. The first hierarchical binary tree includes a home scene plot belonging to at least one game player, and the home scene plots are displayed in the same game scene.
[0058] The second collision detection module 33 can be used to perform a second collision detection between the second location data and the second-level binary tree corresponding to the first-level node. The second-level binary tree includes at least one scene object within the home scene plot corresponding to the first-level node.
[0059] The update module 34 can be used to change the object from the first position corresponding to the first position data to the second position corresponding to the second position data if the second collision detection result is that there is no collision, and update the second-level binary tree.
[0060] In specific application scenarios, in order to pre-construct the first-level binary tree corresponding to the home scene plots in the main game map, such as... Figure 4 As shown, the device also includes: a first acquisition module 45 and a first construction module 46;
[0061] The first acquisition module 45 can be used to acquire first scene data of at least one home scene plot corresponding to a game player in the game scene from the server;
[0062] The first building module 46 can be used to build a first-level binary tree of home scene plots based on the first scene data.
[0063] Accordingly, in order to pre-construct a second-level binary tree of scene objects on the home scene plots, such as... Figure 4 As shown, the device also includes: a second acquisition module 47 and a second construction module 48;
[0064] The second acquisition module 47 can be used to acquire second scene data of at least one scene object in the home scene plot from the server. The second scene data is the scene display data set by the game player for the scene object within a historical time period.
[0065] The second building module 48 can be used to build a second-level binary tree of scene objects on the home scene plots based on the second scene data.
[0066] In a specific application scenario, when performing a first collision detection on the first location data and the first-level binary tree to determine the first-level node corresponding to the changed object, the first collision detection module 32 can be used to perform a first collision detection on the first location data and the first leaf node in the first-level binary tree, and extract the first-level node that has a collision in the first leaf node. The first leaf node is used to represent the plot of land in the home scene.
[0067] Accordingly, when performing the first collision detection between the first position data and the first leaf node in the first hierarchical binary tree, the first collision detection module 32 can be used to determine the first bounding box corresponding to the first position data and the second bounding box of the first leaf node in the first hierarchical binary tree; perform overlap detection between the first bounding box and any second bounding box; if overlap is detected, generate a convex hull and perform collision detection based on the convex hull; if a collision is determined, determine the first leaf node corresponding to the second bounding box as the first hierarchical node with the collision.
[0068] In specific application scenarios, when performing a second collision detection between the second position data and the second-level binary tree corresponding to the first-level node, the second collision detection module 33 can be used to extract the second-level binary tree with the first-level node as the root node; and to perform a second collision detection between the second position data and the second leaf node in the second-level binary tree, where the second leaf node is used to represent the scene object.
[0069] Accordingly, when performing the second collision detection between the second position data and the second leaf node in the second-level binary tree, the second collision detection module 33 can specifically be used to determine the third bounding box corresponding to the second position data and the fourth bounding box of the second leaf node in the second-level binary tree; perform overlap detection between the third bounding box and any fourth bounding box; if overlap is detected, generate a convex hull and perform collision detection based on the convex hull; if a collision is determined, it is determined that the second position data and the second leaf node corresponding to the fourth bounding box have a collision.
[0070] In specific application scenarios, such as Figure 4 As shown, the device also includes: an output module 49;
[0071] The output module 49 can be used to refuse to change the object from the first position corresponding to the first position data to the second position corresponding to the second position data if the second collision detection result is that a collision exists, and output a prompt message indicating that the change is abnormal.
[0072] In a specific application scenario, if the second collision detection result is that there is no collision, the update module 34 can be used to move the changed object from the first position corresponding to the first position data to the second position corresponding to the second position data, and determine the scene change data corresponding to the changed object, as well as the second scene data of the scene object other than the changed object in the home scene plot; and reconstruct the second-level structure binary tree based on the scene change data and the second scene data.
[0073] It should be noted that other corresponding descriptions of the functional units involved in the game scene data processing device provided in this embodiment can be found in [reference]. Figures 1 to 2 The corresponding descriptions in the method will not be repeated here.
[0074] Based on the above, Figures 1 to 2 Accordingly, this embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the above-described method. Figures 1 to 2 The method for processing game scene data is shown.
[0075] Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as CD-ROM, USB flash drive, mobile hard drive, etc.) and includes several instructions to cause a computer device (such as personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of this application.
[0076] Based on the above, Figures 1 to 2 The method shown, and Figure 3 , Figure 4 To achieve the above objectives, the present application also provides a device for processing game scene data, specifically a personal computer, server, smartphone, or other network device. This device includes a storage medium and a processor; the storage medium stores computer programs; the processor executes the computer programs to achieve the above-described objectives. Figures 1 to 2 The method for processing game scene data is shown.
[0077] Optionally, the aforementioned physical devices may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.
[0078] Those skilled in the art will understand that the physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0079] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the aforementioned physical device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software in the information processing physical device.
[0080] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms, or it can be implemented by hardware. By applying the solution of this embodiment, after receiving a scene change request from a game player, scene change data is first extracted from the scene change request. The scene change data includes the object to be changed, the first position data of the object before the request for change, and the second position data of the object to be changed. Then, the first position data is used to perform a first collision detection with a first-level binary tree constructed based on the home scene plots to determine the first-level node corresponding to the object to be changed. Then, the second position data is used to perform a second collision detection with the second-level binary tree of the scene object corresponding to the first-level node. If the second collision detection result is that there is no collision, the object to be changed from the first position corresponding to the first position data to the second position corresponding to the second position data, and the second-level binary tree is updated. The technical solution in this application enables all player homestead plots to reside within the same game scene. Furthermore, through the hierarchical construction and collision detection of a two-layer binary tree, when a scene change occurs, only the second-level binary tree corresponding to the changed object needs to be updated. This localizes the impact of rebuilding the binary tree corresponding to the game scene data, reduces lock conflicts, shortens the locking time when modifying dynamic data, further reduces the workload of updating game scene data, ensures game loading speed, and thus creates a better gaming experience for players.
[0081] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or can be modified to be located in one or more apparatuses different from this embodiment. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.
[0082] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of this application.
Claims
1. A method for processing game scene data, characterized in that, include: Retrieve the first scene data of at least one home scene plot corresponding to a player in the game scene from the server; Construct a first-level binary tree of the home scene plots based on the first scene data; The second scene data is obtained from the server for at least one scene object in the home scene plot. The second scene data is the scene display data set by the game player for the scene object within a historical time period. Based on the second scene data, construct a second-level binary tree of the scene object on the home scene plot; Receive a scene change request from a game player. The scene change request carries scene change data, which includes the object to be changed, the first position data of the object before the request for change, and the second position data of the object to be changed. The first location data is compared with the first level binary tree to perform a first collision detection, and the first level node corresponding to the changed object is determined. The first level binary tree includes a home scene plot belonging to at least one game player, and the home scene plot is displayed in the same game scene. The second location data is compared with the second-level binary tree corresponding to the first-level node to perform a second collision detection. The second-level binary tree includes at least one scene object within the home scene plot corresponding to the first-level node. If the second collision detection result is that there is no collision, then the object to be changed is changed from the first position corresponding to the first position data to the second position corresponding to the second position data, and the second hierarchical binary tree is updated.
2. The method according to claim 1, characterized in that, Performing a first collision detection between the first location data and the first-level binary tree to determine the first-level node corresponding to the changed object includes: The first location data is compared with the first leaf node in the first hierarchical binary tree to perform a first collision detection. The first level node that has a collision is extracted from the first leaf node. The first leaf node is used to represent the plot of land in the home scene.
3. The method according to claim 2, characterized in that, The step of performing a first collision detection between the first position data and the first leaf node in the first hierarchical binary tree, and extracting the first-level nodes that have collisions from the first leaf node, includes: Determine the first bounding box corresponding to the first location data, and the second bounding box of the first leaf node in the first hierarchical binary tree; The first bounding box is overlapped with any of the second bounding boxes. If overlap is detected, a convex hull is generated, and collision detection is performed based on the convex hull. If a collision is determined, the first leaf node corresponding to the second bounding box is identified as the first-level node with the collision.
4. The method according to claim 1, characterized in that, The step of performing a second collision detection between the second position data and the second-level binary tree corresponding to the first-level node includes: Extract the second-level binary tree rooted at the first-level node; The second position data is compared with the second leaf node in the second hierarchical binary tree to perform a second collision detection. The second leaf node is used to represent scene objects.
5. The method according to claim 4, characterized in that, The step of performing a second collision detection between the second position data and the second leaf node in the second hierarchical binary tree includes: Determine the third bounding box corresponding to the second position data, and the fourth bounding box of the second leaf node in the second hierarchical binary tree. The third bounding box is overlapped with any of the fourth bounding boxes. If overlap is detected, a convex hull is generated, and collision detection is performed based on the convex hull. If a collision is determined, it is determined that the second position data collides with the second leaf node corresponding to the fourth bounding box.
6. The method according to claim 1, characterized in that, The method further includes: If the second collision detection result indicates a collision, then the change of the object from the first position corresponding to the first position data to the second position corresponding to the second position data will be refused, and a change error message will be output.
7. The method according to claim 1, characterized in that, The step of changing the object from the first position corresponding to the first position data to the second position corresponding to the second position data, and updating the second hierarchical binary tree, includes: Move the object to be changed from the first position corresponding to the first position data to the second position corresponding to the second position data, and determine the scene change data corresponding to the object to be changed, as well as the second scene data of the scene object other than the object to be changed in the home scene plot; The second-level binary tree is reconstructed based on the scene change data and the second scene data.
8. A device for processing game scene data, characterized in that, include: The first acquisition module is used to acquire the first scene data of at least one home scene plot corresponding to a game player in the game scene from the server. The first construction module is used to construct the first-level binary tree structure of the home scene plots based on the first scene data. The second acquisition module is used to acquire second scene data of at least one scene object in the home scene plot from the server. The second scene data is the scene display data set by the game player for the scene object within a historical time period. The second construction module is used to construct a second-level binary tree of scene objects on the home scene plots based on the second scene data. The receiving module is used to receive scene change requests from game players. The scene change requests carry scene change data, which includes the object to be changed, the first position data of the object before the request for change, and the second position data of the object to be changed. The first collision detection module is used to perform a first collision detection between the first location data and the first hierarchical binary tree to determine the first level node corresponding to the changed object. The first hierarchical binary tree includes at least one home scene plot belonging to a game player, and the home scene plot is displayed in the same game scene. The second collision detection module is used to perform a second collision detection between the second location data and the second-level binary tree corresponding to the first-level node. The second-level binary tree includes at least one scene object within the home scene plot corresponding to the first-level node. The update module is used to change the object from the first position corresponding to the first position data to the second position corresponding to the second position data if the second collision detection result is that there is no collision, and update the second hierarchical binary tree.
9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for processing game scene data as described in any one of claims 1 to 7.
10. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for processing game scene data as described in any one of claims 1 to 7.