Game data processing method, device, computer equipment and storage medium
By merging the visible sets of the target sub-region and the adjacent sub-region in the virtual scene, the problem of high number of times of calculating visible sets in the prior art is solved, which improves processing efficiency and reduces resource consumption.
Patent Information
- Application Number
- CN202210141625.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-16
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-02-16
AI Technical Summary
When the prior art deals with occlusion culling in virtual scenes, calculating the visible set gap requires multiple calculations, resulting in large resource consumption and affecting efficiency.
By obtaining the visible sets of the target sub-region and the adjacent sub-region, the difference value is calculated and the visible sets corresponding to the difference value that meets the preset conditions are combined to reduce the number of calculations and improve processing efficiency.
The total time to calculate the visible set gap is reduced, the processing efficiency of virtual scenes is improved, and resource consumption is reduced.
Smart Images

Figure CN114522420B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a game data processing method, device, computer equipment and storage medium. Background Art
[0002] Occlusion culling refers to the technique of not rendering an object when it is blocked by other objects and is not within the camera's visible range. Occlusion culling works by using a virtual camera in the scene to create a hierarchy of potential visibility states for objects. This data allows each camera to distinguish whether an object is visible in real time, and only visible objects will be rendered, thereby reducing the number of draw calls and increasing the efficiency of the game.
[0003] In the related art, when rendering a scene, the scene is first divided into several small cubic areas, and then the visible set of each area is calculated. According to the visible set of the corresponding area, invisible objects are not rendered. When the number of areas is large, the number of visible sets will also be large, which will increase resource consumption. Therefore, a brute force clustering algorithm is designed, that is, for all visible sets, the gap between each other is calculated, and then the visible sets with the smallest gap are continuously selected for merging. Since it takes a certain amount of time to calculate the gap between visible sets, when the number of visible sets is large, multiple calculations are required, which consumes a lot of computing time, thereby affecting the aggregation efficiency of the visible sets. Summary of the invention
[0004] The embodiments of the present application provide a game data processing method, apparatus, computer equipment and storage medium, which can improve the processing efficiency of the visible set of virtual scenes.
[0005] The present application embodiment provides a game data processing method, including:
[0006] Acquire a target visible set corresponding to a target sub-region among a plurality of sub-regions divided into a specified virtual scene, wherein the target visible set includes visibility of at least one object in the specified virtual scene in the target sub-region;
[0007] Determine a subregion adjacent to the target subregion from among the subregions to obtain at least one adjacent subregion;
[0008] Acquire a visible set to be merged corresponding to the adjacent sub-region, wherein the visible set to be merged includes visibility of at least one object in the designated virtual scene in the adjacent sub-region;
[0009] Determine a difference value between the target visible set and the visible set to be merged;
[0010] The target visible set corresponding to the difference value satisfying the preset condition is merged with the visible set to be merged to obtain an aggregated visible set, and the aggregated visible set is used as a common visible set of the target sub-region and the adjacent sub-region.
[0011] Accordingly, the embodiment of the present application further provides a game data processing device, including:
[0012] A first acquisition unit, configured to acquire a target visible set corresponding to a target sub-region among a plurality of sub-regions divided into a specified virtual scene, wherein the target visible set includes visibility of at least one object in the specified virtual scene in the target sub-region;
[0013] A first determining unit, configured to determine a subregion adjacent to the target subregion from among the subregions, to obtain at least one adjacent subregion;
[0014] A second acquisition unit, configured to acquire a visible set to be merged corresponding to the adjacent sub-region, wherein the visible set to be merged includes visibility of at least one object in the designated virtual scene in the adjacent sub-region;
[0015] A second determining unit, configured to determine a difference value between the target visible set and the visible set to be merged;
[0016] The merging unit is used to merge the target visible set corresponding to the difference value that meets the preset condition with the visible set to be merged to obtain an aggregated visible set, and use the aggregated visible set as the common visible set of the target sub-region and the adjacent sub-region.
[0017] In some embodiments, the second determining unit includes:
[0018] A first acquisition subunit, configured to acquire a first visibility corresponding to each object in the specified virtual scene in the target visible set, and a second visibility corresponding to each object in the visible set to be merged;
[0019] A comparison subunit, used to compare the first visibility and the second visibility corresponding to each object with the specified visibility respectively to obtain a comparison result;
[0020] The first determining subunit is configured to determine the difference value based on the comparison result.
[0021] In some embodiments, the first determining subunit is specifically configured to:
[0022] The number of objects whose first visibility is greater than the designated visibility and whose second visibility is less than the designated visibility, or whose first visibility is less than the designated visibility and whose second visibility is greater than the designated visibility is determined from the comparison result to obtain the difference value.
[0023] In some embodiments, the merging unit includes:
[0024] A second determining subunit is used to determine a visible set to be merged corresponding to a difference value not greater than the preset difference value, to obtain a target visible set to be merged;
[0025] The first merging subunit is configured to merge the target visible set with the target visible set to be merged to obtain the aggregated visible set.
[0026] In some embodiments, the first merging subunit is specifically used for:
[0027] Determine the maximum visibility corresponding to each object from the first visibility corresponding to each object in the target visible set and the second visibility corresponding to each object in the target visible set to be merged;
[0028] A new visible set is constructed based on the maximum visibility of all objects to obtain the aggregated visible set.
[0029] In some embodiments, the first merging subunit is specifically used for:
[0030] Sorting the multiple target visible sets to be merged according to the difference between the target visible set and each target visible set to be merged, to obtain a sorting sequence corresponding to the multiple target visible sets to be merged;
[0031] Combining the target visible set with each target visible set to be merged in sequence based on the sorting sequence;
[0032] Until the target visible set is combined with all target visible sets to be merged, the aggregated visible set is obtained.
[0033] In some embodiments, the apparatus further comprises:
[0034] A third acquisition unit, configured to acquire other visible sets whose first difference values with the visible set to be merged meet the preset condition;
[0035] The calculation unit is used to calculate a second difference value between the target visible set and the other visible sets.
[0036] In some embodiments, the merging unit includes:
[0037] The second merging subunit is used to merge the target visible set corresponding to the difference value that meets the preset condition with the visible set to be merged, and merge the target visible set corresponding to the second difference value that meets the preset condition with the other visible sets to obtain the aggregated visible set.
[0038] In some embodiments, the first determining unit includes:
[0039] A second acquisition subunit, configured to acquire first position information of the target sub-region in the designated virtual scene, and second position information of other sub-regions in the designated virtual scene;
[0040] The third determining subunit is configured to determine other sub-regions adjacent to the target sub-region according to the first position information and the second position information to obtain the adjacent sub-region.
[0041] In some embodiments, the third determining subunit is specifically configured to:
[0042] Based on the positional relationship between the first coordinate and each of the second coordinates in the coordinate system, other sub-regions corresponding to the second coordinates adjacent to the first coordinate are determined to obtain the adjacent sub-regions.
[0043] In some embodiments, the apparatus further comprises:
[0044] A fourth acquisition unit, configured to acquire historical merge information of the target visible set;
[0045] An execution unit is configured to execute a step of merging the target visible set corresponding to a difference value that meets a preset condition with the visible set to be merged if the historical merging information indicates that the target visible set is an unmerged visible set.
[0046] In some embodiments, the apparatus further comprises:
[0047] A processing unit is used to render objects in the specified virtual scene based on the aggregated visible set.
[0048] Correspondingly, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes any game data processing method provided in the embodiments of the present application.
[0049] Correspondingly, an embodiment of the present application further provides a storage medium, which stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute the above-mentioned game data processing method.
[0050] The embodiment of the present application determines a target sub-region that currently needs to be processed for visibility, selects an adjacent sub-region adjacent to the target sub-region according to the positional relationship between the target sub-region and the other sub-regions in the virtual scene, further determines the adjacent sub-region from the adjacent sub-regions according to the gap between the visible set corresponding to the target sub-region and the visible set corresponding to the adjacent sub-region, and then aggregates the visible set of the adjacent sub-region whose gap with the visible set of the target sub-region is less than a specified gap with the visible set of the target sub-region to obtain an aggregated visible set as the common visible set of the target sub-region and the adjacent sub-region, thereby reducing the number of times the visible set gap is calculated, thereby reducing the total time for calculating the visible set gap, thereby improving the processing efficiency of the visible set of the virtual scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 A flowchart of a method for processing game data provided in an embodiment of the present application.
[0053] Figure 2 A flowchart of another method for processing game data provided in an embodiment of the present application.
[0054] Figure 3 A schematic diagram of an application scenario of a game data processing method provided in an embodiment of the present application.
[0055] Figure 4 A schematic diagram of an application scenario of another game data processing method provided in an embodiment of the present application.
[0056] Figure 5 A schematic diagram of an application scenario of another game data processing method provided in an embodiment of the present application.
[0057] Figure 6 A schematic diagram of an application scenario of another game data processing method provided in an embodiment of the present application.
[0058] Figure 7 A schematic diagram of an application scenario of another game data processing method provided in an embodiment of the present application.
[0059] Figure 8 A schematic diagram of an application scenario of another game data processing method provided in an embodiment of the present application.
[0060] Fig. 9A schematic diagram of an application scenario of another game data processing method provided in an embodiment of the present application.
[0061] Fig.10 A structural block diagram of a game data processing device provided in an embodiment of the present application.
[0062] Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0064] The embodiment of the present application provides a game data processing method, device, storage medium and computer equipment. Specifically, the game data processing method of the embodiment of the present application can be performed by a computer device, wherein the computer device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA). The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms.
[0065] For example, the computer device may be a server, which may obtain a target visible set corresponding to a target sub-region among a plurality of sub-regions into which a specified virtual scene is divided, the target visible set including visibility of at least one object in a specified virtual scene in the target sub-region, determine a sub-region adjacent to the target sub-region from the sub-regions, obtain at least one adjacent sub-region, obtain a visible set to be merged corresponding to the adjacent sub-region, the visible set to be merged including visibility of at least one object in a specified virtual scene in the adjacent sub-region, determine a difference value between the target visible set and the visible set to be merged, merge the target visible set corresponding to the difference value that meets a preset condition with the visible set to be merged, obtain an aggregated visible set, and use the aggregated visible set as the common visible set of the target sub-region and the adjacent sub-region.
[0066] Based on the above problems, the embodiments of the present application provide a first game data processing method, apparatus, computer device and storage medium, which can improve the processing efficiency of the visible set of virtual scenes.
[0067] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0068] An embodiment of the present application provides a game data processing method, which can be executed by a terminal or a server. The embodiment of the present application takes the game data processing method executed by a server as an example for explanation.
[0069] See also Figure 1 , Figure 1 A flowchart of a method for processing game data provided by an embodiment of the present application is shown below.
[0070] 101. Obtain a target visible set corresponding to a target sub-region among multiple sub-regions divided into a specified virtual scene.
[0071] In the embodiment of the present application, the designated virtual scene refers to a model of a real scene constructed according to a certain proportion by a software program, which can be displayed by a display device. The designated virtual scene can be a three-dimensional scene.
[0072] Among them, when displaying a specified virtual scene through a display device, it is necessary to render the objects in the virtual scene. Rendering in computer graphics refers to the process of using software to generate images from models. The model is a description of a three-dimensional object using a strictly defined language or data structure. It includes geometry, viewpoint, texture, and lighting information. It is the process of projecting the model in the three-dimensional scene into a digital image in two dimensions according to the set environment, lighting, material, and rendering parameters.
[0073] Specifically, when rendering objects in a specified virtual scene, some objects are selected from all objects in the specified virtual scene for rendering according to the position of the image captured of the specified virtual scene. For occluded objects, that is, objects not displayed in the captured image, there is no need to render them, so as to save processing resources.
[0074] Since there may be many objects in the specified virtual scene, in order to facilitate the calculation of the objects to be rendered, the specified virtual scene can be divided into multiple sub-areas. The specified virtual scene can be a three-dimensional scene, and the multiple sub-areas can be non-intersecting cubic areas of the same shape.
[0075] For example, a three-dimensional coordinate system of a specified virtual scene can be constructed, including the x-axis, y-axis, and z-axis directions, and each sub-area can use two coordinates (x min ,y min , zmin ) and (x max ,y max , z max ) to describe, indicating that the sub-region contains and only contains coordinate points (x, y, z) that satisfy the following expression, with the condition that x min ≤x<x max And y min ≤y<y max And z min ≤y<z max Each region does not intersect with each other, that is, any point in a given virtual scene either does not belong to any sub-region or belongs to exactly one region.
[0076] Each object in the specified virtual scene has a corresponding visibility in each sub-area. The visibility refers to the visibility of the object when observed in the sub-area. When the position and direction of observation change in an area, the observable objects will also change accordingly. Through a certain estimation method, the visibility of each object can be estimated, which is referred to as visibility. The value range of visibility can be a real number representation of [0.0, 1.0]. The smaller the value, the less likely it is to be observed, and vice versa, it means it is easy to be observed.
[0077] For example, the specified virtual scene may include: object A, object B, object C, and the specified virtual scene is divided into: a first sub-area, a second sub-area, and a third sub-area. The visibility of object A in the first sub-area can be calculated as: 0.1, the visibility in the second sub-area can be: 0.5, and the visibility in the third sub-area can be: 0.3; the visibility of object B in the first sub-area can be calculated as: 0.24, the visibility in the second sub-area can be: 0.7, and the visibility in the third sub-area can be: 0.3; the visibility of object C in the first sub-area can be calculated as: 0.8, the visibility in the second sub-area can be: 0.65, and the visibility in the third sub-area can be: 0.31.
[0078] The target visible set includes the visibility of at least one object in the virtual scene specified in the target sub-region, that is, the observed degrees of all objects are arranged into a one-dimensional list, which is called a visible set.
[0079] For example, the target sub-region may be the first sub-region. In the first sub-region, the visibility of object A may be: 0.1, the visibility of object B may be: 0.24, and the visibility of object C may be: 0.8. Furthermore, according to the visibility of each object in the first sub-region, the target visible set is obtained as: [0.1, 0.24, 0.8].
[0080] When the observation position is in the target sub-region, a constant can be specified. Objects with a visibility less than the constant are considered invisible in the target sub-region, that is, they are not drawn during the rendering process; otherwise, the object is considered visible in the target sub-region and drawn. This reduces rendering overhead.
[0081] For example, for the above example, if 0.25 is selected as the constant, objects A and B are not visible in the target sub-area because the visibility of objects A and B is less than 0.25; object C is visible in the target sub-area because the visibility of object C is greater than 0.25. Since the content to be drawn is reduced, the drawing efficiency of the scene can be improved.
[0082] 102. Determine a sub-region adjacent to the target sub-region from the sub-regions to obtain at least one adjacent sub-region.
[0083] The adjacent sub-region refers to a sub-region that is closer to the target sub-region in the specified virtual scene.
[0084] In some embodiments, in order to select a sub-region adjacent to the target sub-region, the step of “determining a sub-region adjacent to the target sub-region from the sub-regions to obtain at least one adjacent sub-region” may include the following operations:
[0085] Acquire first position information of the target sub-region in the specified virtual scene, and second position information of other sub-regions in the specified virtual scene;
[0086] Other sub-regions adjacent to the target sub-region are determined according to the first position information and the second position information to obtain adjacent sub-regions.
[0087] The first position information refers to the position of the target sub-region in the coordinate system of the specified virtual scene, and the second position information refers to the position of other sub-regions except the target sub-region in the specified virtual scene in the coordinate system of the specified virtual scene.
[0088] Furthermore, other sub-regions adjacent to the target sub-region may be selected according to the positions of the target sub-region and other sub-regions in the coordinate system of the specified virtual scene, thereby obtaining adjacent sub-regions.
[0089] In some embodiments, a designated coordinate system is constructed based on a designated virtual scene, and the first position information includes a first coordinate of a target sub-region in the designated coordinate system, and the second position information includes a second coordinate of each sub-region in the designated coordinate system. In order to quickly determine adjacent sub-regions, the step of "determining other sub-regions adjacent to the target sub-region according to the first position information and the second position information to obtain adjacent sub-regions" may include the following operations:
[0090] Based on the positional relationship between the first coordinate and each second coordinate in the coordinate system, other sub-regions corresponding to the second coordinates adjacent to the first coordinate are determined to obtain adjacent sub-regions.
[0091] Specifically, in the above steps, it is mentioned that each sub-area in the specified coordinate system can use two coordinates (x min ,y min , z min ) and (x max ,y max , z max ), that is, the coordinate range from the minimum coordinate to the maximum coordinate. Since the sub-region is a three-dimensional region in the specified coordinate system, the adjacent sub-regions share the region edge, and then the other sub-regions with the same coordinate points as the coordinate range of the target sub-region can be determined from the second coordinates of each other sub-region, and the other sub-regions are used as adjacent sub-regions of the target sub-region.
[0092] 103. Obtain the visible set to be merged corresponding to the adjacent sub-regions.
[0093] The visible set to be merged includes visibility of at least one object in a specified virtual scene in the adjacent sub-region.
[0094] For example, the adjacent sub-region may be the second sub-region. In the second sub-region, the visibility of object A may be: 0.5, the visibility of object B may be: 0.7, and the visibility of object C may be: 0.65. Furthermore, according to the visibility of each object in the second sub-region, the visible set to be merged is: [0.5, 0.7, 0.65].
[0095] 104. Determine the difference value between the target visible set and the visible set to be merged.
[0096] Among them, the difference value is used to measure whether the target visible set and the visible set to be merged can be merged. The smaller the difference value, the smaller the difference between the visibility of the object in the target visible set and the visibility in the visible set to be merged, and the target visible set and the visible set to be merged can be merged; conversely, the larger the difference value, the larger the difference between the visibility of the object in the target visible set and the visibility in the visible set to be merged, and the target visible set and the visible set to be merged cannot be merged.
[0097] In some embodiments, in order to calculate the accuracy of the difference value, the step of "determining the difference value between the target visible set and the visible set to be merged" may include the following operations:
[0098] Obtaining a first visibility corresponding to each object in a specified virtual scene in a target visible set and a second visibility corresponding to each object in a visible set to be merged;
[0099] Compare the first visibility and the second visibility corresponding to each object with the specified visibility respectively to obtain a comparison result;
[0100] A difference value is determined based on the comparison result.
[0101] For example, in the above example, the specified virtual scene includes: object A, object B, object C, and the specified virtual scene is divided into: a first sub-area, a second sub-area, and a third sub-area. The target sub-area can be the first sub-area, and the target visible set includes the first visibility of object A, object B, and object C, which can be: [0.1, 0.24, 0.8]; the visible set to be merged includes the second visibility of object A, object B, and object C, which can be: [0.5, 0.7, 0.65].
[0102] The specified visibility is used as a visibility standard to determine whether to render an object. When the visibility of an object is greater than or equal to the specified visibility, the object can be rendered; if the visibility of the object is less than the specified visibility, the object does not need to be rendered. For example, the specified visibility can be 0.5.
[0103] Furthermore, the visibility of each object in different visible sets is compared with the specified visibility to obtain a comparison result, and then the difference value between the target visible set and the visible set to be merged is obtained according to the comparison result.
[0104] In some embodiments, in order to improve the accuracy of merging the visible sets, the step of “determining the difference value based on the comparison result” may include the following operations:
[0105] The number of objects whose first visibility is greater than a specified visibility and whose second visibility is less than the specified visibility, or whose first visibility is less than the specified visibility and whose second visibility is greater than the specified visibility, is determined from the comparison result to obtain a difference value.
[0106] By comparing the first visibility and the second visibility of each object with the specified visibility respectively, the comparison results obtained include: the first visibility of object A is less than the specified visibility, and the second visibility is equal to the specified visibility; the first visibility of object B is less than the specified visibility, and the second visibility is greater than the specified visibility; the first visibility of object C is greater than the specified visibility, and the second visibility is greater than the specified visibility.
[0107] Further, based on the comparison result, the number of objects whose first visibility is greater than the specified visibility and whose second visibility is less than the specified visibility, or whose first visibility is less than the specified visibility and whose second visibility is greater than the specified visibility may be 2, thereby obtaining a difference value of 2.
[0108] 105. The target visible set corresponding to the difference value that meets the preset condition is merged with the visible set to be merged to obtain an aggregated visible set, and the aggregated visible set is used as a common visible set of the target sub-region and the adjacent sub-region.
[0109] Among them, the preset condition is: not greater than the preset difference value.
[0110] In some embodiments, in order to improve the efficiency of merging visible sets, the step of "merging the target visible set corresponding to the difference value that meets the preset condition with the visible set to be merged to obtain an aggregated visible set" may include the following operations:
[0111] Determine the visible set to be merged corresponding to the difference value that is not greater than the preset difference value, and obtain the target visible set to be merged;
[0112] Merge the target visible set with the target visible set to be merged to obtain the aggregated visible set.
[0113] In an embodiment of the present application, in a specified virtual scene, there may be multiple adjacent areas adjacent to a target sub-area. For example, the specified virtual scene may be divided into: a first sub-area, a second sub-area, a third sub-area, a fourth sub-area, a fifth sub-area, a sixth sub-area, etc., wherein the target sub-area may be: a first sub-area, and adjacent sub-areas adjacent to the first sub-area may include: a third sub-area, a fourth sub-area, and a fifth sub-area.
[0114] Among them, the visible set corresponding to the first sub-area can be: the first visible set, that is, the target visible set; the visible set corresponding to the third sub-area of the third visible set can be: the third visible set; the visible set corresponding to the fourth sub-area can be: the fourth visible set; the visible set corresponding to the fifth sub-area can be: the fifth visible set.
[0115] Further, the difference values of the visible sets of the target sub-region and each adjacent sub-region are calculated, and the difference values of the target visible set and the third visible set can be: 2, the difference values of the target visible set and the fourth visible set can be: 1, and the difference values of the target visible set and the fifth visible set can be: 1.
[0116] For example, the preset difference value may be: 1, then the difference value that satisfies the preset condition, that is, the difference value that is not greater than the preset difference value is: 1, since the difference value between the target visible set and the fourth visible set is: 1, and the difference value between the target visible set and the fifth visible set is: 1, then the target visible set to be merged can be determined to be: the fourth visible set and the fifth visible set. Then, the target visible set and the target visible set to be merged are merged to obtain the aggregated visible set.
[0117] In some embodiments, in order to improve the merging effect of the visible sets, the step of "merging the target visible set with the target visible set to be merged to obtain an aggregated visible set" may include the following operations:
[0118] Determine the maximum visibility corresponding to each object from the first visibility corresponding to each object in the target visible set and the second visibility corresponding to each object in the target visible set to be merged;
[0119] A new visible set is constructed based on the maximum visibility of all objects to obtain the aggregated visible set.
[0120] For example, the target visible set includes the first visibility of each object, which can be: [0.2, 0.75, 0.8], and the target visible set to be merged includes the second visibility of each object, which can be: [0.5, 0.64, 0.76]. Among them, the first visibility of object A is: 0.2, and the second visibility is: 0.5, so it can be determined that the maximum visibility corresponding to object A is: 0.5; the first visibility of object B is: 0.74, and the second visibility is: 0.64, so it can be determined that the maximum visibility corresponding to object B is: 0.74; the first visibility of object C is: 0.8, and the second visibility is: 0.76, so it can be determined that the maximum visibility corresponding to object C is: 0.8, then, according to the maximum visibility corresponding to each object, a new visible set is constructed, and the aggregated visible set can be: [0.5, 0.74, 0.8].
[0121] In some embodiments, when there are multiple target visible sets to be merged with the target visible set, in order to improve the efficiency of merging visible sets, the step of "merging the target visible set with the target visible set to be merged to obtain an aggregated visible set" may include the following operations:
[0122] Sort the multiple target visible sets to be merged according to the difference between the target visible set and each target visible set to be merged, to obtain a sorting sequence corresponding to the multiple target visible sets to be merged;
[0123] Combining the target visible set with each target visible set to be merged in sequence based on the sorting sequence;
[0124] Until the target visible set is combined with all target visible sets to be merged, the aggregated visible set is obtained.
[0125] In the embodiment of the present application, a priority queue can be used to arrange multiple target visible sets to be merged. In the priority queue, elements are given priorities. When accessing elements, the element with the highest priority is deleted first. The priority queue has the behavior characteristics of the highest level first out (first in, largest out), and the priority queue is usually implemented using a heap data structure.
[0126] Specifically, a priority queue is a set of 0 or more elements, each of which has a priority or value. The operations performed on the priority queue are 1) search; 2) insert a new element; 3) delete. In the minimum priority queue (minpriorityqueue), the search operation is used to search for the element with the lowest priority, and the delete operation is used to delete the element; for the maximum priority queue (maxpriorityqueue), the search operation is used to search for the element with the highest priority, and the delete operation is used to delete the element. Elements in a priority queue can have the same priority, and the search and delete operations can be performed based on any priority.
[0127] Specifically, multiple target visible sets to be merged are sorted according to the difference values between the target visible set and each target visible set to be merged. The target visible sets to be merged can be sorted in order from small to large according to the difference values, and then the target visible sets to be merged that are merged with the target and have smaller difference values are merged first.
[0128] Furthermore, the sorted multiple target visible sets to be merged are inserted into a priority queue to obtain a sorted sequence. In the priority queue, the priority value corresponding to the target visible set to be merged with the target merge and the smaller difference value is set to be higher, that is, the merge process is performed first. Then the target visible set to be merged in the priority queue is merged with the target visible set in turn according to the priority order, until the target visible set is merged with all target visible sets to be merged, and the aggregated visible set is obtained.
[0129] For example, the target visible set to be merged may include: the third visible set, the fourth visible set and the fifth visible set. Further, according to the difference values between each target visible set to be merged and the target visible set, they are sorted from small to large, and the resulting sorted sequence may be: the third visible set, the fourth visible set, the fifth visible set.
[0130] Then, the target visible set is merged with the target visible set to be merged in sequence according to the sorting sequence, including: first merging the target visible set with the third visible set to generate a first merged visible set, then merging the first merged visible set with the fourth visible set to obtain a second merged visible set, and then merging the second merged visible set with the fifth visible set to obtain an aggregated visible set. In this way, the target visible set is merged with multiple target visible sets to be merged.
[0131] In some embodiments, in order to avoid repeated merging operations on visible sets, before the step of "merging the target visible set corresponding to the difference value that meets the preset condition with the visible set to be merged", the following steps may also be included:
[0132] Get the historical merge information of the target visible set;
[0133] If the historical merging information indicates that the target visible set is an unmerged visible set, the execution step merges the target visible set corresponding to the difference value that meets the preset condition with the visible set to be merged.
[0134] The historical merge message includes the visible set synthesis information corresponding to the target visible set before the current moment. For example, the historical merge message may include that the target visible set has been processed for visible set merging before the current moment, which indicates that the target visible set is a merged visible set; or the historical merge message does not include the information that the target visible set has been processed for visible set merging, which indicates that the target visible set is an unmerged visible set.
[0135] Furthermore, in order to avoid repeated merging operations on the target visible set, when the historical merging information of the target visible set indicates that the target visible set is an unmerged visible set, a step can be executed to merge the target visible set corresponding to the difference value that meets the preset conditions with the visible set to be merged.
[0136] In another case, if the historical merge information of the target visible set indicates that the target visible set is a merged visible set, there is no need to merge the target visible set, and subsequent operations can be performed directly based on the target visible set, which can improve the use efficiency of the visible set.
[0137] In some embodiments, after the synthesis process of the target visible set is completed, corresponding operations may be performed according to the obtained aggregated visible set, and the method may further include the following steps:
[0138] Rendering is performed on objects in a specified virtual scene based on the aggregated visible set.
[0139] In an embodiment of the present application, the obtained aggregated visible set can be used as a common visible set of a target sub-region and an adjacent sub-region merged with the visible set of the target sub-region, that is, multiple sub-regions share one visible set, reducing the demand for storage space.
[0140] Furthermore, when rendering objects in a designated virtual scene at the observation position of the target sub-region, the objects to be rendered may be determined based on the visibility corresponding to each object in the aggregated visible set, and then the rendering operation may be performed on the objects to be rendered.
[0141] In the embodiment of the present application, for a given virtual scene containing n objects and m sub-regions, a total of n×m real numbers are required to represent the visible sets of these sub-regions, and the amount of data is relatively large. Therefore, it is considered to classify and merge the visible sets.
[0142] For example, there are originally 10 sub-regions, each of which corresponds to 1 visible set, so there are 10 visible sets in total. Through the visible set merging processing of this solution, the 10 visible sets can be classified into 5 categories. The visible sets in each category are merged to obtain a new visible set. Each category corresponds to 1 (new) visible set, and each visible set only needs to store one copy of data. In this way, the demand for storage space can be reduced.
[0143] In some embodiments, in order to avoid missing visible sets whose difference values with the target visible set meet the merging condition, before the step of "merging the target visible set corresponding to the difference values meeting the preset condition with the visible set to be merged to obtain an aggregated visible set", the following steps may also be included:
[0144] Acquire other visible sets whose first difference values with the visible set to be merged meet preset conditions;
[0145] Calculate the second difference value between the target visible set and other visible sets;
[0146] Then the step of “merging the target visible set corresponding to the difference value that meets the preset condition with the visible set to be merged to obtain an aggregated visible set” may include the following operations:
[0147] The target visible set corresponding to the difference value that meets the preset condition is merged with the visible set to be merged, and the target visible set corresponding to the second difference value that meets the preset condition is merged with other visible sets to obtain an aggregated visible set.
[0148] The first difference value refers to the difference value between the visible set to be merged and other visible sets.
[0149] The other visible sets refer to visible sets whose first difference values with the visible set to be merged are not greater than a preset difference value.
[0150] Furthermore, a difference value between the target visible set and the other visible sets is calculated to obtain a second difference value, and then the target visible set corresponding to the second difference value that meets a preset condition is merged with the other visible sets.
[0151] For example, the target visible set can be v, the visible set to be merged can be u, and the other visible set can be i, that is, M i,u ≠inf,M i,v =inf, if M i,v +M u,v If the sum of is smaller (i.e., smaller than a set value), then M can be calculated additionally. i,v The true value of M is used to find other visible sets that can be merged with the target visible set. x,y Represents the maximum difference between the visible set in the same partition unit as the visible set x and the visible set in the same partition unit as the visible set y.
[0152] In the embodiment of the present application, by additionally calculating the difference value between the target visible set and other visible sets that may meet the merging condition, a more comprehensive visible set to be merged with the target visible set is obtained, thereby further ensuring the accuracy of the visible set merging result.
[0153] An embodiment of the present application discloses a game data processing method, which includes: obtaining a target visible set corresponding to a target sub-region among multiple sub-regions divided into a specified virtual scene, the target visible set including the visibility of at least one object in the specified virtual scene in the target sub-region; determining a sub-region adjacent to the target sub-region from the sub-regions to obtain at least one adjacent sub-region; obtaining a visible set to be merged corresponding to the adjacent sub-region; determining a difference value between the target visible set and the visible set to be merged; merging the target visible set corresponding to the difference value that meets a preset condition with the visible set to be merged to obtain an aggregated visible set, and using the aggregated visible set as a common visible set of the target sub-region and the adjacent sub-region, thereby improving the processing efficiency of the visible set of the virtual scene.
[0154] Based on the above introduction, the game data processing method of the present application will be further explained by way of example below. Figure 2 , Figure 2 A flowchart of another method for processing game data provided in an embodiment of the present application is provided. Taking the application of the method for processing game data in a virtual game scene as an example, the specific process may be as follows:
[0155] 201. The server obtains position information of each sub-area obtained by dividing the virtual game scene in the virtual game scene coordinate system.
[0156] In the embodiment of the present application, the virtual game scene can be divided into multiple non-intersecting cubic areas of the same shape, that is, multiple sub-areas are obtained. The virtual game scene can be a three-dimensional scene, and a three-dimensional orthogonal coordinate system can be created based on the virtual game scene.
[0157] For example, see Figure 3 , Figure 3 A schematic diagram of an application scenario of a game data processing method provided in an embodiment of the present application. Figure 3 The three-dimensional orthogonal coordinate system shown in FIG. 1 is composed of three coordinate axes: x, y, and z. The direction of the y axis is vertically upward. On the xz plane, a rectangular area is divided into several rows and columns of squares of the same size along the direction parallel to the coordinate axis.
[0158] Specifically, for the three-dimensional orthogonal coordinate system corresponding to the virtual game scene, each sub-area corresponds to a cubic area in the three-dimensional orthogonal coordinate system.
[0159] For example, see Figure 4 , Figure 4 A schematic diagram of another application scenario of a game data processing method provided in an embodiment of the present application. Figure 4 In the three-dimensional orthogonal coordinate system corresponding to the virtual game scene shown, there are n mutually non-intersecting cubic areas of the same shape. The projection of each area on the xz plane is one of the above rectangular squares. Each sub-area corresponds to a visible set.
[0160] The position information refers to the spatial position of each sub-region in the coordinate system.
[0161] 202. The server generates a two-dimensional list including all sub-areas according to the location information.
[0162] For example, see Figure 5 , Figure 5 A schematic diagram of an application scenario of another game data processing method provided in an embodiment of the present application. Figure 5 The position of multiple sub-areas in the virtual game scene in the coordinate system is shown. There are two layers in the vertical direction, the lower layer y=0, and the upper layer y=10. Their x coordinates from left to right are: 10, 20, 30, 40; the z coordinates from back to front are: 10, 20, 30. The visible set number corresponding to each area is marked in the cube, and this number can also be regarded as the number of the sub-area.
[0163] Furthermore, we can determine that there are 4 essentially different x-coordinates and 3 essentially different z-coordinates. Therefore, we can construct a 4×3 table. Then, we check each sub-region in turn. First, we have region number 1, which has an x-coordinate of 10, the 4th largest of all x-coordinates; and a z-coordinate of 10, the 3rd largest of all z-coordinates. Therefore, its number is filled in cell (3,1).
[0164] Next, there is area numbered 2, with an x coordinate of 20, the third largest among all x coordinates; and a z coordinate of 10, the third largest among all z coordinates. Therefore, its number is filled in the cell (3, 2). Next, there is area numbered 3, with an x coordinate of 30, the second largest among all x coordinates; and a z coordinate of 10, the third largest among all z coordinates. Therefore, its number is filled in the cell (3, 3).
[0165] By analogy, we can finally get the following table:
[0166] 9 10 11,18 12 5,15 6,16 7 8,17 1 2,13 3,14 4
[0167] 203. The server determines a sub-region adjacent to the designated region according to the two-dimensional list, and obtains the adjacent sub-region.
[0168] By constructing the two-dimensional list in the above manner, it is possible to conveniently query adjacent sub-regions around a sub-region.
[0169] For example, if you want to find out which cells are around the sub-region numbered 7, you can first find the cell (2, 3) according to x=30 being the second largest and z=20 being the second largest. Then, the elements in the cell (2±1, 3±1) are the adjacent sub-regions of the sub-region numbered 7. In practical applications, you may need to search for a larger area, and you can use a form such as (x±k, y±k).
[0170] 204. The server calculates the visible set difference between the designated area and each adjacent sub-area.
[0171] In the embodiment of the present application, the visible set can be abstracted as a node, and the number on the node represents the number of the visible set.
[0172] For example, see Figure 6 , Figure 6 A schematic diagram of another application scenario of a game data processing method provided in an embodiment of the present application. Figure 6 In the example, suppose there are 8 visible sets, and the positions of the nodes on the graph represent the positions of each visible set after discretization. Assume that the search range is 1.
[0173] Specifically, for visible set 1, the gaps need to be calculated with visible set 2, visible set 5, and visible set 6. For visible set 2, it needs to calculate the gaps with visible set 1, visible set 5, visible set 6, visible set 3, and visible set 7. For visible set 3, it needs to calculate the gaps with visible set 2, visible set 6, visible set 7, visible set 4, and visible set 8. And so on, in the end, each point calculates the gap with the surrounding (Manhattan) visible sets whose distance does not exceed 1. Doing so greatly reduces the number of gap calculations. For example, the gap between visible set 1 and visible set 3, visible set 4, visible set 7, and visible set 8 has never been calculated.
[0174] 205. The server merges the visible set of the adjacent sub-region corresponding to the visible set gap that meets the merging condition with the visible set of the designated region to obtain a merged visible set.
[0175] In the embodiment of the present application, an undirected graph containing m vertices is constructed, and the numbering starts from 1. Vertex i corresponds to visible set i.
[0176] Among them, vertices are abstractions of visible sets, and edges are abstractions of the gaps between visible sets. At present, the value of edge weight is the gap between visible sets.
[0177] Then, there may be the following situations.
[0178] The first type: there is an edge, and the edge weight is less than or equal to the preset condition.
[0179] The second type: there is an edge, and the edge weight is greater than the preset condition limit.
[0180] The third type: There is no edge, which can be regarded as an edge with infinite edge weight (denoted as inf, which can be a suitable large number such as 100000007). The reason for this situation is that the difference value is not actually calculated, not that the difference value is particularly large.
[0181] For example, see Figure 7 , Figure 7 A schematic diagram of another application scenario of a game data processing method provided in an embodiment of the present application. Figure 7 In the graph, the attributes of an edge include two endpoints u, v and edge weight w. As the algorithm proceeds, the edge weight represents the maximum value of the gap between the visible sets that are in the same partition unit as u and v. Initially, the graph does not contain any edges.
[0182] like Figure 7 As shown in Figure 1, a sparse matrix M is used to record edge weights. When querying the weight of an edge (u, v), if the edge does not exist, an infinite value inf is returned; otherwise, the true value is returned, recorded as M u,v .
[0183] Since the graph has no edges at the beginning, the matrix is also empty. Since the graph is undirected, then M u,v =M v,u , use the priority queue Q to maintain the order of edges. The elements of Q are triples of the form (u, v, w), which represent edges with endpoint u and weight w. Each time, the triple with the smallest (or one of the smallest) w at that time is popped out. It should be noted that if the edge weight changes after the triple is added, the record in the queue does not change accordingly. Therefore, after popping out, it is necessary to compare w and M u,v , confirm whether the record is outdated. Initially, since there is no edge, Q is also empty.
[0184] During the algorithm execution, it is necessary to query the vertices adjacent to the specified vertex with a weight that does not exceed the preset condition, denoted as L, or which vertices were adjacent to the edge that met the condition. This requirement is suitable for using an adjacency list, denoted as P.
[0185] Then, since the requirements involve classification and partitioning, it is appropriate to use the union-find method. Considering that in the algorithm process, it is necessary to check which other vertices are in the same partition unit as the specified vertex, the traditional union-find method should be modified to sacrifice the time complexity of merging partition units in exchange for the function of querying all elements in the specified partition unit.
[0186] Specifically, before merging the visible sets, pop the triple (u, v, w) from the priority queue Q. Continue to perform the following steps until the queue is empty.
[0187] If u and v are in the same partition unit in the union-find set, skip this triple. If the weight of the edge (u, v) in the graph is no longer equal to w, it means that the triple has expired and is also skipped. In other cases, due to the nature of the priority queue, the edge with the shortest weight connecting the two partition units is selected.
[0188] For example, see Figure 8 , Figure 8 A schematic diagram of an application scenario of another game data processing method provided in an embodiment of the present application. For an edge (u, v), the adjacency table P can efficiently find vertices that are adjacent to or have been adjacent to u with an edge whose weight does not exceed L. By querying the current weight, the vertices that are currently adjacent to vertex u with an edge whose weight does not exceed L can be filtered out.
[0189] Follow M i,u +M u,v The sum of is small enough and M i,v = inf. It represents the maximum difference between the visible sets in the same partition unit as i and v. Therefore, it is necessary to confirm that v and i are not in the same partition unit. Calculate the difference between the visible sets x and y corresponding to all the points x and y from the partition unit where v is located and from the partition unit where i is located.
[0190] Specifically, assign the maximum value of all gaps to M i,V If you find M i,v is less than the gap limit L, then (i, v, M i,v ) is added to the priority queue, and i and v are added to the corresponding rows of the adjacency table P. Here, an optimization method is set to observe M first. x,y ≠inf is there a difference greater than L? If so, no need to calculate; in addition, once a difference exceeds L, stop calculating immediately. Swap the identities of u and v and repeat this step.
[0191] Then, merge the two partition units where u and v are located.
[0192] For example, see Fig. 9 , Fig. 9 Schematic diagram of another application scenario of a game data processing method provided in an embodiment of the present application. Find the adjacent vertices of u through P. For vertex i, query M i,v and M i,u If the maximum value of the two is inf, both values need to be set to a value greater than L; otherwise, M i,uSet to the maximum value, M i,v Set it to a value greater than L. In addition, the modified (i, u, M i,u ) is added to the priority queue Q. Finally, find the vertices adjacent to v, skip the vertices processed in this step, and set the edge weights between the remaining vertices and v to a value greater than L.
[0193] Finally, traverse the integers in the interval [1, m]. Assuming that the traversal reaches i, query all elements in the partition unit where i is located through the union-find set. Calculate the merged result of the visible set with these elements as the serial number, as the new visible set, and assign a number. And correspond the old visible set number to the newly assigned number, so as to correspond to the new visible set.
[0194] The embodiment of the present application discloses a method for processing game data, which includes: a server obtains the position information of each sub-region obtained by dividing a virtual game scene in a virtual game scene coordinate system, generates a two-dimensional list containing all sub-regions according to the position information, determines the sub-regions adjacent to the specified region according to the two-dimensional list, obtains the adjacent sub-regions, calculates the visible set difference between the specified region and each adjacent sub-region, merges the visible set of the adjacent sub-region corresponding to the visible set difference that meets the merging condition with the visible set of the specified region, and obtains the merged visible set. In this way, the visible set calculation overhead can be saved, thereby improving the efficiency of scene rendering based on the visible set in the virtual game scene.
[0195] In order to better implement the game data processing method provided in the embodiment of the present application, the embodiment of the present application also provides a game data processing device based on the above game data processing method. The meanings of the terms are the same as those in the above game data processing method, and the specific implementation details can refer to the description in the method embodiment.
[0196] See also Fig.10 , Fig.10 A structural block diagram of a game data processing device provided in an embodiment of the present application, the device comprising:
[0197] A first acquisition unit 301 is used to acquire a target visible set corresponding to a target sub-region among a plurality of sub-regions divided into a specified virtual scene, wherein the target visible set includes visibility of at least one object in the specified virtual scene in the target sub-region;
[0198] A first determining unit 302 is configured to determine a sub-region adjacent to the target sub-region from the sub-regions to obtain at least one adjacent sub-region;
[0199] A second acquisition unit 303 is used to acquire a visible set to be merged corresponding to the adjacent sub-region, where the visible set to be merged includes visibility of at least one object in the designated virtual scene in the adjacent sub-region;
[0200] A second determining unit 304 is used to determine a difference value between the target visible set and the visible set to be merged;
[0201] The merging unit 305 is configured to merge the target visible set corresponding to the difference value that meets a preset condition with the visible set to be merged to obtain an aggregated visible set, and use the aggregated visible set as a common visible set of the target sub-region and the adjacent sub-region.
[0202] In some embodiments, the second determining unit 304 may include:
[0203] A first acquisition subunit, configured to acquire a first visibility corresponding to each object in the specified virtual scene in the target visible set, and a second visibility corresponding to each object in the visible set to be merged;
[0204] A comparison subunit, used to compare the first visibility and the second visibility corresponding to each object with the specified visibility respectively to obtain a comparison result;
[0205] The first determining subunit is configured to determine the difference value based on the comparison result.
[0206] In some embodiments, the first determining subunit may be specifically used for:
[0207] The number of objects whose first visibility is greater than the designated visibility and whose second visibility is less than the designated visibility, or whose first visibility is less than the designated visibility and whose second visibility is greater than the designated visibility is determined from the comparison result to obtain the difference value.
[0208] In some embodiments, the merging unit 305 may include:
[0209] A second determining subunit is used to determine a visible set to be merged corresponding to a difference value not greater than the preset difference value, to obtain a target visible set to be merged;
[0210] The first merging subunit is configured to merge the target visible set with the target visible set to be merged to obtain the aggregated visible set.
[0211] In some embodiments, the first merging subunit may be specifically used for:
[0212] Determine the maximum visibility corresponding to each object from the first visibility corresponding to each object in the target visible set and the second visibility corresponding to each object in the target visible set to be merged;
[0213] A new visible set is constructed based on the maximum visibility of all objects to obtain the aggregated visible set.
[0214] In some embodiments, the first merging subunit may be specifically used for:
[0215] Sorting the multiple target visible sets to be merged according to the difference between the target visible set and each target visible set to be merged, to obtain a sorting sequence corresponding to the multiple target visible sets to be merged;
[0216] Combining the target visible set with each target visible set to be merged in sequence based on the sorting sequence;
[0217] Until the target visible set is combined with all target visible sets to be merged, the aggregated visible set is obtained.
[0218] In some embodiments, the apparatus may further include:
[0219] A third acquisition unit, configured to acquire other visible sets whose first difference values with the visible set to be merged meet the preset condition;
[0220] The calculation unit is used to calculate a second difference value between the target visible set and the other visible sets.
[0221] In some embodiments, the merging unit 305 may include:
[0222] The second merging subunit is used to merge the target visible set corresponding to the difference value that meets the preset condition with the visible set to be merged, and merge the target visible set corresponding to the second difference value that meets the preset condition with the other visible sets to obtain the aggregated visible set.
[0223] In some embodiments, the first determining unit 302 may include:
[0224] A second acquisition subunit, configured to acquire first position information of the target sub-region in the designated virtual scene, and second position information of other sub-regions in the designated virtual scene;
[0225] The third determining subunit is configured to determine other sub-regions adjacent to the target sub-region according to the first position information and the second position information to obtain the adjacent sub-region.
[0226] In some embodiments, the third determining subunit may be specifically used for:
[0227] Based on the positional relationship between the first coordinate and each of the second coordinates in the coordinate system, other sub-regions corresponding to the second coordinates adjacent to the first coordinate are determined to obtain the adjacent sub-regions.
[0228] In some embodiments, the apparatus may further include:
[0229] A third acquisition unit, configured to acquire historical merge information of the target visible set;
[0230] An execution unit is configured to execute a step of merging the target visible set corresponding to a difference value that meets a preset condition with the visible set to be merged if the historical merging information indicates that the target visible set is an unmerged visible set.
[0231] In some embodiments, the apparatus may further include:
[0232] A processing unit is used to render objects in the specified virtual scene based on the aggregated visible set.
[0233] The embodiment of the present application discloses a game data processing device, wherein a target visible set corresponding to a target sub-region in a plurality of sub-regions divided into a specified virtual scene is obtained by a first acquisition unit 301, wherein the target visible set includes the visibility of at least one object in the specified virtual scene in the target sub-region. A first determination unit 302 determines a sub-region adjacent to the target sub-region from the sub-region to obtain at least one adjacent sub-region. A second acquisition unit 303 obtains a visible set to be merged corresponding to the adjacent sub-region, wherein the visible set to be merged includes the visibility of at least one object in the specified virtual scene in the adjacent sub-region. A second determination unit 304 determines the difference value between the target visible set and the visible set to be merged. A merging unit 305 merges the target visible set corresponding to the difference value that meets a preset condition with the visible set to be merged to obtain an aggregated visible set, and uses the aggregated visible set as the common visible set of the target sub-region and the adjacent sub-region. In this way, the processing efficiency of the visible set of the virtual scene can be improved.
[0234] Accordingly, the embodiment of the present application also provides a computer device, which may be a server. Fig.11 As shown, Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0235] The processor 501 is the control center of the computer device 500. It uses various interfaces and lines to connect the various parts of the entire computer device 500, executes various functions of the computer device 500 and processes data by running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the computer device 500 as a whole.
[0236] In the embodiment of the present application, the processor 501 in the computer device 500 will load instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:
[0237] Obtain a target visible set corresponding to a target subregion among a plurality of subregions divided into a specified virtual scene, the target visible set including visibility of at least one object in the specified virtual scene in the target subregion; determine a subregion adjacent to the target subregion from the subregions to obtain at least one adjacent subregion; obtain a visible set to be merged corresponding to the adjacent subregion, the visible set to be merged including visibility of at least one object in the specified virtual scene in the adjacent subregion; determine a difference value between the target visible set and the visible set to be merged; merge the target visible set corresponding to the difference value that meets a preset condition with the visible set to be merged to obtain an aggregated visible set, and use the aggregated visible set as a common visible set for the target subregion and the adjacent subregion.
[0238] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0239] Optional, such as Fig.11 As shown, the computer device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Fig.11 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0240] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of computer equipment, and these graphical user interfaces may be composed of graphics, guide information, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 501, and can receive the command sent by the processor 501 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to realize the input function.
[0241] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.
[0242] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another computer device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between an external headset and the computer device.
[0243] The input unit 506 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0244] The power supply 507 is used to supply power to various components of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0245] although Fig.11 Not shown, the computer device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0246] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0247] As can be seen from the above, the computer device provided in this embodiment obtains a target visible set corresponding to a target sub-region among multiple sub-regions divided into a specified virtual scene, the target visible set including the visibility of at least one object in the specified virtual scene in the target sub-region; determines a sub-region adjacent to the target sub-region from the sub-region to obtain at least one adjacent sub-region; obtains a visible set to be merged corresponding to the adjacent sub-region, the visible set to be merged including the visibility of at least one object in the specified virtual scene in the adjacent sub-region; determines the difference value between the target visible set and the visible set to be merged; merges the target visible set corresponding to the difference value that meets a preset condition with the visible set to be merged to obtain an aggregated visible set, and uses the aggregated visible set as the common visible set of the target sub-region and the adjacent sub-region.
[0248] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0249] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any one of the game data processing methods provided in the embodiment of the present application. For example, the computer program can execute the following steps:
[0250] Acquire a target visible set corresponding to a target sub-region among a plurality of sub-regions divided into a specified virtual scene, wherein the target visible set includes visibility of at least one object in the specified virtual scene in the target sub-region;
[0251] Determine a subregion adjacent to the target subregion from the subregions to obtain at least one adjacent subregion;
[0252] Acquire a visible set to be merged corresponding to the adjacent sub-region, where the visible set to be merged includes visibility of at least one object in a specified virtual scene in the adjacent sub-region;
[0253] Determine the difference between the target visible set and the visible set to be merged;
[0254] The target visible set corresponding to the difference value that meets the preset conditions is merged with the visible set to be merged to obtain an aggregated visible set, and the aggregated visible set is used as the common visible set of the target sub-region and the adjacent sub-region.
[0255] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0256] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0257] Since the computer program stored in the storage medium can execute the steps in any one of the game data processing methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the game data processing methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0258] The above is a detailed introduction to a game data processing method, device, storage medium and computer equipment provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for processing game data, characterized in that: The method comprises: Acquire a target visible set corresponding to a target sub-region among a plurality of sub-regions divided into a specified virtual scene, wherein the target visible set includes visibility of at least one object in the specified virtual scene in the target sub-region; Determine a subregion adjacent to the target subregion from among the subregions to obtain at least one adjacent subregion; Acquire a visible set to be merged corresponding to the adjacent sub-region, wherein the visible set to be merged includes visibility of at least one object in the designated virtual scene in the adjacent sub-region; Acquire a first visibility corresponding to each object in the specified virtual scene in the target visible set and a second visibility corresponding to each object in the visible set to be merged; Compare the first visibility and the second visibility corresponding to each object with the specified visibility respectively to obtain a comparison result; Determine, from the comparison result, the number of objects whose first visibility is greater than the specified visibility and whose second visibility is less than the specified visibility, or whose first visibility is less than the specified visibility and whose second visibility is greater than the specified visibility, and obtain a difference value between the target visible set and the visible set to be merged; The target visible set corresponding to the difference value satisfying the preset condition is merged with the visible set to be merged to obtain an aggregated visible set, and the aggregated visible set is used as a common visible set of the target sub-region and the adjacent sub-region.
2. The method according to claim 1, characterized in that The preset condition includes not greater than a preset difference value; The step of merging the target visible set corresponding to the difference value satisfying the preset condition with the visible set to be merged to obtain an aggregated visible set includes: Determine a visible set to be merged corresponding to a difference value that is not greater than the preset difference value, and obtain a target visible set to be merged; The target visible set and the target visible set to be merged are merged to obtain the aggregated visible set.
3. The method according to claim 2, characterized in that The step of merging the target visible set with the target visible set to be merged to obtain the aggregated visible set includes: Determine the maximum visibility corresponding to each object from the first visibility corresponding to each object in the target visible set and the second visibility corresponding to each object in the target visible set to be merged; A new visible set is constructed based on the maximum visibility of all objects to obtain the aggregated visible set.
4. The method according to claim 2, characterized in that: The number of the target visible sets to be merged is multiple; The step of merging the target visible set with the target visible set to be merged to obtain the aggregated visible set includes: Sorting the multiple target visible sets to be merged according to the difference between the target visible set and each target visible set to be merged, to obtain a sorting sequence corresponding to the multiple target visible sets to be merged; Combining the target visible set with each target visible set to be merged in sequence based on the sorting sequence; Until the target visible set is combined with all target visible sets to be merged, the aggregated visible set is obtained.
5. The method according to claim 1, characterized in that Before merging the target visible set corresponding to the difference value satisfying the preset condition with the visible set to be merged to obtain an aggregated visible set, the method further includes: Acquire other visible sets whose first difference values with the visible set to be merged meet the preset condition; Calculating a second difference value between the target visible set and the other visible sets; The step of merging the target visible set corresponding to the difference value satisfying the preset condition with the visible set to be merged to obtain an aggregated visible set includes: The target visible set corresponding to the difference value that meets the preset condition is merged with the visible set to be merged, and the target visible set corresponding to the second difference value that meets the preset condition is merged with the other visible sets to obtain the aggregated visible set.
6. The method according to claim 1, characterized in that The step of determining a subregion adjacent to the target subregion from the subregions to obtain at least one adjacent subregion includes: Acquire first position information of the target sub-region in the designated virtual scene, and second position information of other sub-regions in the designated virtual scene; Other sub-regions adjacent to the target sub-region are determined according to the first position information and the second position information to obtain the adjacent sub-region.
7. The method according to claim 6, characterized in that The first position information includes a first coordinate of the target sub-region in a specified coordinate system, and the second position information includes a second coordinate of each sub-region in a specified coordinate system, where the specified coordinate system is a coordinate system constructed based on the specified virtual scene; The determining other sub-regions adjacent to the target sub-region according to the first position information and the second position information to obtain the adjacent sub-region includes: Based on the positional relationship between the first coordinate and each of the second coordinates in the coordinate system, other sub-regions corresponding to the second coordinates adjacent to the first coordinate are determined to obtain the adjacent sub-regions.
8. The method according to claim 1, characterized in that Before merging the target visible set corresponding to the difference value satisfying the preset condition with the visible set to be merged, the method further includes: Obtaining historical merge information of the target visible set; If the historical merging information indicates that the target visible set is an unmerged visible set, a step is performed to merge the target visible set corresponding to the difference value that meets a preset condition with the visible set to be merged.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: Rendering is performed on objects in the specified virtual scene based on the aggregated visible set.
10. The method according to claim 1, characterized in that The multiple sub-areas are cubic areas that do not intersect each other and have the same shape.
11. A game data processing device, characterized in that: The device comprises: A first acquisition unit, configured to acquire a target visible set corresponding to a target sub-region among a plurality of sub-regions divided into a specified virtual scene, wherein the target visible set includes visibility of at least one object in the specified virtual scene in the target sub-region; A first determining unit, configured to determine a subregion adjacent to the target subregion from among the subregions, to obtain at least one adjacent subregion; A second acquisition unit, configured to acquire a visible set to be merged corresponding to the adjacent sub-region, wherein the visible set to be merged includes visibility of at least one object in the designated virtual scene in the adjacent sub-region; A second determining unit is used to obtain a first visibility corresponding to each object in the specified virtual scene in the target visible set and a second visibility corresponding to each object in the visible set to be merged; compare the first visibility and the second visibility corresponding to each object with the specified visibility respectively to obtain a comparison result; determine from the comparison result the number of objects whose first visibility is greater than the specified visibility and whose second visibility is less than the specified visibility, or whose first visibility is less than the specified visibility and whose second visibility is greater than the specified visibility, to obtain a difference value between the target visible set and the visible set to be merged; The merging unit is used to merge the target visible set corresponding to the difference value that meets the preset condition with the visible set to be merged to obtain an aggregated visible set, and use the aggregated visible set as the common visible set of the target sub-region and the adjacent sub-region.
12. A computer device comprising a memory, a processor and a computer program stored in the memory and running on the processor, wherein: When the processor executes the program, the game data processing method according to any one of claims 1 to 10 is implemented.
13. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the game data processing method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Cluster-based real-time rendering service of remote sensing data set
CN102722549A
Shield removal method and device for game scene, processor and terminal
CN108257103A
Identifier generation method and device, nonvolatile storage medium and electronic device
CN113663331A
Object loading method, device, storage medium, and electronic device
WO2020098531A1
