OBJECT MANAGEMENT METHOD, OBJECT MANAGEMENT DEVICE, COMPUTER ... PROGRAM, AND OBJECT MANAGEMENT SYSTEM
The object management method dynamically divides regions based on object distribution to control node growth and optimize memory usage, addressing inefficiencies in existing octree-based systems by ensuring balanced object distribution across sub-regions.
Patent Information
- Application Number
- JP2023549040
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-09-09
- Filing Date
- 2022-08-10
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-08-10
AI Technical Summary
Existing object management methods using octrees lead to a rapid increase in the number of nodes, consuming excessive memory due to the uncontrolled division of regions based on a fixed size, which is inefficient for managing large numbers of objects in game applications and similar scenarios.
An object management method that dynamically divides regions into child areas based on the distribution of objects within a scene, ensuring each child area contains a similar number of objects, thereby controlling node growth and optimizing memory usage.
This approach reduces memory consumption and improves management efficiency by evenly distributing objects across sub-regions, preventing excessive node growth and maintaining balanced object management.
Smart Images

Figure 0007718628000001 
Figure 0007718628000002 
Figure 0007718628000003
Abstract
Description
[Technical Field]
[0001] This application claims priority to a Chinese patent application filed on September 9, 2021, bearing application number 202111057914.8 and entitled "Object management method, device, equipment, storage medium, and system," the entire contents of which are incorporated herein by reference.
[0002] TECHNICAL FIELD The present application relates to the technical fields of computers and the Internet, and more particularly to an object management method, device, apparatus, storage medium, and system. [Background technology]
[0003] In game applications and the like, there are many objects in the scene, so it is necessary to efficiently manage the objects in the scene to make it easy to select the field of view objects and obtain related data.
[0004] Related technology has proposed a configuration for managing objects in a scene using an octree. One node in the octree corresponds to one region in the scene. If the region corresponding to a node satisfies the division condition, the region corresponding to the node is directly divided into eight child regions of the same size, and the eight child nodes of the node are added to the octree. These eight child nodes correspond one-to-one to the eight child regions, and each child node manages one-eighth of the region and data of its parent node.
[0005] However, such an operation would increase the number of nodes too quickly and would use a lot of memory. Summary of the Invention [Problem to be solved by the invention]
[0006] The embodiments of the present application provide an object management method, device, equipment, storage medium, and system, which are configured as follows. [Means for solving the problem]
[0007] According to one aspect of an embodiment of the present application, there is provided an object management method executed by a computer device, the method comprising: obtaining position information of a first object added to the scene; determining a first node from an object management tree corresponding to the scene based on the position information of the first object, the object management tree including a plurality of nodes, each node corresponding to an area in the scene, the areas corresponding to different nodes do not overlap each other, and the first node refers to the node corresponding to the area to which the position information of the first object belongs; a step of dividing the area corresponding to the first node into n child areas (n is an integer greater than 1) based on position information of each object included in the area corresponding to the first node, when the number of objects included in the area corresponding to the first node becomes greater than an upper limit value when the first object is added to the area corresponding to the first node, wherein the number of objects included in each child area is the same or similar; and arranging n nodes in the object management tree in one-to-one correspondence with the n child regions.
[0008] According to one aspect of an embodiment of the present application, there is provided an object management device, comprising: a position acquisition module that acquires position information of a first object added to the scene; a node determination module that determines a first node from an object management tree corresponding to the scene based on the position information of the first object, the object management tree including a plurality of nodes, each node corresponding to an area in the scene, and areas corresponding to different nodes do not overlap each other, and the first node refers to a node corresponding to the area to which the position information of the first object belongs; an area division module that divides the area corresponding to the first node into n child areas (n is an integer greater than 1) based on position information of each object included in the area corresponding to the first node, when the number of objects included in the area corresponding to the first node becomes greater than an upper limit value when the first object is added to the area corresponding to the first node, and the number of objects included in each child area is the same or similar; a node arrangement module that arranges n nodes in one-to-one correspondence with the n child regions in the object management tree.
[0009] According to one aspect of an embodiment of the present application, a computer device is provided that includes a processor and a memory, and a computer program is stored in the memory, which, when loaded and executed by the processor, realizes the above-mentioned object management method.
[0010] According to one aspect of an embodiment of the present application, there is provided a computer-readable storage medium storing a computer program, which, when loaded and executed by a processor, implements the above-described object management method.
[0011] According to one aspect of an embodiment of the present application, a computer program product is provided that includes a computer program, the computer program being stored in a computer-readable storage medium, and a processor reading and executing the computer program from the computer-readable storage medium to realize the above-mentioned object management method.
[0012] According to one aspect of an embodiment of the present application, there is provided an object management system including an object management layer and an area of interest (AOI) viewing layer, The AOI field of view layer sends field of view range data of a target object in a scene to the object management layer, and the field of view range data of the target object is for indicating the field of view range of the target object; the object management layer determines a field of view of the target object based on the field of view data of the target object, determines an object set located within the field of view of the target object based on an object management tree corresponding to the scene, and sends object set data indicating the object set within the field of view of the target object to the AOI field of view layer, the object set includes at least one object located within the field of view of the target object, the object management tree includes a plurality of nodes, each node corresponds to an area in the scene, the areas corresponding to different nodes do not overlap each other, and the numbers of objects included in the areas corresponding to different nodes are the same or similar; The AOI field of view layer determines a set of objects within the field of view of the target object based on the object set data. [Effects of the Invention]
[0013] The configuration provided in the embodiment of the present application can provide the following beneficial effects.
[0014] When a region in a scene has too many objects and needs to be divided, the region can be divided into multiple sub-regions based on the distribution of each object within the region, with the number of objects contained in each sub-region being as equal as possible. That is, each sub-region has a different space size, but manages the same number of objects. In this way, not only can the rapid increase in the number of nodes be avoided and memory usage can be reduced, but the number of objects managed in a region can be directly divided into n equal parts, improving object management efficiency. [Brief explanation of the drawings]
[0015] [Figure 1] FIG. 1 is a schematic diagram of an implementation environment of the configuration provided in one embodiment of the present application. [Figure 2] 1 is a flowchart of an object management method provided in an embodiment of the present application; [Figure 3] FIG. 1 is a schematic diagram of region division provided in one embodiment of the present application. [Figure 4] FIG. 10 is a schematic diagram of region division provided in another embodiment of the present application. [Figure 5] FIG. 10 is a schematic diagram of region division provided in another embodiment of the present application. [Figure 6] FIG. 10 is a schematic diagram of region division provided in another embodiment of the present application. [Figure 7] 4 is a flowchart of an object management method provided in another embodiment of the present application; [Figure 8] FIG. 1 is a schematic diagram of region merging provided in one embodiment of the present application. [Figure 9] FIG. 10 is a schematic diagram of region merging provided in another embodiment of the present application. [Figure 10] FIG. 10 is a schematic diagram of region merging provided in another embodiment of the present application. [Figure 11] 4 is a flowchart of an object management method provided in another embodiment of the present application; [Figure 12] FIG. 1 is a schematic diagram of a change in the field of view provided in one embodiment of the present application. [Figure 13] FIG. 1 is a schematic diagram of field division provided in one embodiment of the present application. [Figure 14] FIG. 1 is a block diagram of an object management device provided in an embodiment of the present application; [Figure 15] FIG. 10 is a block diagram of an object management device provided in another embodiment of the present application; [Figure 16] FIG. 1 is a block diagram of an object management system provided in one embodiment of the present application. [Figure 17] FIG. 1 is a schematic diagram of the configuration of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION OF THE INVENTION
[0016] In order to clarify the purpose, configuration, and advantages of the present application, the embodiments of the present application will be described in more detail below with reference to the drawings.
[0017] Please refer to Fig. 1. Fig. 1 shows a schematic diagram of an implementation environment of the configuration provided in one embodiment of the present application. The implementation environment of this configuration may include a terminal device 10 and a server 20.
[0018] The terminal device 10 may be, for example, an electronic device such as a mobile phone, a tablet computer, a personal computer (PC), a wearable device, a virtual reality (VR) device, or an augmented reality (AR) device. This application is not limited to this. A client on which a target application is executed may be installed in the terminal device 10. For example, this target application may be a game application, a three-dimensional map program, a social application, an interactive entertainment application, or the like. This application is not limited to this.
[0019] The server 20 may be a single server, a server cluster consisting of multiple servers, or a cloud computing service center. The server 20 may be a back-end server of the target application, providing back-end services to clients of the target application.
[0020] Communication between the terminal device 10 and the server 20 is possible via a network.
[0021] In some embodiments, the target application may provide a scene, in which objects exist, and in which the objects can move, e.g., move or perform various other operations.
[0022] Taking a game application as an example, the above scene can be called a virtual scene, and the above object can be called a virtual object.
[0023] A virtual scene is a scene that is displayed (or provided) when a client of a target application (e.g., a game application) is executed on a terminal device. The virtual scene refers to a scene constructed for moving virtual objects (e.g., a game competition), such as a virtual house, a virtual island, or a virtual map. The virtual scene may be a simulation scene of the real world, a semi-simulated, semi-virtual scene, or a purely virtual scene. The virtual scene may be a 2D virtual scene, a 2.5D virtual scene, or a 3D virtual scene. The embodiments of the present application are not limited thereto. When a client of the target application is executed on a terminal device, different virtual scenes may be displayed (or provided) depending on the time of day.
[0024] A virtual object refers to a virtual character that moves in a virtual scene. For example, when the target application is a game application, the virtual object may be a virtual object controlled by a user or a virtual object controlled by the game application itself, for example, a virtual object controlled by artificial intelligence (AI). The virtual object may be in the form of a person, an animal, an animation, or other forms. This is not a limitation of the embodiment of the present application. The virtual object may be displayed in a three-dimensional form or a two-dimensional form. This is not a limitation of the embodiment of the present application. Optionally, when the virtual scene is a three-dimensional virtual scene, the virtual object is a three-dimensional solid model created based on animation skeleton technology. Each virtual object has its own shape and volume in the three-dimensional virtual scene and occupies a part of the space in the three-dimensional virtual scene.
[0025] Typically, in big world games, the virtual scene has a large spatial extent and can contain a large number of virtual objects, for example, tens, hundreds, or even thousands of virtual objects.
[0026] In addition, in the object management method provided in the embodiments of the present application, the entity that executes each step may be the server 20 in the implementation environment of the configuration shown in Fig. 1, or may be the terminal device 10 (for example, a client of the target application). For the sake of convenience, the following method embodiments will only illustrate the case where the entity that executes each step is the server 20, but are not limited to this.
[0027] Please refer to Fig. 2. Fig. 2 shows a flowchart of an object management method provided in one embodiment of the present application. This method may include several steps (210 to 240) as follows:
[0028] In step 210, the position information of the first object added to the scene is obtained.
[0029] The scene may be a two-dimensional (D) scene, a three-dimensional (3D) scene, or a scene of a higher dimension. The embodiments of the present application are not specifically limited thereto. In some embodiments, the scene may be a one-dimensional (1D) scene. Objects in the scene may be added or removed as needed. Taking a game application as an example, the objects in the scene may include virtual objects controlled by a player, non-player character (NPC) objects visible to one or more players, and common NPC objects visible to all players. Objects in the scene of the game application are added when a player logs in or when an NPC object is refreshed.
[0030] The first object may be any one of the objects added to the scene. The position information of the first object indicates the position of the first object in the scene. For example, the position information may be expressed by coordinates. In the case of a 2D scene, the scene is a two-dimensional plane and includes two spatial dimensions (e.g., length and width), and the position information may be expressed by two-dimensional coordinates (e.g., a planar rectangular coordinate system). In the case of a 2D scene, an object in the scene may be a two-dimensional object and may be regarded as a point. In the case of a 3D scene, the scene is a three-dimensional space and includes three spatial dimensions (e.g., length, width, and height), and the position information may be expressed by three-dimensional coordinates (e.g., a spatial rectangular coordinate system). In the case of a 3D scene, an object in the scene may be a three-dimensional object or a two-dimensional object and may be regarded as a point.
[0031] In some embodiments, the scene is a one-dimensional scene, i.e., only one dimension (e.g., length) needs to be considered in the scene, position information can be represented by one-dimensional coordinates, and objects in the scene can be considered as points in that one dimension. Region segmentation in accordance with embodiments of the present application can refer to the segmentation of line segments in that one dimension.
[0032] In step 220, a first node is determined from the object management tree corresponding to the scene based on the position information of the first object.
[0033] In the present embodiment, the object management tree includes multiple nodes, each of which corresponds to an area in the scene, and the areas corresponding to different nodes do not overlap with each other.
[0034] The first node refers to the node corresponding to the area to which the location information of the first object belongs. For example, the area to which the location information of the first object belongs is found from the areas corresponding to each node included in the object management tree, and the node corresponding to the found area is the first node.
[0035] In step 230, if the number of objects included in the area corresponding to the first node becomes greater than an upper limit value when the first object is added to the area corresponding to the first node, the area corresponding to the first node is divided into n child areas (n is an integer greater than 1) based on the position information of each object included in the area corresponding to the first node, and the number of objects included in each child area is the same or similar.
[0036] The upper limit is the maximum number of objects that can be included in a region. If the number of objects included in a region is greater than the upper limit, the region is divided to obtain multiple child regions. The number of objects in each child region is equal to or less than the upper limit. In some embodiments, even if the number of objects included in a region is equal to the upper limit, the region is divided to obtain multiple child regions.
[0037] Optionally, the upper limit value of the number of objects included in the areas corresponding to all nodes in the object management tree is the same, for example, the upper limit value of the number of objects included in the areas corresponding to all nodes in the object management tree is 5.
[0038] Optionally, the object management tree includes at least two nodes having different upper limits on the number of objects included in corresponding areas, for example, an upper limit on the number of objects included in an area corresponding to one node is 5, and an upper limit on the number of objects included in an area corresponding to another node is 8.
[0039] In some embodiments, the fact that the number of objects included in each child region is the same or similar may mean that the difference in the number of objects included in different child regions is equal to or less than a predetermined difference threshold. Alternatively, the fact that the number of objects included in each child region is the same or similar may mean that the difference in the number of objects included in different child regions at the same level is equal to or less than a predetermined difference threshold. Here, the difference threshold is an integer greater than or equal to 0, for example, 0, 1, 2, 3, etc. The specific value of the difference threshold can be set by a person skilled in the art according to actual circumstances. The embodiments of the present application are not specifically limited thereto.
[0040] In some embodiments, the fact that the number of objects included in each child region is the same or similar may mean that the variance of the number of objects included in different child regions is equal to or less than a variance threshold. Alternatively, the fact that the number of objects included in each child region is the same or similar may mean that the variance of the number of objects included in different child regions at the same level is equal to or less than a variance threshold. Here, the variance threshold is a number greater than or equal to 0, for example, 0, 0.5, 2.2, 3.8, etc. The specific value of the variance threshold can be set by a person skilled in the art according to actual circumstances. The embodiments of the present application are not specifically limited thereto.
[0041] Of course, the above definition of the number of objects included in each child region being the same or similar is merely exemplary, and the number of objects included in each child region being the same or similar may be defined in other ways, and specifically, can be set by a person skilled in the art according to actual circumstances, and the embodiments of the present application do not specifically limit this.
[0042] In some embodiments, to prevent the object management tree from becoming too tall and too complicated, the upper limit on the number of objects may be reduced in the first few layers and increased in the last few layers, thereby reducing the height of the tree. Furthermore, the upper limit on the number of objects may be reduced in the first few layers and no upper limit on the number of objects may be set in the lowest layer, thereby controlling the height of the tree within a predetermined range.
[0043] Optionally, a lower limit for the number of objects included in a region may be set. The lower limit is the minimum number of objects included in a region. By setting the lower limit, unnecessary division of regions can be avoided and the total number of regions in a scene can be controlled so as not to be too large. In addition, the lower limit for the number of objects included in the regions corresponding to all nodes in the object management tree may be the same, or the object management tree may have at least two nodes with different lower limits for the number of objects included in the corresponding regions. This can be set as needed. The present application is not limited to this.
[0044] If the number of objects included in the area corresponding to the first node is greater than an upper limit, the area corresponding to the first node is divided into n child areas. n may be a preset fixed value, such as n=2 or n=3. This application is not limited to this. n may also be a dynamically determined value. For example, the value of n is determined according to the number of objects included in the area to be divided. If n has a positive correlation with the number of objects included in the area to be divided, the greater the number of objects included in the area to be divided, the larger n becomes. In this case, the value of n can be determined based on the number of objects included in the area to be divided by presetting a correspondence relationship or conversion formula between the number of objects included in the area to be divided and n.
[0045] In some embodiments, step 230 may include several substeps, such as:
[0046] 1. Based on the position information of each object included in the area corresponding to the first node, determine the distance span in k spatial dimensions (k is a positive integer such as 1, 2, 3, etc.) of each object included in the area corresponding to the first node.
[0047] When k is equal to 2, the scene is a two-dimensional plane, with the X and Y axes representing the two spatial dimensions of the plane.
[0048] When k is equal to 3, the scene is a three-dimensional space, with the X-axis, Y-axis, and Z-axis representing the three spatial dimensions of the three-dimensional space.
[0049] For any one of the k spatial dimensions, the coordinates in that spatial dimension of each object included in the area corresponding to the first node are obtained, the maximum and minimum values of the coordinates in that spatial dimension are selected, and the difference between the maximum and minimum values is the distance span in that spatial dimension. A similar method is used for each spatial dimension to calculate the distance span for each object included in the area corresponding to the first node in each of the k spatial dimensions.
[0050] 2. Select the target spatial dimension with the largest distance span from among the k spatial dimensions.
[0051] Once the distance spans corresponding to each object included in the area corresponding to the first node in each of the k spatial dimensions are obtained, it is possible to find the spatial dimension with the largest distance span as the target spatial dimension.
[0052] 3. Divide the region corresponding to the first node into n child regions with the target spatial dimension as the division target.
[0053] Taking the case where the scene is a two-dimensional plane as an example, and assuming that the target spatial dimension is determined to be the X axis among two spatial dimensions, the X axis and the Y axis, n child regions are obtained by dividing the region corresponding to the first node on the X axis.
[0054] Taking the scene as an example in a three-dimensional space, assuming that the target spatial dimension is determined to be the Y axis among three spatial dimensions, namely the X axis, the Y axis, and the Z axis, n child regions are obtained by dividing the region corresponding to the first node along the Y axis.
[0055] In some embodiments, step 3 may further include some sub-steps such as:
[0056] 3-1. From among the objects included in the area corresponding to the first node, the first object and the second object that are the furthest in distance in the target space dimension are determined.
[0057] Based on the target space dimension with the largest distance span obtained above, two objects that are furthest apart in the target space dimension are determined, and the two objects are the first object and the second object, respectively.
[0058] 3-2. Divide the line segment between the two projected points of the first object and the second object in the target space dimension into n equal parts to obtain n-1 division points.
[0059] Based on the obtained coordinates of the first object and the second object in the target space dimension, n-1 division points are obtained by cutting the line segment between the two projection points of the first object and the second object in the target space dimension into n equal parts.
[0060] 3-3. Divide the region corresponding to the first node into n child regions based on the n-1 division points.
[0061] If the scene is a two-dimensional plane, after obtaining n-1 division points in the target space dimension, n-1 perpendicular lines perpendicular to the target space dimension are generated through the n-1 division points, and the region corresponding to the first node is divided into n child regions by these n-1 perpendicular lines.
[0062] If the scene is a three-dimensional space, n-1 division points in the target space dimension are obtained, and then n-1 vertical planes perpendicular to the target space dimension are generated through the n-1 division points, and the region corresponding to the first node is divided into n child regions by these n-1 vertical planes.
[0063] FIG. 3 is a schematic diagram illustrating the first division of the region corresponding to node 1. In some embodiments, as shown in FIG. 3, the region corresponding to node 1 is divided into two child regions. In FIG. 3, the X-axis coordinates of each object are close to each other, but the Y-axis coordinates of each object are more dispersed. That is, the distance span of each object on the Y-axis is greater than the distance span of each object on the X-axis. Therefore, the Y-axis is selected as the target spatial dimension, and a perpendicular line is drawn to the Y-axis to perform region division. A perpendicular line is drawn to the Y-axis from the median of the Y-axis coordinates of the two objects that are furthest apart in the diagram, and the region corresponding to node 1 is divided into two child regions. The upper child region contains three objects, and the lower child region contains four objects. This satisfies the division requirement that the number of objects contained in each child region is equal or similar.
[0064] In the above embodiment, a method is provided in which the target spatial dimension with the largest distance span is selected as the target for division and the region is divided. In this method, the size of each divided child region is made as uniform as possible, and a situation in which one child region is too large and another child region is too small occurs. Of course, in some other embodiments, the target spatial dimension for division may be selected in order from among the k spatial dimensions, or the target spatial dimension for division may be selected randomly. This is not a limitation of the present application.
[0065] In some embodiments, when a first object is added to an area corresponding to a first node, if the number of objects included in the area corresponding to the first node exceeds an upper limit, the system determines whether the size of the area corresponding to the first node is equal to or greater than a predetermined size, and if the size of the area corresponding to the first node is equal to or greater than the predetermined size, divides the area corresponding to the first node into n child areas (n is an integer greater than 1) based on the position information of each object included in the area corresponding to the first node, and if the size of the area corresponding to the first node is smaller than the predetermined size, does not divide the area corresponding to the first node, thereby preventing the height of the object management tree from becoming too large.
[0066] In step 240, n nodes that correspond one-to-one to the n child regions are arranged in the object management tree.
[0067] After dividing the area corresponding to the first node into n child areas, it is necessary to arrange n nodes in the object management tree that correspond one-to-one to the n child areas.
[0068] The arrangement method of the n nodes will be introduced and explained below. In some embodiments, step 240 may include several sub-steps as follows:
[0069] 1. Get the number of child nodes of the parent node of the first node.
[0070] The parent node of the first node may contain other child nodes in addition to the first node, so the number of child nodes of the parent node of the first node may be equal to or greater than one.
[0071] In addition, an upper limit is set for the number of child nodes that each node in the object management tree can have. The upper limit for the number of child nodes that each node can have may be the same or different. This is not a limitation of the present application. To facilitate the maintenance and management of the object management tree, the upper limit for the number of child nodes that each node in the object management tree can have may be set to the same. For example, the upper limit is M, where M is an integer greater than 1. For example, M=8, in which case the object management tree can be called an octree. For example, M=4, in which case the object management tree can be called a quadtree. In the present embodiment, the value of M is not limited, and it may be flexibly set to 4, 5, 6, 7, 8, or the like according to actual needs.
[0072] 2. If the number of child nodes satisfies the first condition, add n-1 sibling nodes of the first node to the object management tree, and arrange the first node and these n-1 sibling nodes in one-to-one correspondence with the n child areas.
[0073] The first condition is that the number of child nodes plus n-1 is equal to or less than the upper limit M. If the number of child nodes satisfies the first condition, n-1 nodes are added to the object management tree, and the first node and the added n-1 nodes are sibling nodes of each other.
[0074] In some embodiments, as shown in FIG. 4 , the left diagram shows a region corresponding to node 1, regions corresponding to each of the child nodes of node 1, and objects included in each region. Here, the upper limit of the number of objects included in each region is 5. Node 1-2 corresponds to region 1-2 (shown by a thick-line frame 40 in the left diagram), and the number of objects included in region 1-2 is 5. When one object is added to region 1-2, the number of objects included in region 1-2 becomes 6, exceeding the upper limit of 5. Therefore, region 1-2 is divided into two child regions, for example, child region 41 and child region 42 shown in the diagram. Here, both child region 41 and child region 42 contain three objects, the number of which is equal and less than the upper limit of 5.
[0075] Also, assume that the upper limit on the number of child nodes that the parent node of node 1-2 (i.e., node 1) can have is 8. In this case, the number of child nodes of node 1 is 7, and adding 1 does not exceed the upper limit of 8. Therefore, one sibling node of node 1-2 is added to the object management tree, which is shown as node 1-8 in Figure 4. When the object management tree is updated, node 1-2 corresponds to child area 41, and node 1-8 corresponds to child area 42.
[0076] 3. If the number of child nodes satisfies the second condition, add n child nodes of the first node to the object management tree, and arrange these n child nodes in one-to-one correspondence with the n child regions.
[0077] The second condition is that the number of child nodes is equal to the upper limit value M. If the number of child nodes satisfies the second condition, n nodes are added to the object management tree, and all of the added n nodes are child nodes of the first node.
[0078] In some embodiments, as shown in FIG. 5 , the left diagram shows a region corresponding to node 1, regions corresponding to each of the child nodes of node 1, and objects included in each region. Here, the upper limit of the number of objects included in each region is 5. Node 1-2 corresponds to region 1-2 (shown in a bold frame 50 in the left diagram), and the number of objects included in region 1-2 is 5. When one object is added to region 1-2, the number of objects included in region 1-2 becomes 6, exceeding the upper limit of 5. Therefore, region 1-2 is divided into two child regions, for example, child region 51 and child region 52 shown in the diagram. Here, both child region 51 and child region 52 contain three objects, the number of which is equal and less than the upper limit of 5.
[0079] Also, assume that the upper limit of the number of child nodes that the parent node of node 1-2 (i.e., node 1) can have is 8. In this case, the number of child nodes of node 1 is 8, which reaches the upper limit of 8. Therefore, two child nodes of node 1-2 are added to the object management tree, which are shown as node A and node B in Figure 5. When the object management tree is updated, node A corresponds to child area 51, and node B corresponds to child area 52.
[0080] When the region corresponding to the first node is divided into two child regions, that is, when n is equal to 2, there are only two situations, the first and second conditions above.
[0081] When the area corresponding to the first node is divided into three or more child areas, i.e., when n is 3 or greater, in addition to the two situations of the first and second conditions above, a third situation as follows may also occur.
[0082] Optionally, if the number of child nodes satisfies a third condition, add n1 sibling nodes of the first node to the object management tree, and add n2 child nodes of the first node to the object management tree, and arrange the n1 sibling nodes and n2 child nodes in one-to-one correspondence with the n child regions, where n1 and n2 are positive integers and n1+n2 is equal to n.
[0083] The third condition is that the number of child nodes is less than the upper limit M, but the number of child nodes plus n-1 is greater than the upper limit M. If the number of child nodes satisfies the third condition, add n nodes to the object management tree, of which n1 nodes are sibling nodes of the first node, n2 nodes are child nodes of the first node, and n1 + n2 equals n.
[0084] In some embodiments, as shown in FIG. 6 , the left diagram shows a region corresponding to node 1, regions corresponding to each of the child nodes of node 1, and objects included in each region. Here, the upper limit of the number of objects included in each region is 5. Node 1-2 corresponds to region 1-2 (shown by a bold frame 60 in the left diagram), and the number of objects included in region 1-2 is 5. When one object is added to region 1-2, the number of objects included in region 1-2 becomes 6, exceeding the upper limit of 5. Therefore, region 1-2 is divided into three child regions, for example, child region 61, child region 62, and child region 63 shown in the diagram. Here, child region 61, child region 62, and child region 63 each contain two objects, the number of which is equal and less than the upper limit of 5.
[0085] Also, assume that the upper limit on the number of child nodes that the parent node of node 1-2 (i.e., node 1) can have is 8. In this case, the number of child nodes of node 1 is 7, which is less than the upper limit of 8, but the sum of the two nodes exceeds the upper limit of 8. Therefore, one sibling node of node 1-2 is added to the object management tree, which is shown as node 1-8 in FIG. 6. Furthermore, two child nodes of node 1-2 are added to the object management tree, which are shown as nodes A and B in FIG. 6. When the object management tree is updated, node 1-8 corresponds to child area 61, node A corresponds to child area 62, and node B corresponds to child area 63.
[0086] In the configuration provided in the embodiment of the present application, if a region in a scene has too many objects and needs to be divided, the region is divided into multiple sub-regions according to the distribution location of each object contained in the region, and the number of objects contained in each sub-region is made as equal as possible. In other words, each sub-region has a different spatial size, but manages the same number of objects. In this way, not only can memory usage be reduced by avoiding excessive node growth, but the number of objects managed in a certain region can be directly divided into n equal parts, improving object management efficiency.
[0087] Furthermore, by dividing the region by selecting the target spatial dimension with the largest distance span as the division target, the size of each divided sub-region is made as uniform as possible, thereby avoiding the situation where one sub-region is too large and another is too small.
[0088] Furthermore, when adding a node to the object management tree, sibling nodes are added first based on a conditional decision, followed by child nodes. This method of dividing the area and adding nodes as needed prevents the tree height from increasing too quickly, reducing the complexity of the object management tree.
[0089] Please refer to Fig. 7. Fig. 7 shows a flowchart of an object management method provided in another embodiment of the present application. This method may include several steps (710 to 750) as follows:
[0090] In step 710, the position information of the second object reduced from the scene is obtained.
[0091] The second object may be any one of objects removed from the scene. The position information of the second object indicates the position of the second object in the scene. For example, the position information may be expressed by coordinates. In a 2D scene, the position information may be expressed by two-dimensional coordinates, and in a 3D scene, the position information may be expressed by three-dimensional coordinates.
[0092] In step 720, a second node is determined from the object management tree based on the location information of the second object.
[0093] For an introduction and explanation of the object management tree corresponding to a scene, please refer to the above-mentioned embodiment, and the explanation will be omitted here.
[0094] The second node refers to a node corresponding to the area to which the location information of the second object belongs. For example, the area to which the location information of the second object belongs is found from the areas corresponding to each node included in the object management tree, and the node corresponding to the found area is the second node.
[0095] In step 730, if the number of objects included in the area corresponding to the second node becomes smaller than a lower limit value when the second object is removed from the area corresponding to the second node, a third node to be merged with the second node is determined from the object management tree.
[0096] The lower limit is the minimum number of objects that can be included in a region. If the number of objects included in a region is less than the lower limit, the region is merged with another region such that the number of objects included in the merged region is equal to or greater than the lower limit. In some embodiments, a region is merged with another region even if the number of objects included in the region is equal to the lower limit.
[0097] Optionally, the lower limit values of the numbers of objects included in the areas corresponding to all nodes in the object management tree are the same, for example, the lower limit values of the numbers of objects included in the areas corresponding to all nodes in the object management tree are all 2.
[0098] Optionally, the object management tree includes at least two nodes whose corresponding regions have different lower limit values for the number of objects included in them, for example, a lower limit value for the number of objects included in a region corresponding to one node is 2, and a lower limit value for the number of objects included in a region corresponding to another node is 3.
[0099] If the number of objects included in the area corresponding to the second node becomes smaller than a lower limit when the second object is removed from the area corresponding to the second node, the object management tree is searched for a third node that satisfies the integration condition with the second node. The number of third nodes may be one or more.
[0100] The integration conditions include whether the area corresponding to the second node is adjacent to the area corresponding to the third node. In the case of a 2D scene, whether the area corresponding to the second node is adjacent to the area corresponding to the third node refers to whether there is an overlapping edge between the area corresponding to the second node and the area corresponding to the third node. In the case of a 3D scene, whether the area corresponding to the second node is adjacent to the area corresponding to the third node refers to whether there is an overlapping plane between the area corresponding to the second node and the area corresponding to the third node.
[0101] Optionally, the integration condition further includes that the integrated area of the area corresponding to the second node and the area corresponding to the third node is a regular area. In the case of a 2D scene, the integrated area of the area corresponding to the second node and the area corresponding to the third node is a regular area, which means that the integrated area of the area corresponding to the second node and the area corresponding to the third node is a rectangle, i.e., a rectangle or a square. In the case of a 3D scene, the integrated area of the area corresponding to the second node and the area corresponding to the third node is a regular area, which means that the integrated area of the area corresponding to the second node and the area corresponding to the third node is a rectangular parallelepiped or a cube.
[0102] In step 740, the area corresponding to the third node is updated to the combined area of the original area corresponding to the third node and the area corresponding to the second node.
[0103] If a third node that satisfies the integration condition is found, the area corresponding to the second node is integrated into the area corresponding to the third node. After integration, the area corresponding to the third node becomes larger than its original area.
[0104] Step 740 may include the following two cases:
[0105] Case 1: If the number of third nodes is one, update the area corresponding to the third node to the combined area of the original area corresponding to the third node and the complete area corresponding to the second node.
[0106] As shown in FIG. 8, the left diagram shows the region corresponding to node 1, the regions corresponding to each of the child nodes of node 1, and the objects included in each region. Here, the lower limit of the number of objects included in each region is 2. Node 1-8 corresponds to region 1-8 (shown as region 81 in the diagram), and the number of objects included in region 1-8 is 1, which is smaller than the lower limit of 2. Therefore, integration is performed on region 1-8. Region 1-2 (shown as region 82 in the diagram) corresponding to node 1-2 satisfies the integration conditions, so region 1-8 and region 1-2 are integrated to form integrated region 80 (shown in a bold frame in the diagram). After integration, the region corresponding to node 1-2 is changed from the original region 82 to integrated region 80.
[0107] Case 2: If the number of third nodes is k (k is an integer greater than 1), the area corresponding to the second node is divided into k child areas, the k third nodes are placed in one-to-one correspondence with the k child areas, and for each third node among the k third nodes, the area corresponding to the third node is updated to an integrated area of the original area corresponding to the third node and a child area among the k child areas that matches the third node.
[0108] As shown in FIG. 9 , the left diagram shows a region corresponding to node 1, regions corresponding to each of the child nodes of node 1, and objects included in each region. Here, the lower limit of the number of objects included in each region is 2. Node 1-8 corresponds to region 1-8 (shown as region 91 in the diagram), and the number of objects included in region 1-8 is 1, which is smaller than the lower limit of 2. Therefore, integration is performed on region 1-8. Because the regions corresponding to nodes 1-6 and 1-7 satisfy the integration condition, region 1-8 is divided into two child regions, region A and region B, shown in the right diagram. Here, region A and region 1-6 are integrated to form integrated region 92 (shown in a bold frame in the diagram), and region B and region 1-7 are integrated to form another integrated region 93 (shown in a bold frame in the diagram). Optionally, in some other examples, region 1-8 may be integrated with region 1-2 and region 1-9.
[0109] In step 750, the second node is deleted from the object management tree.
[0110] When the area corresponding to the second node and the area corresponding to the third node are integrated, the area corresponding to the second node is assigned to the third node. The second node no longer has a corresponding area and is deleted from the object management tree. As shown in Figure 8, when the area corresponding to nodes 1-8 and 1-2 are integrated, nodes 1-8 are deleted from the object management tree.
[0111] Optionally, if the parent node of the third node has only one child node, the parent node of the third node is deleted from the object management tree, and the third node is made a child node of its grandparent node. As shown in Figure 10, node 1-2 originally includes two child nodes, node A and node B, respectively. Because the number of objects included in the area corresponding to node B is one, which is smaller than the lower limit value 2, the area corresponding to node B is merged with the area corresponding to node A to obtain a merged area 100 (shown in a bold frame in the figure). After merging, the area corresponding to node A is changed from the original area A to the merged area 100, and node B is deleted from the object management tree. When node B is deleted, the parent node of node A (i.e., node 1-2) has only one child node (i.e., node A), so node 1-2 is deleted from the object management tree, and node A is made a child node of its grandparent node (i.e., node 1). According to the above method, it is possible to reduce unnecessary nodes, reduce the tree height, simplify the structure of the object management tree, and avoid wasting space management resources.
[0112] In the configuration provided in the embodiments of the present application, if the number of objects in a certain area in a scene is small, this area is merged with other areas to simplify the structure of the object management tree and avoid wasting space management resources.
[0113] Please refer to Fig. 11. Fig. 11 shows a flowchart of an object management method provided in another embodiment of the present application. This method may include several steps (1110 to 1180) as follows:
[0114] In step 1110, the viewing range of the target object in the scene is obtained.
[0115] The field of view of a target object refers to the area in which the target object can be observed within a scene. The screen in this area needs to be displayed on the client controlling the target object. The embodiments of the present application do not limit the shape of the field of view of the target object. For example, in a 2D scene, the field of view of the target object may be a fan-shaped area, the center of the fan-shaped area may be located at the position of the target object, and the fan-shaped area is located directly in front of the target object. In a 3D scene, the field of view of the target object may be a cone-shaped area, the apex of the cone-shaped area may be located at the position of the target object, and the cone-shaped area is located directly in front of the target object.
[0116] Of course, in some other embodiments, the viewing range of the target object may be other shapes, such as a circle (or a sphere), a rectangle (or a cube), etc. This can be flexibly customized according to actual needs, and the present application is not limited thereto.
[0117] In step 1120, a set of objects located within the field of view is determined based on the object management tree, and the set of objects includes at least one object located within the field of view.
[0118] The object management tree corresponding to a scene records attribute information (e.g., attributes such as position and status) of each object in the scene, so that a set of objects located within the field of view can be found based on the object management tree.
[0119] For example, first, based on the area corresponding to each node in the object management tree, at least one target node is selected that has a common part between the corresponding area and the field of view of the target object, then the position information of each object included in the area corresponding to the target node is obtained, and it is determined whether the position information of each object belongs to the field of view of the target object, and by selecting objects that belong to the field of view of the target object, a set of objects within the field of view is obtained.
[0120] In some embodiments, the server determines a set of objects located within the viewing range of the target object, obtains attribute information of each object included in the set of objects, and then transmits the attribute information of each object included in the set of objects to a client corresponding to the target object, thereby enabling the client to display the set of objects based on the attribute information.
[0121] In the present embodiment, the field of view is also referred to as an AOI field of view. As the target object moves, changes direction, and other operations in the scene, the field of view of the target object also changes, and the set of objects within the field of view of the target object also changes accordingly. For example, as shown in FIG. 12 , five pets, designated pet 122, pet 123, pet 124, pet 125, and pet 126, are visible within the field of view of the target object 121 in the upper diagram. As the target object 121 moves or the pets move, some may leave the field of view of the target object 121, while others may enter the field of view of the target object 121. For example, in the lower diagram of FIG. 12 , pet 122 is away from the field of view of the target object 121, and treasure chest 127 is within the field of view of the target object 121. The server periodically updates the field of view of the target object and synchronizes and displays data regarding the set of objects within the latest field of view to the client.
[0122] In some embodiments, after determining the set of objects located within the field of view of the target object, the server may perform the following steps 1130-1140.
[0123] In step 1130, the field of view is divided into a number of sub-fields, with different sub-fields having different distances between them and the target object.
[0124] The field of view of the target object is divided into a plurality of sub-fields of view according to the distance from the target object, and the sizes of the sub-fields of view may be the same or different, with the total size of the sub-fields of view being the size of the field of view of the target object.
[0125] In some embodiments, in a third-person game, the field of view of a target object is a circle with a radius AB, as shown in Figure 13. As shown in the figure, the field of view of the target object is divided into three sub-fields, and the field of view is divided into an inner layer, a middle layer, and an outer layer according to the distance between the sub-fields and the target object.
[0126] In some embodiments, in a first-person game, the field of view of a target object is a sector BAC with a radius AB, as shown in Figure 13. As shown in the figure, the field of view of the target object is divided into three sub-fields, and the field of view is divided into an inner layer, a middle layer, and an outer layer according to the distance between the sub-fields and the target object.
[0127] Among them, the sub-field of view range corresponding to the inner layer is closest to the target object, the sub-field of view range corresponding to the outer layer is farthest from the target object, and the distance between the sub-field of view range corresponding to the middle layer and the target object is between the inner layer and the outer layer.
[0128] In step 1140, a refresh frequency corresponding to each object in the object set is determined based on the sub-field of view to which each of the objects belongs, and the refresh frequency corresponding to the object is negatively correlated with the distance between the sub-field of view to which the object belongs and the target object.
[0129] A refresh frequency for objects in each sub-field of view is set. Here, the refresh frequency for an object refers to the update frequency of the object's real-time information (e.g., information such as its position and movement), e.g., the number of refreshes per second. For a user controlling a target object, the primary focus object is usually some other object close to the target object, while some other object farther from the target object is not the primary focus object. Therefore, by setting the refresh frequency according to the distance between the sub-field of view and the target object, the closer the distance between the sub-field of view and the target object, the higher the refresh frequency, ensuring that the object that is the user's primary focus object can be displayed with high quality. The farther the distance between the sub-field of view and the target object, the lower the refresh frequency, allowing objects that are not the user's primary focus object to be displayed with lower quality, which helps save processing resources on the server and client.
[0130] In some other embodiments, the refresh frequency of objects included in each sub-field of view may be determined based on the priority of each sub-field of view. For example, the higher the priority, the higher the refresh frequency, and conversely, the lower the priority, the lower the refresh frequency. The priority of the sub-field of view may be related to the distance between the sub-field of view and the target object or the attention level of the sub-field of view. In some embodiments, the priority of the sub-field of view may be dynamically adjusted. For example, in a shooting game, the priority of a sub-field of view is typically determined by distance, so that the closer a sub-field of view is to the target object, the higher its priority and the higher its refresh frequency. In a case where the target object is aiming a sniper rifle, the priority of the sub-field of view is determined by attention level, so that the higher the attention level of the sub-field of view to which the aim belongs, the higher the priority and the higher the refresh frequency of the sub-field of view.
[0131] Optionally, the method provided in the embodiment of the present application may further include the following steps 1150 to 1170.
[0132] In step 1150, for a first sub-field of view range among the multiple sub-fields of view range, if the number of objects in the first sub-field of view range is greater than the rated maximum number corresponding to the first sub-field of view range, attribute information corresponding to each object in the first sub-field of view range is obtained, and the attribute information is for representing the relationship between the object and the target object.
[0133] The first sub-field of view may be any one of the plurality of sub-fields of view. The rated maximum number corresponding to the first sub-field of view refers to the rated maximum number of objects included in the first sub-field of view. The rated maximum numbers corresponding to different sub-fields of view may be the same or different. This application is not limited thereto.
[0134] For example, if the rated maximum number corresponding to the first sub-field of view is 25, the actual number of objects in the first sub-field of view is 30. If the actual number exceeds the rated maximum number of 25, some objects need to be selected and removed. In this embodiment, the objects to be displayed and the objects to be removed are determined based on the attribute information of the objects. Here, the attribute information of the objects includes at least one of, but is not limited to, whether the object is a friend, ally, or enemy of the target object, the distance from the target object, the intimacy level with the target object, and whether or not there is an interaction with the target object. This is not a limitation of the present application.
[0135] In step 1160, a weight corresponding to each object within the first sub-field of view is determined based on attribute information corresponding to each object within the first sub-field of view.
[0136] For each object in the first sub-field of view, a weight corresponding to the object is determined based on the attribute information of the object, where the weight represents the selection priority of the object. For example, a higher weight for an object indicates that the object should be retained for display, and a lower weight for an object indicates that the object should be removed.
[0137] Furthermore, the embodiment of the present application does not limit the manner of calculating the weight based on the attribute information, and may perform the calculation by, for example, setting up a mathematical formula, an algorithm, or a neural network model.
[0138] In step 1170, from among the objects within the first sub-field of view, an object whose weight meets the condition is selected as a display object within the first sub-field of view, where a display object refers to an object to be displayed within the field of view of the target object.
[0139] For example, the maximum number of rated values corresponding to the first sub-field of view is N max Then, among the objects in the first sub-field of view, N max The object is selected as a display object within the first sub-field of view.
[0140] Optionally, among the objects within the first sub-field of view, the remaining objects other than those selected as the above-mentioned display objects may be removed from the first sub-field of view, for example, by not displaying these remaining objects within the field of view of the target object.
[0141] Optionally, the method provided in the embodiment of the present application may further include the following step 1180:
[0142] In step 1180, for a second sub-field of view range among the plurality of sub-field of view ranges, if the number of objects in the second sub-field of view range is less than the rated maximum number corresponding to the second sub-field of view range, the remaining objects in the first sub-field of view range are assigned to the second sub-field of view range.
[0143] Here, the remaining objects refer to objects in the first sub-field of view whose weights do not meet the condition. The remaining objects are displayed at a refresh frequency corresponding to the second sub-field of view. Optionally, the remaining objects may be displayed at a refresh frequency corresponding to the first sub-field of view.
[0144] For example, if the rated maximum number corresponding to the second sub-field of view is 20 and the actual number of objects in the second sub-field of view is 10, there will be 10 remaining objects in the second sub-field of view. If there are five remaining objects in the first sub-field of view, these five remaining objects may be assigned to the second sub-field of view. These five remaining objects will be displayed at a refresh frequency corresponding to the second sub-field of view. This method makes use of the remaining capacity in other sub-fields, avoids resource waste, and ensures that as many objects as possible in the field of view as possible are displayed, compared to a method that directly removes the remaining objects.
[0145] Furthermore, assuming that the remaining capacity in the second sub-field of view is a (a is a positive integer) and the number of remaining objects in the first sub-field of view is b (b is a positive integer), if a is greater than or equal to b, all of the b remaining objects may be directly assigned to the second sub-field of view; if a is less than b, a remaining objects may be selected from the b remaining objects and assigned to the second sub-field of view. The selection method here may be based on the weights associated with the objects; for example, the a remaining objects with the largest weight may be selected, or they may be selected randomly. This is not a limitation of the present application.
[0146] It is also possible that remaining objects in one sub-field of view range are assigned to multiple different sub-fields of view, and that one sub-field of view range is assigned remaining objects from multiple different sub-fields of view.
[0147] Furthermore, if there are remaining objects in multiple sub-fields of view, the remaining objects in the sub-fields of view with higher priority may be preferentially selected based on the priority of each sub-field of view and allocated to other sub-fields of view with remaining capacity. Here, the priority of a sub-field of view may be related to the distance between the sub-field of view and the target object or the attention level of the sub-field of view. For more details, please refer to the introduction and explanation above, and a detailed explanation will be omitted here.
[0148] In the configuration provided in the embodiments of the present application, by dividing the field of view of an object and setting different refresh frequencies for different sub-fields of view, the management of the field of view of an object becomes more rational, and by reducing the refresh frequency of objects in outer sub-fields of view or sub-fields of low priority, the display quality of the user's main focus objects can be guaranteed while minimizing the burden on the server and client.
[0149] In addition, after calculating the weights for objects within the field of view, objects with higher weights are displayed preferentially, reducing the burden on the server and client while displaying important objects within the field of view, thereby making the display of objects within the field of view more rational.
[0150] Furthermore, in the embodiment of the present application, by completely separating field of view update and object management, field of view customization becomes very convenient and simple. For example, the shape of the field of view of a target object can be flexibly customized and adjusted, and the size of the field of view of a target object can also be flexibly customized and adjusted. Taking a game as an example, when a target object uses an item or function to increase its field of view, it is only necessary to update the field of view and then find the set of objects within the field of view from the object management tree based on the updated field of view. In other words, updating the field of view does not affect object management in the object management tree, and even if the field of view is updated, the set of objects within the field of view can still be determined efficiently and accurately.
[0151] The following are examples of apparatuses of the present application that can be used to carry out the method embodiments of the present application: For details not disclosed in the apparatus embodiments of the present application, reference is made to the method embodiments of the present application.
[0152] Please refer to FIG. 14. FIG. 14 shows a block diagram of an object management device provided in one embodiment of the present application. This device has a function for implementing the above-mentioned object management method. This function may be implemented by hardware, or by hardware executing corresponding software. The device 140 may include a location acquisition module 141, a node determination module 142, an area division module 143, and a node placement module 144.
[0153] The position acquisition module 141 acquires the position information of a first object added to a scene.
[0154] The node determination module 142 determines a first node from an object management tree corresponding to a scene based on the position information of the first object, where the object management tree includes multiple nodes, each node corresponding to an area in the scene, and the areas corresponding to different nodes do not overlap with each other, and the first node refers to the node corresponding to the area to which the position information of the first object belongs.
[0155] When the number of objects included in the area corresponding to the first node becomes greater than an upper limit when a first object is added to the area corresponding to the first node, the area division module 143 divides the area corresponding to the first node into n child areas (n is an integer greater than 1) based on the position information of each object included in the area corresponding to the first node, and the number of objects included in each child area is the same or similar.
[0156] The node arrangement module 144 arranges n nodes in the object management tree in one-to-one correspondence with the n child regions.
[0157] In some embodiments, as shown in FIG. 15, the region segmentation module 143 includes a span determination unit 1431, a dimension selection unit 1432, and a region segmentation unit 1433.
[0158] The span determination unit 1431 determines distance spans in k (k is a positive integer) spatial dimensions of each object included in the area corresponding to the first node based on the position information of each object included in the area corresponding to the first node.
[0159] The dimension selection unit 1432 selects the target spatial dimension from among the k spatial dimensions that has the largest distance span.
[0160] The region division module 143 divides the region corresponding to the first node into n child regions, with the target spatial dimension as the division target.
[0161] In some embodiments, the region division module 143 determines the first object and the second object that are farthest apart in the target space dimension from among the objects included in the region corresponding to the first node, and obtains n-1 division points by equally dividing the line segment between the two projection points of the first object and the second object in the target space dimension, and divides the region corresponding to the first node into n child regions based on the n-1 division points.
[0162] In some embodiments, the node arrangement module 144 obtains the number of child nodes of the parent node of a first node, and if the number of child nodes satisfies a first condition, adds n-1 sibling nodes of the first node to the object management tree and arranges the first node and the n-1 sibling nodes in one-to-one correspondence with the n child areas; and if the number of child nodes satisfies a second condition, adds n child nodes of the first node to the object management tree and arranges the n child nodes in one-to-one correspondence with the n child areas.
[0163] In some embodiments, if the number of child nodes satisfies a third condition, the node arrangement module 144 further adds n1 sibling nodes of the first node to the object management tree, adds n2 child nodes of the first node to the object management tree, and arranges the n1 sibling nodes and the n2 child nodes in one-to-one correspondence with the n child regions, where n1 and n2 are positive integers and n1+n2 is equal to n.
[0164] In some embodiments, as shown in FIG. 15, the apparatus 140 further includes a node selection module 145, a region merging module 146, and a node deletion module 147.
[0165] The position acquisition module 141 further acquires position information of the second object reduced from the scene.
[0166] The node determination module 142 further determines a second node from the object management tree based on the location information of the second object, where the second node refers to a node corresponding to the area to which the location information of the second object belongs.
[0167] The node selection module 145 determines a third node to be merged with the second node from the object management tree if, when the second object is removed from the area corresponding to the second node, the number of objects included in the area corresponding to the second node becomes smaller than a lower limit value.
[0168] The region merging module 146 updates the region corresponding to the third node to a merged region of the original region corresponding to the third node and the region corresponding to the second node.
[0169] The node deletion module 147 deletes the second node from the object management tree.
[0170] In some embodiments, the region merging module 146: If the number of third nodes is 1, update the area corresponding to the third node into a combined area of the original area corresponding to the third node and the complete area corresponding to the second node; or, If the number of third nodes is k (k is an integer greater than 1), the area corresponding to the second node is divided into k child areas, the k third nodes are in one-to-one correspondence with the k child areas, and for each third node among the k third nodes, the area corresponding to the third node is updated to an integrated area of the original area corresponding to the third node and a child area among the k child areas that matches the third node.
[0171] In some embodiments, the node deletion module 147 further deletes the parent node of the third node from the object management tree if the parent node of the third node has only one child node, and makes the third node a child node of its grandparent node.
[0172] In some embodiments, as shown in FIG. 15, the device 140 further includes a field of view acquisition module 148, an object determination module 149, a field of view division module 150, and a frequency determination module 151.
[0173] The field of view acquisition module 148 acquires the field of view of a target object in a scene.
[0174] The object determination module 149 determines a set of objects located within the field of view based on the object management tree, where the set of objects includes at least one object located within the field of view.
[0175] The field of view division module 150 divides the field of view into multiple sub-fields, and the distances between different sub-fields and the target object are different.
[0176] The frequency determination module 151 determines a refresh frequency corresponding to each of the objects in the object set based on the sub-field of view to which each of the objects belongs, and the refresh frequency corresponding to an object is negatively correlated with the distance between the sub-field of view to which the object belongs and the target object.
[0177] In some embodiments, as shown in FIG. 15, the device 140 further includes an attribute acquisition module 152, a weight determination module 153, and an object selection module 154.
[0178] The attribute acquisition module 152 acquires attribute information corresponding to each object in a first sub-field of view range among the plurality of sub-fields of view ranges when the number of objects in the first sub-field of view range is greater than a rated maximum number corresponding to the first sub-field of view range, and the attribute information is for representing a relationship between the object and a target object.
[0179] The weight determination module 153 determines a weight corresponding to each object within the first sub-field of view based on attribute information corresponding to each object within the first sub-field of view.
[0180] The object selection module 154 selects an object whose weight meets a condition from among the objects within the first sub-field of view range as a display object within the first sub-field of view range, where a display object refers to an object to be displayed within the field of view range of the target object.
[0181] In some embodiments, as shown in FIG. 15, the apparatus 140 further includes an object allocation module 155 .
[0182] The object allocation module 155 allocates the remaining objects in the first sub-field of view to the second sub-field of view if the number of objects in the second sub-field of view is less than the maximum number of objects specified for the second sub-field of view. The remaining objects refer to objects in the first sub-field of view whose weights do not meet the condition. The remaining objects are displayed at a refresh frequency corresponding to the second sub-field of view.
[0183] In the configuration provided in the embodiment of the present application, if a region in a scene has too many objects and needs to be divided, the region is divided into multiple sub-regions according to the distribution location of each object contained in the region, and the number of objects contained in each sub-region is made as equal as possible. In other words, each sub-region has a different spatial size, but manages the same number of objects. In this way, not only can memory usage be reduced by avoiding excessive node growth, but the number of objects managed in a certain region can be directly divided into n equal parts, improving object management efficiency.
[0184] In some embodiments, the present application provides an object management system, as shown in Figure 16. The system includes an object management layer 161 and an AOI field of view layer 162.
[0185] The AOI field of view layer 162 sends the field of view range data of the target object in the scene to the object management layer 161, and the field of view range data of the target object is for indicating the field of view range of the target object.
[0186] The object management layer 161 determines the field of view of the target object based on the field of view data of the target object, determines an object set located within the field of view of the target object based on the object management tree corresponding to the scene, and sends object set data to the AOI field of view layer 162 to indicate the object set within the field of view of the target object, the object set includes at least one object located within the field of view of the target object, the object management tree includes multiple nodes, each node corresponds to an area in the scene, the areas corresponding to different nodes do not overlap with each other, and the number of objects included in the areas corresponding to different nodes is the same or similar.
[0187] The AOI field of view layer 162 determines a set of objects within the field of view of the target object based on the object set data.
[0188] In the present embodiment, the object management layer 161 and the AOI field of view layer 162 can be regarded as two independent functional modules. The object management layer 161 is primarily responsible for managing objects in a scene using an object management tree, while the AOI field of view layer 162 is primarily responsible for obtaining objects within a field of view and providing data related to the objects within the field of view to clients. The object management layer 161 can provide an interface to the AOI field of view layer 162. When the AOI field of view layer 162 needs to obtain object set data within the field of view of a target object, it calls this interface to send the field of view data of the target object to the object management layer 161. The object management layer 161 obtains the object set data within the field of view of the target object and feeds it back to the AOI field of view layer 162.
[0189] In some embodiments, the AOI viewing layer 162 further comprises: Dividing the field of view of the target object into a plurality of sub-fields, the distances between the different sub-fields and the target object are different; A refresh frequency corresponding to each of the objects in the object set is determined based on the sub-field of view to which each of the objects belongs, and the refresh frequency corresponding to an object is negatively correlated with the distance between the sub-field of view to which the object belongs and the target object.
[0190] In some embodiments, the AOI viewing layer 162 further comprises: For a first sub-field of view range among the plurality of sub-fields of view ranges, if the number of objects in the first sub-field of view range is greater than a rated maximum number corresponding to the first sub-field of view range, obtain attribute information corresponding to each object in the first sub-field of view range, wherein the attribute information is for representing a relationship between the object and the target object; determining a weight corresponding to each of the objects within the first sub-field of view based on attribute information corresponding to each of the objects within the first sub-field of view; From among the objects within the first sub-field of view, an object whose weight matches a condition is selected as a display object within the first sub-field of view, where the display object refers to an object to be displayed within the field of view of the target object.
[0191] In some embodiments, the object management layer 161 further comprises: Get the position information of the first object added to the scene, determining a first node from the object management tree based on the location information of the first object, where the first node refers to a node corresponding to an area to which the location information of the first object belongs; When the first object is added to the area corresponding to the first node, if the number of objects included in the area corresponding to the first node becomes greater than an upper limit, the area corresponding to the first node is divided into n child areas (n is an integer greater than 1) based on the position information of each object included in the area corresponding to the first node, and the number of objects included in each child area is equal to or close to the upper limit. N nodes that correspond one-to-one to the n child regions are arranged in the object management tree.
[0192] In some embodiments, the object management layer 161 further comprises: Obtain the position information of the second object reduced from the scene, determining a second node from the object management tree based on the location information of the second object, where the second node refers to a node corresponding to an area to which the location information of the second object belongs; If the number of objects included in the area corresponding to the second node becomes smaller than a lower limit value when the second object is removed from the area corresponding to the second node, determine a third node to be merged with the second node from the object management tree; Update the area corresponding to the third node to a combined area of the original area corresponding to the third node and the area corresponding to the second node; Delete the second node from the object management tree.
[0193] In some embodiments, as shown in FIG. 16 , the AOI field layer 162 may include a multi-ring AOI layer 1621, an AOI weight selection layer 1622, and an AOI object set layer 1623. The multi-ring AOI layer 1621 is primarily responsible for connecting with the object management layer 161 and obtaining object sets within the field of view from the object management layer 161 and dividing the field of view into sub-fields. For example, the multi-ring AOI layer 1621 obtains object set data within the field of view of a target object from the object management layer 161 and determines the object set within the field of view of the target object based on the object set data. Furthermore, the multi-ring AOI layer 1621 divides the field of view of the target object into multiple sub-fields and determines the refresh frequency for each object in the object set based on the sub-field to which each object belongs. The AOI weight selection layer 1622 is primarily responsible for calculating and selecting object weights. For example, the AOI weight selection layer 1622 acquires attribute information corresponding to each object in the first sub-field of view, determines a weight corresponding to each object in the first sub-field of view based on the attribute information, and selects objects in the first sub-field of view whose weights meet certain conditions as display objects in the first sub-field of view. The AOI object collection layer 1623 is primarily responsible for connecting with a client and providing the client with the final object collection data. Of course, the functional hierarchical division of the AOI field of view layer 162 described above is merely exemplary, and the hierarchical division may be flexibly configured. This application is not limited thereto.
[0194] Also, for details not described in detail in this system embodiment, please refer to the method embodiment above.
[0195] In the configuration provided in the embodiments of the present application, by separating view update and object management at the system level, with the AOI view layer responsible for view update and the object management layer responsible for object management, and making these two functional layers independent of each other, these two functional layers can be used separately or in combination, and the system is highly abstract and portable.
[0196] Please refer to Figure 17. Figure 17 shows a schematic diagram of the configuration of a computer device provided in one embodiment of the present application. The computer device may be any electronic device with the functions of calculating, processing, and storing data, such as the terminal device or server introduced above, and implements the object management method provided in the above embodiment. Specifically, The computing device 1700 includes a central processing unit (e.g., a central processing unit (CPU), a graphics processing unit (GPU), and a field programmable gate array (FPGA)) 1701, a system memory 1704 including random-access memory (RAM) 1702 and read-only memory (ROM) 1703, and a system bus 1705 connecting the system memory 1704 and the central processing unit 1701. The computing device 1700 further includes a basic input / output system (I / O system) 1706 that assists in the transfer of information between components within the server, and a mass storage device 1707 for storing an operating system 1713, applications 1714, and other program modules 1715.
[0197] The basic input / output system 1706 includes a display 1708 for displaying information and input devices 1709, such as a mouse and keyboard, for inputting information by a user, both of which are connected to the central processing unit 1701 via an input / output controller 1710 that is connected to the system bus 1705. The basic input / output system 1706 may further include an input / output controller 1710 for accepting and processing input from a number of other devices, such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1710 may provide output to a display, a printer, or other type of output device.
[0198] The mass storage device 1707 is connected to the central processing unit 1701 through a mass storage controller (not shown) connected to the system bus 1705. The mass storage device 1707 and its associated computer-readable media provide non-volatile storage for the computing device 1700. That is, the mass storage device 1707 may include a computer-readable medium (not shown), such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0199] Without loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented by any method or technology for storage of information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state memory technology, CD-ROM, digital video disk (DVD) or other optical storage, tape cartridge, magnetic tape, magnetic disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media is not limited thereto. The system memory 1704 and mass storage device 1707 may be collectively referred to as memory.
[0200] According to an embodiment of the present application, the computing device 1700 may be connected to a remote computer on a network, such as the Internet, through a network. That is, the computing device 1700 may be connected to a network 1712 through a network interface unit 1711 connected to the system bus 1705, or in other words, the computing device 1700 may be connected to another type of network or remote computer system (not shown) using the network interface unit 1711.
[0201] The memory further includes a computer program stored in the memory and configured to be executed by one or more processors to implement the object management method described above.
[0202] In an exemplary embodiment, a computer-readable storage medium is provided having stored thereon a computer program which, when executed by a processor of a computing device, implements the object management method described above.
[0203] Optionally, the computer-readable storage medium may include a read-only memory (ROM), a random-access memory (RAM), a solid-state drive (SSD), an optical disk, etc. Here, the random-access memory may include a resistance random-access memory (ReRAM) or a dynamic random-access memory (DRAM).
[0204] In an exemplary embodiment, there is further provided a computer program product including a computer program stored on a computer-readable storage medium, the computer program being read by a processor of the computer device from the computer-readable storage medium and, when executed by the processor, causing the computer device to perform the object management method described above.
[0205] It should be understood that the term "multiple" used herein refers to two or more than two. "And / or" describes a relationship between related objects and indicates that three types of relationships are possible. For example, A and / or B can represent three cases: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the related objects before and after are in an "or" relationship. Furthermore, the step numbers described herein merely exemplify one example of a possible execution order between steps. In some other embodiments, the steps may not be executed in this order. For example, two steps with different numbers may be executed simultaneously, or two steps with different numbers may be executed in the reverse order of the illustration. The embodiments of the present application are not limited thereto.
[0206] The above are only illustrative examples of the present application and do not limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application should be included within the protection scope of the present application.
Claims
1. 1. An object management method executed by a computer device, comprising: acquiring position information of a first object added to a scene, the scene being a virtual scene in a game application displayed on a terminal, the first object being one of characters in the scene, and the position information indicating a position of the first object in the scene; determining a first node from an object management tree corresponding to the scene based on the position information of the first object, the object management tree including a plurality of nodes, each node corresponding to an area in the scene, areas corresponding to different nodes do not overlap each other, and the first node refers to a node corresponding to the area to which the position information of the first object belongs; a step of dividing the area corresponding to the first node into n child areas (n is an integer greater than 1) based on position information of each object included in the area corresponding to the first node, when the number of objects included in the area corresponding to the first node becomes greater than an upper limit value when the first object is added to the area corresponding to the first node, wherein the number of objects included in each child area is the same or similar; arranging n nodes in the object management tree in one-to-one correspondence with the n child regions; obtaining a field of view of a target object within the scene; determining a set of objects located within the field of view based on the object management tree, the set of objects including at least one object located within the field of view; Dividing the field of view into a plurality of sub-fields of view, the distances between different sub-fields of view and the target object being different; determining a refresh frequency corresponding to each of the objects in the object set based on a sub-field of view to which the object belongs, wherein the refresh frequency corresponding to the object is negatively correlated with a distance between the sub-field of view to which the object belongs and the target object; A method comprising:
2. The step of dividing the area corresponding to the first node into n child areas based on position information of each object included in the area corresponding to the first node includes: determining distance spans in k spatial dimensions (k is a positive integer) of each object included in the area corresponding to the first node based on position information of each object included in the area corresponding to the first node; selecting a target spatial dimension from among the k spatial dimensions for which the distance span is greatest; and dividing the region corresponding to the first node into the n child regions using the target spatial dimension as a division target. The method of claim 1.
3. The step of dividing the region corresponding to the first node into the n child regions with the target spatial dimension as a division target includes: determining a first object and a second object that are furthest in distance in the target spatial dimension from among the objects included in the area corresponding to the first node; obtaining n-1 division points by equally dividing a line segment between two projection points of the first object and the second object in the target space dimension; Dividing the region corresponding to the first node into the n child regions based on the n-1 division points. The method of claim 2.
4. The step of arranging n nodes in the object management tree in one-to-one correspondence with the n child regions includes: obtaining the number of child nodes of the parent node of the first node; If the number of the child nodes satisfies a first condition, adding n-1 sibling nodes of the first node to the object management tree, and arranging the first node and the n-1 sibling nodes in one-to-one correspondence with the n child regions; If the number of the child nodes satisfies a second condition, adding n child nodes of the first node to the object management tree, and arranging the n child nodes in one-to-one correspondence with the n child regions. The method of claim 1.
5. After the step of obtaining the number of child nodes of the parent node of the first node, If the number of the child nodes satisfies a third condition, the method further includes the steps of: adding n1 sibling nodes of the first node to the object management tree; adding n2 child nodes of the first node to the object management tree; and arranging the n1 sibling nodes and the n2 child nodes in one-to-one correspondence with the n child areas, where n1 and n2 are positive integers and n1+n2 is equal to n; The method of claim 4.
6. obtaining position information of a second object reduced from the scene; determining a second node from the object management tree based on the location information of the second object, the second node being a node corresponding to an area to which the location information of the second object belongs; determining a third node to be merged with the second node from the object management tree when the number of objects included in the area corresponding to the second node becomes smaller than a lower limit value when the second object is removed from the area corresponding to the second node; updating the area corresponding to the third node to a combined area of the original area corresponding to the third node and the area corresponding to the second node; and deleting the second node from the object management tree. The method of claim 1.
7. The step of updating the area corresponding to the third node to an integrated area of the original area corresponding to the third node and the area corresponding to the second node includes: If the number of the third nodes is one, updating the area corresponding to the third node to a combined area of the original area corresponding to the third node and the complete area corresponding to the second node; or, and if the number of the third nodes is k (k is an integer greater than 1), dividing the region corresponding to the second node into k child regions, placing the k third nodes in one-to-one correspondence with the k child regions, and updating, for each third node among the k third nodes, the region corresponding to the third node into a combined region of the original region corresponding to the third node and a child region among the k child regions that matches the third node. The method of claim 6.
8. After the step of deleting the second node from the object management tree, If the parent node of the third node has only one child node, the step of deleting the parent node of the third node from the object management tree and making the third node a child node of its grandparent node is further included. The method of claim 6.
9. For a first sub-field of view range among the plurality of sub-fields of view ranges, if the number of objects in the first sub-field of view range is greater than a rated maximum number corresponding to the first sub-field of view range, acquiring attribute information corresponding to each object in the first sub-field of view range, wherein the attribute information is for representing a relationship between the object and the target object; determining a weight corresponding to each of the objects within the first sub-field of view based on attribute information corresponding to each of the objects within the first sub-field of view; selecting, from among the objects within the first sub-field of view range, an object whose weight matches a condition as a display object within the first sub-field of view range, wherein the display object refers to an object to be displayed within the field of view range of the target object, The method of claim 1.
10. further comprising the step of, for a second sub-field of view of the plurality of sub-fields of view, allocating the remaining objects in the first sub-field of view to the second sub-field of view when the number of objects in the second sub-field of view is less than a rated maximum number corresponding to the second sub-field of view; the remaining objects refer to objects in the first sub-field of view whose weights do not meet the condition, and the remaining objects are displayed at a refresh frequency corresponding to the second sub-field of view.
10. The method of claim 9.
11. An object management device, a position acquisition module that acquires position information of a first object added to a scene, the scene being a virtual scene in a game application displayed on a terminal, the first object being one of characters in the scene, and the position information indicating a position of the first object in the scene; a node determination module that determines a first node from an object management tree corresponding to the scene based on the position information of the first object, the object management tree including a plurality of nodes, each node corresponding to an area in the scene, areas corresponding to different nodes do not overlap each other, and the first node refers to a node corresponding to the area to which the position information of the first object belongs; an area division module that divides the area corresponding to the first node into n child areas (n is an integer greater than 1) based on position information of each object included in the area corresponding to the first node, when the number of objects included in the area corresponding to the first node becomes greater than an upper limit value when the first object is added to the area corresponding to the first node, and the number of objects included in each child area is the same or similar; a node arrangement module that arranges n nodes in one-to-one correspondence with the n child regions in the object management tree; a field of view acquisition module for acquiring a field of view of a target object within the scene; an object determination module that determines a set of objects located within the field of view based on the object management tree, the set of objects including at least one object located within the field of view; a field of view division module for dividing the field of view into a plurality of sub-fields, the sub-fields having different distances from the target object; a frequency determination module that determines a refresh frequency corresponding to each of the objects in the object set based on a sub-field of view to which each of the objects belongs, wherein the refresh frequency corresponding to each of the objects is negatively correlated with a distance between the sub-field of view to which the object belongs and the target object; An apparatus comprising:
12. A computing device comprising a processor and a memory, the memory storing a computer program that, when loaded and executed by the processor, performs the method of any one of claims 1 to 10.
13. 11. A computer program product including a computer program, the computer program being stored in a computer-readable storage medium, the computer program being read by a processor from the computer-readable storage medium and executed by the processor to cause the computer to perform the method of any one of claims 1 to 10.
14. 1. An object management system including an object management layer and an area of interest (AOI) viewing layer, the AOI field of view layer transmits field of view range data of a target object in a scene, which is a virtual scene in a game application displayed on a terminal, to the object management layer, the field of view range data of the target object being for indicating the field of view range of the target object; the object management layer determines a field of view of the target object based on the field of view data of the target object, determines an object set located within the field of view of the target object based on an object management tree corresponding to the scene, and transmits object set data indicating the object set within the field of view of the target object to the AOI field of view layer, the object set including at least one object located within the field of view of the target object, the object management tree including a plurality of nodes, each node corresponding to an area in the scene, the areas corresponding to different nodes do not overlap with each other, and the number of objects included in the areas corresponding to different nodes is the same or close; The AOI field of view layer determines an object set within a field of view of the target object based on the object set data; The object management layer: acquiring position information of a first object added to the scene, the first object being one of the characters in the scene, and the position information indicating a position of the first object within the scene; determining a first node from an object management tree corresponding to the scene based on the position information of the first object, the object management tree including a plurality of nodes, each node corresponding to an area in the scene, areas corresponding to different nodes do not overlap each other, and the first node refers to a node corresponding to the area to which the position information of the first object belongs; a step of dividing the area corresponding to the first node into n child areas (n is an integer greater than 1) based on position information of each object included in the area corresponding to the first node, when the number of objects included in the area corresponding to the first node becomes greater than an upper limit value when the first object is added to the area corresponding to the first node, wherein the number of objects included in each child area is the same or similar; arranging n nodes in the object management tree in one-to-one correspondence with the n child regions; obtaining a field of view of a target object within the scene; determining a set of objects located within the field of view based on the object management tree, the set of objects including at least one object located within the field of view; Dividing the field of view into a plurality of sub-fields of view, the distances between different sub-fields of view and the target object being different; determining a refresh frequency corresponding to each of the objects in the object set based on a sub-field of view to which each of the objects belongs, wherein the refresh frequency corresponding to each of the objects is negatively correlated with a distance between the sub-field of view to which the object belongs and the target object; system.
Citation Information
Patent Citations
Game scene loading method, device, computer readable medium and electronic equipment
CN110716766A
Resource generation method and device in game scene, medium and electronic equipment
CN111467806A
Computer graphics methods for rendering 3D scenes
JP2015535978A
Space partitioning trees using planes selected from a discrete set of orientations
US8400447B1
Method, device, computer apparatus and storage medium for electing representative node apparatus
WO2020048436A1