Data processing methods, servers, media, and computer program products based on voxel data
Patent Information
- Application Number
- CN202280020323.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-09-30
- Filing Date
- 2022-09-29
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2042-09-29
AI Technical Summary
[0004]现有的技术手段中,常用行为树来计算AI行为,这样的计算方式使用CPU进行,需要进行树状数据结构的遍历以及非常消耗CPU性能的检测和导航任务,对于高实时性的竞技游戏来说,计算效率较低,无法满足业务需求
[0086]1. For spatial data computation, pixel data is converted into voxel data, which is highly compatible with GPU computing. Compared with the existing CPU computing mode, the performance of the GPU-based data computing solution is 2 to 3 orders of magnitude higher. Since all computations are based on voxel scenes, the massive parallel computing in voxel scenes is very fast on server platforms with integrated GPUs, enabling the server to handle a large computing load. Using voxel data as input to neural networks can make the AI behavior obtained by computation more refined, intelligent, fast-responding, and closer to human behavior. Using voxel data for high-performance ray detection to perceive the environment has high computational efficiency.
Smart Images

Figure CN116963811B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game data processing technology, and in particular to a data processing method, server, medium, and computer program product based on voxel data. Background Technology
[0002] A game scene is a collection of all scene elements within a virtual space in a video game, including map terrain, buildings, game characters, equipment, and items. The game scene interface that game users see is often displayed in pixel-based format, meaning that the content of the game scene is displayed on the screen according to pixel data format.
[0003] In multiplayer competitive games, it is often necessary to add AI functionality, which means adding one or more simulated players to a game, and the behavior of the simulated players is calculated by the server.
[0004] Among existing technologies, behavior trees are commonly used to calculate AI behavior. This calculation method uses the CPU and requires traversing the tree data structure as well as detection and navigation tasks that consume a lot of CPU resources. For highly real-time competitive games, the computational efficiency is low and cannot meet business needs. Summary of the Invention
[0005] In order to overcome the above-mentioned technical defects, the purpose of this invention is to provide a data processing method, server, medium and computer program product based on voxel data with higher computational efficiency.
[0006] This invention discloses a data processing method based on voxel data. The original data of a game scene constitutes a pixel scene, which includes scene elements of several different data types. The method includes:
[0007] Export the original data of several types of scene elements respectively;
[0008] Set the desired side length of the unit voxel, and combine the side length of the unit voxel to convert the original data of several scene elements into voxel data, which are represented as voxel modules in the voxel scene.
[0009] Based on the relative positions of the voxel modules of all the scene elements in the pixel scene, the voxel modules of all the scene elements are stitched together to obtain the voxel scene.
[0010] Preferably, the scene elements include at least one of terrain, vegetation, buildings, and outdoor decorations;
[0011] The process of exporting the original data for several types of scene elements includes:
[0012] Export the 3D model file format data and coordinate information of the outdoor ornaments and the building;
[0013] Export the comma-separated value file format data of the vegetation;
[0014] The terrain is captured orthogonally using a depth camera to produce images containing surface height data.
[0015] Preferably, the step of setting the desired side length of the unit voxel, and converting the original data of several scene elements into voxel data in combination with the side length of the unit voxel, includes:
[0016] The "Read / Write Triangular Mesh" and "Create from Triangular Mesh" functions in the open-source library are used to convert the 3D model file format data of the outdoor ornaments and the building into voxel data.
[0017] Obtain the size of the collider of the vegetation, and combine it with the side length of the unit voxel to calculate the number of voxels and the shape of the voxel that the vegetation needs to occupy in the voxel scene.
[0018] Based on the image containing the surface height data of the terrain, the surface height data of the terrain is converted into voxel data by sampling point by point according to the side length of the unit voxel.
[0019] Preferably, the method further includes:
[0020] Within the voxel scene, a voxel region within the target space of the target object is cropped and obtained. This voxel region is then used as the input to a neural network in the form of a three-dimensional tensor to obtain the spatial features of the target object.
[0021] Preferably, the process of cropping to obtain a voxel region within the target spatial range of the target object, and using the voxel region as a three-dimensional tensor as input to a neural network to obtain the spatial features of the target object, includes:
[0022] Centered on the target object, a voxel cube within the spatial range surrounding the target object is cropped and used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features around the target object.
[0023] Preferably, the process of cropping to obtain a voxel region within the target spatial range of the target object, and using the voxel region as a three-dimensional tensor as input to a neural network to obtain the spatial features of the target object, includes:
[0024] Within the spatial range in front of the target object, a first voxel cuboid is cropped and obtained. This first voxel cuboid is then used as the input to a neural network in the form of a three-dimensional tensor to obtain the spatial features in front of the target object.
[0025] Within the spatial range in front of the target object, a second voxel cuboid is obtained by cropping, wherein the length of the second voxel cuboid is much larger than the length of the first voxel cuboid. The second voxel cuboid is used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features at a distance in front of the target object.
[0026] Preferably, the process of cropping to obtain a voxel region within the target spatial range of the target object, and using the voxel region as a three-dimensional tensor as input to a neural network to obtain the spatial features of the target object, includes:
[0027] For a specified target object and field of view, a depth map with a resolution of M*N is obtained by using voxel data in the voxel scene through ray detection. The depth map is then used as the input to a neural network to obtain the spatial features of the target object.
[0028] Preferably, the step of obtaining a depth map with a resolution of M*N using voxel data in the voxel scene through ray detection for a specified target object and field of view includes:
[0029] A view cone is generated in the direction of the field of view, and the end of the view cone is a curved surface. In the voxel scene, the curved surface includes M*N points.
[0030] Starting from the target object and ending at the M*N points, M*N paths are formed. Ray detection is performed on the M*N paths from the starting point to the ending point until a solid point on the path is detected.
[0031] The detection results of the M*N paths constitute the depth map.
[0032] Preferably, the step of performing ray detection on M*N paths along the direction from the starting point to the ending point until a solid point on the path is detected includes:
[0033] The path includes a starting point and an ending point;
[0034] Calculate and obtain the n points that the path passes through in the voxel scene;
[0035] In the GPU, the M*N paths are calculated simultaneously to index the point corresponding to each point in the voxel scene.
[0036] Preferably, the method further includes:
[0037] Determining whether the behavior of a game object is fraudulent, wherein the game processing of the game object takes place in the voxel scene, the voxel scene includes the game object and the game object's field of view scene, each client corresponds to one or more game objects, and determining whether the behavior of the game object is fraudulent includes:
[0038] The server calculates the field of view that the game object should acquire at the current time and sends the field of view to the client in real time.
[0039] Based on the decision-making behavior that the game object has already made, it is determined whether the decision-making behavior meets the occurrence conditions in the field of vision scenario. If the occurrence conditions are not met, it is considered that there is fraudulent behavior.
[0040] Record the game account corresponding to the game object and the fraudulent behavior.
[0041] Preferably, the area of the field of view is the area of the game object's view frustum;
[0042] Within the area of the view frustum, if ray detection determines that there is an obstruction between the path of this game object and other game objects, then the other game objects will not be displayed.
[0043] Preferably, determining whether the decision-making behavior, based on the decision-making behavior already performed by the game object, satisfies the occurrence conditions within the field of view scenario includes:
[0044] The path between this game object and other game objects is determined by ray detection. If the path is clear, the decision-making behavior meets the conditions for occurrence; if the path is obstructed, the decision-making behavior does not meet the conditions for occurrence.
[0045] Preferably, calculating the field of view that the game object should acquire at the current time includes:
[0046] In the field of view, obtain the types of all dynamic game objects and the offset coordinates of the outline points of each type of dynamic game object relative to the center point of the game object;
[0047] The updated coordinates of the outline points are calculated and obtained based on the center point coordinates of the dynamic game object at the end of the most recent preset cycle and the offset coordinates of the outline points.
[0048] After the dynamic game object is refreshed, the updated coordinates of all outline points are written into voxel data, and the original voxel data of all outline points before the dynamic game object is refreshed are erased. This completes the dynamic refresh of all game objects in the field of view, thus obtaining the calculated refreshed field of view.
[0049] Preferably, the step of determining whether the decision-making behavior based on the game object's existing decision-making behavior meets the occurrence conditions in the field of view scenario, and considering fraudulent behavior if the occurrence conditions are not met, includes:
[0050] Calculate and obtain the navigation path and mode of transportation between the game object and the destination; the number of navigation paths is one or more, and the number of modes of transportation is one or more.
[0051] Determine whether the navigation path includes the actual walking path of the game object, and determine whether the passage methods supported on the actual walking path include the passage methods actually used by the game object. If not, it is considered that there is fraudulent behavior.
[0052] Preferably, the calculation of the navigation path and mode of travel between the game object and the destination includes:
[0053] In the x, y, z three-dimensional space of the voxel scene, a basic plane z = z′ is taken, and there are several basic points on the basic plane; with the basic point as the base point and the z coordinate of the basic point as the height, several basic pillars are formed, and there are L element points on each basic pillar;
[0054] All the base pillars are accessed in parallel in the GPU, and each element point on the base pillar is traversed in each parallel thread. The voxel scene coordinate point is indexed according to the voxel data, and it is determined whether the voxel scene coordinate point is a hollow point or a solid point.
[0055] Collect continuous hollow point segments on each of the foundation columns. If the height of the continuous hollow point segment is greater than or equal to a first preset height, then define the continuous hollow point segment as a voxel layer.
[0056] The positional relationship between the voxel layer where the game object is currently located and each voxel layer on the adjacent base pillar is calculated, thereby obtaining the passage mode between the voxel layer where the game object is currently located and each voxel layer on the adjacent base pillar.
[0057] Preferably, the judgment steps of the X-ray detection include:
[0058] Calculate the ray path formed by the game object (x1, y1, z1) and other game objects (x2, y2, z2) and pass through n points (a1, b1, c1), (a2, b2, c2), ..., (a...) in the voxel scene. n b n c n );
[0059] In the GPU, calculations are performed simultaneously on the n points: the coordinates in the voxel scene are indexed to the n points in the voxel scene, and it is checked whether they are solid points;
[0060] If a solid dot is detected among the n points, then the path between this game object and other game objects is blocked; if no solid dot is detected among the n points, then the path between this game object and other game objects is unobstructed.
[0061] Preferably, the ray detection determination step further includes: performing ray detection on m paths in the GPU:
[0062] The m paths include m starting points and m ending points; simultaneously, n points traversed by each path in the voxel scene are calculated and obtained;
[0063] Simultaneously, calculations are performed on the n points in the m paths: each point is indexed according to its coordinates in the voxel scene to find the corresponding point in the voxel scene, and its solid point is checked.
[0064] If a solid point is detected among the n points, then the path is blocked; otherwise, the path is unobstructed, thus obtaining the detection results of m paths.
[0065] Preferred options also include:
[0066] A detection region includes x detection targets and y nodes. Dynamic planning is performed on the detection region, including:
[0067] Simultaneously, ray detection is performed on the x*y paths formed by the x detection targets and y nodes, and the detection results are saved;
[0068] The detection results of different paths are retrieved for the detection area at different times to perform the dynamic planning.
[0069] Preferred options also include:
[0070] Dynamic planning is performed on multiple detection areas, including:
[0071] Simultaneously, ray detection is performed on x*y paths in different detection areas, and the detection results are saved to form a detection result table divided by the detection areas;
[0072] When performing the dynamic planning on a detection area, the detection results of the detection area are retrieved from the detection result table.
[0073] This invention also discloses a data processing server based on voxel data, wherein the raw data of a game scene constitutes a pixel scene, the pixel scene includes scene elements of several different data types, and the server includes:
[0074] The export module exports the original data of several types of scene elements respectively;
[0075] The conversion module sets the desired side length of the unit voxel, and converts the original data of several scene elements into voxel data based on the side length of the unit voxel. The voxel data is represented as voxel modules in the voxel scene.
[0076] The stitching module stitches together the voxel modules of all the scene elements according to their relative positions in the pixel scene to obtain the voxel scene.
[0077] This invention also discloses a computer-readable storage medium for storing data processing instructions based on voxel data. The original data of the game scene constitutes a pixel scene, which includes scene elements of several different data types. When the instructions are executed, they perform the following steps:
[0078] Export the original data of several types of scene elements respectively;
[0079] Set the desired side length of the unit voxel, and combine the side length of the unit voxel to convert the original data of several scene elements into voxel data, which are represented as voxel modules in the voxel scene.
[0080] Based on the relative positions of the voxel modules of all the scene elements in the pixel scene, the voxel modules of all the scene elements are stitched together to obtain the voxel scene.
[0081] The present invention also discloses a computer program product comprising computer-executable instructions, which are executed by a processor to perform the following steps:
[0082] Export the original data of several types of scene elements respectively;
[0083] Set the desired side length of the unit voxel, and combine the side length of the unit voxel to convert the original data of several scene elements into voxel data, which are represented as voxel modules in the voxel scene.
[0084] Based on the relative positions of the voxel modules of all the scene elements in the pixel scene, the voxel modules of all the scene elements are stitched together to obtain the voxel scene.
[0085] Compared with existing technologies, the above technical solution has the following advantages:
[0086] 1. For spatial data computation, pixel data is converted into voxel data, which is highly compatible with GPU computing. Compared with the existing CPU computing mode, the performance of the GPU-based data computing solution is 2 to 3 orders of magnitude higher. Since all computations are based on voxel scenes, the massive parallel computing in voxel scenes is very fast on server platforms with integrated GPUs, enabling the server to handle a large computing load. Using voxel data as input to neural networks can make the AI behavior obtained by computation more refined, intelligent, fast-responding, and closer to human behavior. Using voxel data for high-performance ray detection to perceive the environment has high computational efficiency.
[0087] 2. By moving the verification calculation from the client to the server, the possibility of client-side fraud is eliminated. Specifically, the field of view is clipped for each game object, that is, only the field of view data that the game object should see is sent to that game object, while the client only calculates the spatial data within the field of view scene. Furthermore, the rationality of the game object's decision is judged in real time through technologies such as ray detection. The combination of the two can prevent and stop game fraud in advance and in the middle.
[0088] 3. Ray detection is performed using voxel data to generate depth maps. These depth maps are then used as features for neural network extraction, enabling subsequent tasks such as spatial object segmentation, spatial object classification, and behavior reinforcement learning. Attached Figure Description
[0089] Figure 1 A flowchart of the data processing method based on voxel data provided by the present invention;
[0090] Figure 2 For pixel scenes in existing technologies;
[0091] Figure 3 The present invention provides Figure 2 The pixel scene is converted into a voxel scene. Detailed Implementation
[0092] The advantages of the present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments.
[0093] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0094] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0095] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0096] In the description of this invention, it should be understood that the terms "longitudinal", "lateral", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0097] In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "linking" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two components. They can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0098] In the following description, suffixes such as "module," "part," or "unit" used to denote elements are used only for the convenience of the description of the invention and have no specific meaning in themselves. Therefore, "module" and "part" can be used interchangeably.
[0099] Regarding voxel scenes, a voxel is short for volume element. A solid containing voxels can be represented through stereo rendering or by extracting polygonal isosurfaces from a given threshold contour. A voxel is the smallest unit of digital data segmentation in three-dimensional space. The unit voxel mentioned in this invention can be understood as a single voxel. Voxels are used in fields such as 3D imaging, scientific data, and medical imaging. Conceptually, it is similar to the smallest unit in two-dimensional space: a pixel, which is used in image data of two-dimensional computer images. Some true 3D displays use voxels to describe their resolution; for example, a display that can display 512×512×512 voxels.
[0100] In the field of 3D imaging technology, a CPU-based computing model is typically employed, where various logical tasks and data preprocessing are performed on the CPU, while GPUs are better suited for concurrent data operations, such as image rendering. Existing spatial data structures do not integrate ideally with GPUs; therefore, current spatial data structures primarily rely on pixel data, failing to reflect the high-concurrency computing performance of GPUs. This invention transforms pixel data used for 3D imaging into voxel data, thus achieving a high degree of compatibility with the high-concurrency computing characteristics of GPUs for various operations. Compared to existing CPU-based computing models, the GPU-based data processing solution offers performance improvements of 2 to 3 orders of magnitude. This allows for high-performance ray detection using voxel data for environmental perception, resulting in high computational efficiency.
[0101] For details, please see the appendix. Figure 1 This invention provides a specific embodiment of a data processing method based on voxel data, wherein the original data of a game scene constitutes a pixel scene, the pixel scene includes scene elements of several different data types, and the method includes:
[0102] S100, Export the original data of several scene elements respectively;
[0103] S200. Set the desired side length of the unit voxel. Combine the side length of the unit voxel with the original data of several scene elements and convert them into voxel data. The voxel data is represented as voxel modules in the voxel scene.
[0104] S300. Based on the relative positions of the voxel modules of all scene elements in the pixel scene, stitch together the voxel modules of all scene elements to obtain the voxel scene.
[0105] In a preferred embodiment of the present invention, the game scene is a game world built using the UE4 game engine, see appendix. Figure 2 In this game world, scene elements include terrain, vegetation, buildings, and outdoor decorations. Terrain includes slopes, hills, and rivers; vegetation includes trees, flowers, and shrubs; buildings include houses and warehouses; and outdoor decorations include oil tanks and platforms. (Attached) Figure 2All scene elements are displayed in the form of pixels. Each element is composed of individual pixel blocks. In other words, the game scene is described and displayed using pixel data. Pixel scene is a way of representing the game scene.
[0106] Different scene elements use different data types during construction. Based on the type and characteristics of the scene elements, different methods are used to export the raw data of different scene elements from the UE4 game engine. Specifically:
[0107] In the UE4 game engine, outdoor decorations and buildings belong to the Actor type that includes StaticMesh. They can be directly exported as OBJ files, and the coordinate information of the Actor can be exported simultaneously. The OBJ file is a 3D model file.
[0108] In UE4, vegetation is not an independent Actor type, so it is necessary to record its coordinates and shape and export it as a CSV information file; the CSV information file is a comma-separated value file.
[0109] In the voxel world, terrain only utilizes surface height information. This invention uses orthogonal shooting with a depth camera to export terrain image data.
[0110] All of the above methods for exporting raw data can be implemented by referring to the UE4 game engine documentation, which are technical means mastered by those skilled in the art.
[0111] Because scene elements differ in type and characteristics, different conversion methods are needed to transform the various raw data of different scene elements into voxel data represented as voxel modules in the game scene. First, we need to set the desired side length of each voxel. A voxel module includes one or more voxels. Based on the side length of each voxel, we convert the data of several scene elements into voxel data, specifically:
[0112] For OBJ (3D model) files, the "read_triangle_mesh" and "create_from_triangle_mesh" functions in the open-source library OPEN3D can be used to directly convert OBJ files into voxel data (voxel modules); OPEN3D is not the only open-source library limited to this invention, and other open-source libraries that can achieve the above two functions can also be used for data conversion;
[0113] For vegetation, the number and shape of the voxel modules it occupies in the voxel world need to be calculated directly based on the size of the vegetation's collider and the side length of the voxel.
[0114] Terrain occupies only one layer in the voxel world, see [link / reference] Figure 3 In region D, based on the image data containing height information, the data is sampled point by point according to the side length of the unit voxel to convert it into voxel data (voxel module).
[0115] At this point, all the data for creating the voxel scene has been obtained. Finally, it is necessary to stitch together voxel modules containing all scene elements to obtain a voxel scene with all scene elements.
[0116] In the program, a voxel scene is represented by a large number of 3D coordinate points. The principle of stitching voxel modules is actually to integrate the coordinate point information representing the voxel modules into the same data structure based on the relative position of the voxel modules in the game map. However, the UE4 game engine itself contains the position and rotation information of each module. Therefore, special attention needs to be paid to the problem that the rules of the rotation transformation of the Euler angles of the 3D model are inconsistent in different systems when stitching.
[0117] Obtained through splicing Figure 3 The voxel scene shown uses 3D tensors to fully represent the spatial information of the 3D world. Its sampling precision determines the spatial resolution, enabling the recording of game scenes using voxel data; that is, voxel scenes are a representation of game scenes. Based on the data format characteristics of this voxel scene—flattened vector data—it is very suitable for GPU computation. Performing computations on the voxel scene using the GPU significantly improves computational speed compared to existing technologies that use the CPU.
[0118] Preferably, based on the conversion of pixel scenes to voxel scenes, the target spatial range of the target object is cropped. This target spatial range is then used as input to a neural network to obtain spatial features. These spatial features include information contained within the space, such as whether the voxel points within the target spatial range are solid. The target object can be a game object or a scene element, where the game object can be a player-controlled character or an AI-controlled character.
[0119] Specifically, the voxel region within the target space of the target object is cropped within the voxel scene, and the voxel region is used as the input of the neural network in the form of a three-dimensional tensor to obtain the spatial features of the target object.
[0120] The target spatial range includes a first spatial feature range, a second spatial feature range, ..., an Nth spatial feature range. The target spatial range can be one of these spatial feature ranges or a combination of multiple spatial feature ranges. This invention provides a preferred embodiment comprising three spatial feature ranges: the first spatial feature range is the surrounding spatial range, i.e., the range of the space adjacent to the target object; the second spatial feature range is the near-front spatial range, i.e., the spatial range within a certain distance in front of the target object; and the third spatial feature range is the far-front spatial range, i.e., the spatial range beyond a certain distance in front of the target object. Both the near-front and far-front spatial ranges belong to the front spatial range. Clearly, the target spatial range does not include the spatial range of the target object itself. Specific application examples of the aforementioned surrounding spatial range, front spatial range, near-front spatial range, and far-front spatial range are as follows:
[0121] I. An application example related to the surrounding spatial range: Centered on the target object, a voxel cube is cropped to obtain the voxel cube within the spatial range surrounding the target object. This voxel cube is then used as input to a neural network in the form of a 3D tensor to obtain the spatial features around the target object. The cropped voxel cube is a combination of several unit voxels. The voxel cube is used as input to the neural network in the form of a 3D tensor. The model of this neural network can be selected according to specific application requirements, such as a convolutional neural network. The output result obtained after neural network calculation is a set of vector data, which represents the spatial features around the target object.
[0122] In this example, the target object can be understood as a character within the game scene. During gameplay, the character needs to know about available equipment in the surrounding environment; that is, it needs to capture environmental information and extract and identify the presence of equipment from this information. This environmental information is typically limited to a preset range. For example, if equipment is found within two meters of the character, the character is informed that there is available equipment nearby. In this case, the size of the cube corresponds to the value of "two meters."
[0123] The reason for using "corresponding" instead of "equal" is that the size of the game scene's visual data may not be exactly the same as the size actually perceived by the character; there may be a corresponding relationship of magnification or reduction.
[0124] II. Application example regarding the spatial range in front: In front of a target object, a first voxel cuboid is cropped and obtained. This first voxel cuboid is used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features within the spatial range in front of the target object. The cropped first voxel cuboid is a combination of several unit voxels. This first voxel cuboid can be a relatively wide cuboid or a slender cuboid.
[0125] In this example, the target object can also be understood as a character within a game scene. The character needs to identify enemy actions in front of their field of vision and then make their own action choices based on these actions, such as dodging in a fighting game or avoiding missiles in a scenario game. This requires capturing environmental information and enemy behavior information in front of the character's field of vision, and extracting and identifying whether there are actions that can be taken to cooperate or evade the enemy. This environmental information and enemy behavior information are usually limited to a preset range. For example, if there is missile information within fifty meters in front of the character's field of vision, the character is informed to take relevant evasive or defensive actions. In this case, the length of the cuboid corresponds to the value of "fifty meters".
[0126] III. Application Example Regarding the Far-Ahead Spatial Range: A second voxel cuboid is cropped in front of a target object. The length of the second voxel cuboid is much larger than the length of the first voxel cuboid. For example, the second voxel cuboid is a long, narrow cuboid, with its length being an order of magnitude greater than that of the first voxel cuboid. The second voxel cuboid is used as input to a neural network in the form of a three-dimensional tensor to obtain the spatial features of the target object's far-ahead spatial range (i.e., far in front). The cropped second voxel cuboid is a combination of several unit voxels. The second voxel cuboid can be used independently or in combination with the first voxel cuboid.
[0127] In this example, the target is also an in-game character. Since the character needs a scope to obtain a distant view while holding a gun, the environmental range that needs to be extracted must be further to correspond to the distant target. In this case, the length of the slender cuboid corresponds to the distance between the distant target and the character.
[0128] When setting it up, you can set the length of the slender cuboid to correspond to the farthest distance that the scope can see, which will ensure that the cropped area meets the scope's field of view requirements.
[0129] In addition to directly applying voxel data to the input of the neural network, this invention applies voxel data to GPU ray detection because voxel data has a standardized and neat format, is easy to compute, especially for parallel computing, and generates a depth map through ray detection. The depth map is then used as the input for feature extraction of the neural network, thereby better leveraging the performance of voxel data.
[0130] Specifically, for a given target object and field of view, voxel data from the voxel scene is used to obtain a depth map with a resolution of M*N through ray detection. The depth map is then used as input to a neural network to obtain the spatial features of the target object.
[0131] Preferably, the generation of the depth map specifically includes:
[0132] 1) Generate a view frustum in the direction of the view, with the end of the view frustum being a surface. In a voxel scene, the surface includes M*N points.
[0133] 2) Starting from the target object and ending at M*N points, M*N paths are formed. Ray detection is performed on these M*N paths from the starting point to the ending point until a solid point on the path is detected. The detection result is represented as the pixels of the path.
[0134] 3) The detection results of M*N paths constitute a depth map.
[0135] It should be noted that the view cone is an abstract cone-shaped spatial range radiating from the eyes of the "person" who is one of the characters in the game scene. The view cone is usually a plane (a surface with zero curvature). In voxel scenes, for ease of calculation, it is usually calculated based on a spherical coordinate system, in which the view cone is a surface.
[0136] During ray detection along the direction from the starting point to the ending point (which can also be understood as from near to far), if a solid point is detected for the first time at a certain position, it means that the path is blocked at this position, and the depth of the field of view ends here, thus forming a depth map.
[0137] Preferably, the specific steps for X-ray inspection are as follows:
[0138] 1) Set the starting point (x1, y1, z1) and the ending point (x2, y2, z2);
[0139] 2) Calculate the n points (a1, b1, c1), (a2, b2, c2)...(a...) points traversed by the path in the voxel scene. n b n c n );
[0140] 3) In the GPU, the calculation is performed on M*N paths simultaneously to index the point corresponding to each point in the voxel scene and determine whether it is a solid point.
[0141] The path between the starting point (x1, y1, z1) and the ending point (x2, y2, z2) lies on the same straight line. Ray detection means that a ray is emitted from the starting point (x1, y1, z1) to the ending point (x2, y2, z2), and a ray path is formed between the two points.
[0142] During ray detection, if a solid point (i.e., a voxel coordinate point) is detected with an attribute value of 1, it indicates that the path is obstructed and blocked. If no solid point is detected, i.e., the voxel coordinate point has an attribute value of 0, it indicates that the path is unobstructed and passable. Passability can be understood as spatial movement for a character, or as the unimpeded transmission of signals.
[0143] For example, during gameplay, if it's necessary to determine whether a character can hit a distant target with a gun, the detection start point is the character, and the end point is the distant target. If the detection result is no obstruction, it means that under the current aiming path, normal firing will hit the distant target; if the detection result is obstruction, it means that under the current aiming path, normal firing will not hit the distant target.
[0144] Below is an example of obtaining a 320*180 resolution depth map using voxel data, given a specific character and field of view:
[0145] 1) Generate a view frustum based on the view direction. The curved surface at the end of the view frustum corresponds to 320*180 points in the voxel data.
[0146] 2) Starting from the specified character and ending at the above 320*180 points, define 320*180 detection rays;
[0147] 3) Pair the 320*180 start and end points into array A (the array has 320*180 elements, and each array element contains the start and end points);
[0148] 4) In the GPU, the calculation is performed simultaneously on each pair of start and end points in array A, i.e., 320*180 threads concurrently. Each thread executes the following process:
[0149] a. Calculate the n points (a1, b1, c1), (a2, b2, c2), ..., (an, bn, cn) that it needs to pass through in the voxel world using conventional ray detection methods;
[0150] b. Index the corresponding points in the voxel data based on the coordinates in the voxel scene from near to far, and check whether they are solid points;
[0151] c. If the m-th point encountered is a solid point, then write m into the result; if all points are hollow points, then write n into the result.
[0152] 5) Collect all results to obtain a depth map.
[0153] Since the ray detection process for obtaining a depth map needs to detect where there is a blockage, that is, to obtain the depth and stop the detection, it can also be understood as a one-pixel map.
[0154] By defining different game objectives and perspectives, different spatial features can be extracted and input into the neural network for spatial object segmentation, spatial object classification, and behavior reinforcement learning.
[0155] In addition, the method also includes: determining whether the behavior of the game object is fraudulent.
[0156] The game object's processing takes place within a voxel scene, which includes the game object and its field of view. The game object moves and executes decisions within this field of view. The field of view of a game object is the collection of scene elements within its field of vision. Data in this voxel scene is processed by both the server and client, which are connected wirelessly or via wired connection. Clients can be devices such as mobile phones, tablets, or computers, while the server is a server or a server cluster. Typically, each client operates on one game object, but for certain game types, a single client can operate on multiple game objects. The voxel scene is a three-dimensional space composed of voxels. Within this three-dimensional space, various spatial elements (such as terrain, buildings, game characters, and equipment) are constructed using the voxel data format.
[0157] The game object behavior determination method of this invention mainly includes implementing preventive measures and mid-game prevention measures against game fraud, specifically:
[0158] 1) The server calculates the field of view that the game object should acquire at the current time and sends the field of view to the client in real time;
[0159] 2) Based on the decision-making behavior that the game object has already made, determine whether the decision-making behavior meets the occurrence conditions in the field of vision. If the occurrence conditions are not met, it is considered that there is fraudulent behavior.
[0160] 3) Record the game account and fraudulent behavior corresponding to the game object.
[0161] In this embodiment, the approach to preventing fraud is to store all relevant game data (i.e., player data) of the game object on the server side. The server calculates the game data for each game object and then sends the game data to the client. The game data received by the client is only the data that the game object should receive, and there is no data that the game object should not receive.
[0162] This can be understood as (but not limited to): During a game, the game requires character data for the player character, character data for other players, field-of-view data, map data, configuration data, etc. If all of this game data is sent to the client and calculated separately on each client to advance the game, there is a risk that users may maliciously obtain this data and disrupt the game rules. For example, if a user gains wallhack functionality on the client using a cheat program, they can see other players behind obstacles within their player character's field of view. However, if all of this data is stored on the server side and calculated there, the data actually needed by each player character is sent to the corresponding client, without sending unnecessary data, then malicious acquisition and misuse of data by users can be avoided. This prevents game fraud from the source. In other words, even if a user uses a cheat program on the client, they cannot see players behind obstacles within their field of view because the data of players behind obstacles is not sent to that client.
[0163] It should be noted that the game data sent from the server to the client in this invention refers to dynamic data required to construct the overall game scene, and not all the data of the overall game scene. It can be understood as including dynamically changing data such as other game objects and pickable game items; excluding existing, unchanging scene data such as terrain and vegetation. The size of this dynamic data is much smaller than the total data size of the overall game scene, which reduces the communication data burden between the server and the client, and supports real-time data communication during game operation.
[0164] Besides data acquisition, game fraud also includes making abnormal decisions using normal data during gameplay. For example, under normal circumstances, there might be obstacles between the player's game object and other game objects, making a successful shot difficult, or the distance between the player's game object and other game objects might be too great, making a successful shot difficult; however, in the case of fraudulent gameplay, the player's game object manages to shoot other game objects.
[0165] It should be noted that the game object mentioned in this invention can be understood as the game object operated by the currently monitored client, while other game objects can be understood as game objects operated by other clients, AI game objects of the game server, or non-player objects, etc. Game objects can be game characters or game elements other than game characters, such as vehicles, airdrops, equipment, etc.
[0166] To address the aforementioned game fraud, this invention also proposes a mid-game prevention method. This involves real-time monitoring of the game object's decision-making behavior during gameplay and determining whether the current game environment supports that behavior. If not, game fraud is considered to have occurred. Typically, this mid-game prevention method is implemented on the server side, but it's not excluded that it can also be implemented on the client side if the client has the necessary permissions and configured relevant modules. For example, the game object's field of view can be considered part of the game scene for evaluation. The field of view refers to the game scene that the user can observe when operating the game object on the client. If the game object performs a game action (such as shooting) on other game objects visible in the game scene, this action, i.e., the decision-making behavior, meets the conditions for occurrence. However, if there is an obstacle in the field of view, and the game object cannot observe other game objects behind the obstacle, then game actions on other game objects are not supported, meaning the conditions for occurrence are not met. If a game action is performed on an unobservable game object, fraud is determined to have occurred.
[0167] Once fraudulent activity is identified, the game account associated with the fraudulent activity and the fraudulent act should be immediately recorded. Furthermore, the game may be terminated immediately, or other measures may be taken depending on the severity of the fraud.
[0168] Preferably, the field of view is defined as the area of the game object's view frustum, and the area within the view frustum is considered to be the area that the player (i.e., the client) should see on the client's display interface. Here, the game object can be a game character with an anthropomorphic field of view, whose field of view can be observed on the client from either a first-person or third-person perspective.
[0169] Furthermore, within the view frustum region, if a ray detects an obstruction between the path of this game object and other game objects, then the other game object will not be displayed.
[0170] For example, if there are other game objects in the grass within the field of view of this game object, then this game object should not be able to see those other game objects.
[0171] For example, if the current game object is outside the house while other game objects are inside the house, then the current game object outside the house should not be able to see the other game objects inside the house.
[0172] Ideally, the decision-making behaviors of game objects include shooting, hitting, and healing behaviors.
[0173] Regarding shooting behavior, this invention uses ray detection to determine whether the path between the game object and other game objects is unobstructed. If it is unobstructed and the distance between the game object and other game objects meets the shooting requirements, then the shooting conditions are met and the shooting action can be completed. Conversely, if the path between the game object and other game objects is obstructed or the distance between the game object and other game objects does not meet the shooting requirements, then the shooting (hitting) behavior should not occur.
[0174] Typically, the determination of a decision-making behavior is made only after the decision-making behavior has occurred and been detected. Therefore, it is only necessary to determine that the player's decision-making behavior is fraudulent after determining that the current game environment does not meet the requirements of the decision-making behavior.
[0175] Regarding the striking action, it is usually determined whether the conditions are met by the distance between the game object and other game objects. If the distance between the game object and other game objects exceeds the distance supported by the striking action, it is considered fraudulent.
[0176] A preferred voxel-based ray detection process includes:
[0177] 1) Calculate the n points (a1, b1, c1), (a2, b2, c2), ..., (a...) points traversed by the path formed by the current game object (x1, y1, z1) and other game objects (x2, y2, z2) in the voxel scene. n b n c n That is, a ray is emitted from the starting point (x1, y1, z1) to the ending point (x2, y2, z2). There is a line segment between the starting point and the ending point. The points on this line segment are the n points that need to be passed through.
[0178] 2) In the GPU, calculations are performed on n points simultaneously: each point is indexed to its corresponding point in the voxel scene based on its 3D coordinates (x, y, z) in the voxel scene, and its solid point is checked. Specifically, each coordinate point in the voxel scene has an attribute value. If the attribute value is 1, it means that there is an object or part of an object at that coordinate point. For example, game characters, buildings, and other objects occupy a large number of coordinate positions, and the attribute of the coordinate points of these occupied positions is 1, which means solid points. Conversely, if the attribute value is 0, it means that there is no object at that coordinate point, which means it is an empty scene, or hollow point.
[0179] 3) If a solid point is detected among the n points, then there is an obstruction between this game object and other game objects;
[0180] 4) If no solid point is detected among the n points, then the path between this game object and other game objects is unobstructed.
[0181] An index can be understood as a search. When checking whether n points are solid, it is first necessary to "reach" these n points, and the index is the "reach" step. It can be understood as a proprietary step in the computer processing.
[0182] In the voxel data world, 1 represents a solid point, and 0 represents a hollow point. An object in the voxel data world is represented by a series of 1s at several specific locations. Writing an object is equivalent to writing 1s at several specific locations in the voxel data world; erasing an object is equivalent to writing 0s at several specific locations in the voxel data world.
[0183] In addition, this invention applies voxel data to GPU ray detection, which can achieve high-speed multi-path concurrent computation. It can be understood that in the GPU, the time for detecting multiple rays using voxel data is the same as the time for detecting one ray. Therefore, the time for detecting multiple rays can be greatly shortened, thereby greatly reducing the computational load on the server side. This makes it possible to uniformly place the calculation of each player's game data on the server side.
[0184] In other embodiments, the voxel scene can also be other application scenarios. In these other application scenarios, the scene elements will not only include terrain, vegetation, buildings, and outdoor decorations, but also other scene elements that are different from terrain, vegetation, buildings, and outdoor decorations. Correspondingly, the data export and voxel data conversion for these other scene elements may employ methods different from those in this embodiment, and this is not limited here.
[0185] It should be noted that this does not mean that voxel data can only be used for calculations in GPUs. Voxel data can still be used for calculations in CPUs. However, in ray detection, parallel calculations are not possible, and multiple path detection tasks can only be executed sequentially.
[0186] Below is an example of a GPU-based parallel implementation of single-path ray detection:
[0187] 1) Use raycasting to calculate the n points (a1, b1, c1), (a2, b2, c2), ..., (a...) points that the starting point (x1, y1, z1) and ending point (x2, y2, z2) need to pass through in the voxel scene. n b n c n The so-called ray detection method is to emit a ray from the starting point to the ending point. There is a line segment between the starting point and the ending point, and the points on this line segment are the n points that need to be passed through.
[0188] 2) Put n points into array A (the array has n elements, and each array element contains voxel scene coordinate information, that is, three-dimensional coordinate (x, y, z) information);
[0189] 3) In the GPU, each point in array A is calculated simultaneously, i.e., n threads run concurrently, and each thread executes the following process:
[0190] The points in the voxel data are indexed based on the coordinates in the voxel scene, and it is checked whether they are solid points. If a solid point is detected, 1 is written to the result, which is the first detection result, indicating that the thread is blocked; if no solid point is detected, 0 is written to the result, which is the second detection result, indicating that the path corresponding to the thread is unobstructed.
[0191] Below is an example of implementing multiple ray detections in parallel using a GPU:
[0192] 1) For m ray detection tasks, there are m pairs of start points and end points. Put them into array B (the array has m elements, and each array element contains a start point and an end point).
[0193] 2) In the GPU, the calculation is performed simultaneously on each pair of start and end points in array B, i.e., m parent threads run concurrently, and each thread executes the following process:
[0194] a. Perform ray detection on the starting point (x1, y1, z1) and the ending point (x2, y2, z2).
[0195] b. Use raycasting to calculate the n points (a1, b1, c1), (a2, b2, c2), ..., (a...) that it needs to pass through in the voxel scene. n b n c n );
[0196] c. Put n points into array A' (the array has n elements, and each array element contains voxel scene coordinate information, that is, three-dimensional coordinate (x, y, z) information);
[0197] d. In the GPU, each point in array A is calculated simultaneously, i.e., n child threads run concurrently. Each child thread executes the following process (at this time, n child threads are run concurrently for each parent thread, i.e., a total of n*m threads): index the point in the voxel data according to the coordinates in the voxel scene, and check whether it is a solid point; if a solid point is detected, write 1 to the result, indicating that the path corresponding to the child thread is blocked; if no solid point is detected, write 0 to the result, indicating that the path corresponding to the child thread is unobstructed.
[0198] 3) Collect the detection results of m rays.
[0199] The present invention measured on the RTX3090 processor and AMD Threadriper 3990X processor that when performing 1 million or more ray detections simultaneously, the detection speed of the GPU is about 550 times that of a single CPU core, and the computing speed is significantly improved.
[0200] Dynamic programming is typically required in voxel scenes to compute navigation tasks, outputting a path. A dynamic programming task includes several nodes to be explored. It's important to note that these nodes are nodes in the context of the task process and do not represent specific references in the data. In some embodiments, a node can be a specific voxel scene coordinate point. For dynamic programming, node exploration is sequential; whether raycasting is needed during node exploration and which targets to raycast are unknown, thus forming a time-series task. This invention utilizes a GPU to perform parallelized, time-distributed tasks:
[0201] 1) Estimate the detection area that dynamic programming will use;
[0202] 2) Perform ray detection on all nodes in the detection area and all detection targets that need to be detected for each node. Assuming there are x detection targets and y nodes, there are x*y paths, which means there are x*y parallel detection tasks in total. Among them, the detection target can be a voxel scene coordinate point, such as a target object in the game world or a coordinate point on the exterior of a scene building.
[0203] 3) Save the test results;
[0204] 4) When the dynamic programming algorithm is executed, it is only necessary to query the already calculated detection results.
[0205] Since the storage space occupied by the ray detection results of the specified detection area is very small, with one result occupying at most one byte, 1MB can store 1 million detection results. Therefore, the dynamic programming algorithm of this invention has high execution efficiency, requiring only the time to read.
[0206] Preferably, there is also a need to perform dynamic planning on multiple detection subjects simultaneously. Each detection subject includes several detection targets. That is, ray detection is performed on x*y paths of the detection area corresponding to different detection targets at the same time, and the detection results are saved to form a detection result table divided by detection area. When performing dynamic planning on a detection area, the detection results of the detection area can be retrieved from the detection result table.
[0207] For example, if dynamic planning is required for regions A, B, C, and D, ray detection can be performed on x*y paths in each region simultaneously, with the detection time being only the time t of a single ray detection.
[0208] Save the detection results: the detection result for region A is a, the detection result for region B is b, the detection result for region C is c, and the detection result for region D is d, forming a detection result table of Aa, Bb, Cc, and Dd. When performing dynamic programming on region A, result a can be retrieved.
[0209] Regardless of whether there are multiple detection targets or multiple detection subjects, the X-ray detection time is only the time t of a single X-ray detection. Subsequent data can be read in real-time during the dynamic programming process, making the computation speed extremely fast.
[0210] Preferably, the game object frequently shifts position during gameplay, meaning its location changes at different times. This game object is referred to here as a dynamic game object, and its voxel data needs to be refreshed in the field of view at a preset period. The server-side calculation of the field of view that the game object should acquire at the current time includes:
[0211] 1) In the field of view, obtain the type of all dynamic game objects and the offset coordinates of the outline points of each type of dynamic game object relative to the center point of the game object;
[0212] 2) Calculate and obtain the updated coordinates of the outline points after the refresh based on the center point coordinates and the offset coordinates of the outline points of the dynamic game object at the end of the most recent preset cycle;
[0213] 3) Write the updated coordinates of all outline points after the dynamic game object is refreshed into voxel data, and erase the voxel data of the original positions of all outline points before the dynamic game object is refreshed, thus completing the dynamic refresh of all game objects in the field of view and obtaining the calculated refreshed field of view.
[0214] Contour point coordinates are the coordinates that make up the contour of an object. Writing voxel data to an object means writing 1 at the positions of several contour points.
[0215] For example, if the center point of an airdrop in the game is (10, 10, 30), and one of its outline points is (0, 2, 0, 50), then the offset of this outline point relative to the center point is (-10, 10, 20). After a refresh, the center point of the dynamic game object is (10, 10, 25), so the refreshed coordinates of this outline point are (0, 2, 0, 45). A 1 is written to the refreshed outline point at position (0, 2, 0, 45), and a 0 is written to the original position (0, 2, 0, 50). Refreshing all the outline points that make up the airdrop simultaneously refreshes the airdrop's location.
[0216] By using voxel data, even with global erasure and writing implemented in parallel on the GPU, real-time voxel scene updates can be completed at a high speed of 10 microseconds (0.01 milliseconds). In other embodiments of the invention, all dynamic game objects within the entire game can be refreshed at a preset period, and corresponding data can be sent to different clients according to the field of view of different game objects.
[0217] Dynamic game objects can be game characters, vehicles, airdrops, or any other game object that may move.
[0218] Ideally, in addition to judging decision-making behaviors such as shooting, hitting, and healing, fraudulent behavior can also be determined by judging whether the path taken by the game object and the method of travel are compliant. Specifically:
[0219] 1) Calculate and obtain the navigation path and mode of transportation between the game object and the destination; the number of navigation paths can be one or more, and the number of modes of transportation can be one or more.
[0220] 2) Determine whether the navigation path includes the actual walking path of the game object, and determine whether the passage methods supported on the actual walking path include the passage methods actually used by the game object. If not, it is considered that the game object has committed fraud.
[0221] For example, if the game object is on flat ground and its destination is a house on a cliff, it needs to use a jetpack (flying) device to reach the house by taking a straight path (the navigation path). If it takes a curved path (the navigation path), it can reach the house by walking. This means that a straight path only supports jetpack (flying) movement, while a curved path supports walking, jumping, and jetpack (flying) movement. If the game object is detected reaching the house by walking in a straight line without having a jetpack (flying) device, it can be determined that the game object is engaging in fraudulent behavior.
[0222] For example, if a player is on a river and their destination is the other side, and the river is set to be deep, the game only supports traveling to the other side by watercraft or jet (flying). It does not support the player crossing the river without using any watercraft or equipment. If the game detects that the player is crossing the river without using any watercraft or equipment, it is considered fraudulent behavior.
[0223] For example, if a game object is set to consume an energy value of 's' after moving a certain distance, and the actual energy value consumed by the game object after moving a certain distance is less than 's', then the game object is considered to have engaged in fraudulent behavior.
[0224] Preferably, the calculation of the navigation path and mode of travel between the game object and the destination is based on the layer data of the voxel scene and the connection data between the layer data, specifically including:
[0225] 1) In the x, y, z three-dimensional space of the voxel scene, take a basic plane z = z′. There are several basic points (x, y, z′) on the basic plane. With the basic point as the base point and the z coordinate of the basic point as the height, several basic pillars are formed. There are L element points (x, y, z) on each basic pillar.
[0226] 2) Access all basic pillars in parallel on the GPU, and traverse each element point on the basic pillar in each parallel thread, and index the corresponding voxel scene coordinate point according to the voxel data, and determine whether the voxel scene coordinate point is a hollow point or a solid point.
[0227] 3) Collect continuous hollow segments on each foundation column. If the height of a continuous hollow segment is greater than or equal to the first preset height, then define the continuous hollow segment as a voxel layer.
[0228] 4) Calculate the positional relationship between the voxel layer where the game object is currently located and each voxel layer on the adjacent base pillar, thereby obtaining the passage method between the voxel layer where the game object is currently located and each voxel layer on the adjacent base pillar.
[0229] This invention also discloses a data processing system based on voxel data, wherein the raw data of a game scene constitutes a pixel scene, the pixel scene includes scene elements of several different data types, and the system includes:
[0230] The export module exports the raw data of several scene elements respectively;
[0231] The conversion module sets the desired side length of the unit voxel and, based on the side length of the unit voxel, converts the original data of several scene elements into voxel data. The voxel data is represented as voxel modules in the voxel scene.
[0232] The stitching module stitches together the voxel modules of all scene elements according to their relative positions in the pixel scene to obtain a voxel scene.
[0233] The system includes a hardware structure and a computer-readable storage medium. The aforementioned functional modules can be integrated into the hardware structure or into the computer-readable storage medium; this is not limited. Furthermore, the connection relationship between the aforementioned functional modules can be a tangible connection or an intangible connection across regions; this is not limited. In addition, this system and the corresponding method embodiments belong to the same concept; the specific implementation process is detailed in the corresponding method embodiments and will not be repeated here.
[0234] This invention also discloses a data processing server based on voxel data. The raw data of the game scene constitutes a pixel scene, which includes scene elements of several different data types. The server includes:
[0235] The export module exports the raw data of several scene elements respectively;
[0236] The conversion module sets the desired side length of the unit voxel and, based on the side length of the unit voxel, converts the original data of several scene elements into voxel data. The voxel data is represented as voxel modules in the voxel scene.
[0237] The stitching module stitches together the voxel modules of all scene elements according to their relative positions in the pixel scene to obtain a voxel scene.
[0238] Furthermore, this server and the corresponding method embodiment belong to the same concept, and its specific implementation process can be found in the corresponding method embodiment, which will not be repeated here.
[0239] This invention also discloses a computer-readable storage medium for storing data processing instructions based on voxel data. The original data of the game scene constitutes a pixel scene, which includes scene elements of several different data types. When the instructions are executed, they perform the following steps:
[0240] Export the raw data of several scene elements respectively;
[0241] Set the desired side length of the unit voxel, and combine the side length of the unit voxel to convert the original data of several scene elements into voxel data. The voxel data is represented as voxel modules in the voxel scene.
[0242] Based on the relative positions of the voxel modules of all scene elements in the pixel scene, the voxel modules of all scene elements are stitched together to obtain the voxel scene.
[0243] The computer-readable storage medium can be integrated into the hardware, and when the hardware is running, the computer-readable storage medium can be supported for reading and execution.
[0244] Furthermore, the computer-readable storage medium and the corresponding method embodiments belong to the same concept, and the specific implementation process can be found in the corresponding method embodiments, which will not be repeated here.
[0245] The present invention also discloses a computer program product, including computer-executable instructions, which are executed by a processor to perform the following steps:
[0246] Export the raw data of several scene elements respectively;
[0247] Set the desired side length of the unit voxel, and combine the side length of the unit voxel to convert the original data of several scene elements into voxel data. The voxel data is represented as voxel modules in the voxel scene.
[0248] Based on the relative positions of the voxel modules of all scene elements in the pixel scene, the voxel modules of all scene elements are stitched together to obtain the voxel scene.
[0249] Furthermore, this computer program product and the corresponding method embodiment belong to the same concept, and its specific implementation process can be found in the corresponding method embodiment, which will not be repeated here.
[0250] It should be noted that the embodiments of the present invention have better implementability and are not intended to limit the present invention in any way. Any person skilled in the art may use the above-disclosed technical content to change or modify it into equivalent effective embodiments. However, any modifications or equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of the technical solution of the present invention.
Claims
1. A data processing method based on voxel data, characterized in that, The raw data of the game scene constitutes a pixel scene, which includes scene elements of several different data types, and the method includes: Export the original data of several types of scene elements respectively; Set the desired side length of the unit voxel, and combine the side length of the unit voxel to convert the original data of several scene elements into voxel data. The voxel data is represented as voxel modules in the voxel scene. Based on the relative positions of the voxel modules of all the scene elements in the pixel scene, the voxel modules of all the scene elements are spliced together to obtain the voxel scene. Within the voxel scene, a voxel region within the target space of the target object is cropped and obtained. The voxel region is then used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features of the target object. The process of cropping to obtain a voxel region within the target spatial range of the target object, and using the voxel region as a three-dimensional tensor as input to a neural network to obtain the spatial features of the target object, includes: Centered on the target object, a voxel cube within the spatial range surrounding the target object is cropped and used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features around the target object.
2. The method according to claim 1, characterized in that, The scene elements include at least one of terrain, vegetation, buildings, and outdoor decorations; The process of exporting the original data for several types of scene elements includes: Export the 3D model file format data and coordinate information of the outdoor ornaments and the building; Export the comma-separated value file format data of the vegetation; The terrain is captured orthogonally using a depth camera to produce images containing surface height data.
3. The method according to claim 2, characterized in that, The process of setting the desired side length of a unit voxel, and then converting the original data of several scene elements into voxel data based on that side length, includes: The "Read / Write Triangular Mesh" and "Create from Triangular Mesh" functions in the open-source library are used to convert the 3D model file format data of the outdoor ornaments and the building into voxel data. Obtain the size of the collider of the vegetation, and combine it with the side length of the unit voxel to calculate the number of voxels and the shape of the voxel that the vegetation needs to occupy in the voxel scene. Based on the image containing the surface height data of the terrain, the surface height data of the terrain is converted into voxel data by sampling point by point according to the side length of the unit voxel.
4. The method according to claim 1, characterized in that, The process of cropping to obtain a voxel region within the target spatial range of the target object, and using the voxel region as a three-dimensional tensor as input to a neural network to obtain the spatial features of the target object, includes: Within the spatial range in front of the target object, a first voxel cuboid is cropped and obtained. This first voxel cuboid is then used as the input to a neural network in the form of a three-dimensional tensor to obtain the spatial features in front of the target object. Within the spatial range in front of the target object, a second voxel cuboid is obtained by cropping, wherein the length of the second voxel cuboid is much larger than the length of the first voxel cuboid. The second voxel cuboid is used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features at a distance in front of the target object.
5. The method according to claim 1, characterized in that, The process of cropping to obtain a voxel region within the target spatial range of the target object, and using the voxel region as a three-dimensional tensor as input to a neural network to obtain the spatial features of the target object, includes: For a specified target object and field of view, a depth map with a resolution of M*N is obtained by using voxel data in the voxel scene through ray detection. The depth map is then used as the input to a neural network to obtain the spatial features of the target object.
6. The method according to claim 5, characterized in that, The step of obtaining a depth map with a resolution of M*N using voxel data in the voxel scene through ray detection for a specified target object and field of view includes: A view cone is generated in the direction of the field of view, and the end of the view cone is a curved surface. In the voxel scene, the curved surface includes M*N points. Starting from the target object and ending at the M*N points, M*N paths are formed. Ray detection is performed on the M*N paths from the starting point to the ending point until a solid point on the path is detected. The detection results of the M*N paths constitute the depth map.
7. The method according to claim 6, characterized in that, The step of performing ray detection on M*N paths along the direction from the starting point to the ending point until a solid point on the path is detected includes: The path includes a starting point and an ending point; Calculate and obtain the n points that the path passes through in the voxel scene; In the GPU, the M*N paths are calculated simultaneously to index the point corresponding to each point in the voxel scene.
8. The method according to claim 1, characterized in that, The method further includes: Determining whether the behavior of a game object is fraudulent, wherein the game processing of the game object takes place in the voxel scene, the voxel scene includes the game object and the game object's field of view scene, each client corresponds to one or more game objects, and determining whether the behavior of the game object is fraudulent includes: The server calculates the field of view that the game object should acquire at the current time and sends the field of view to the client in real time. Based on the decision-making behavior that the game object has already made, it is determined whether the decision-making behavior meets the occurrence conditions in the field of vision scenario. If the occurrence conditions are not met, it is considered that there is fraudulent behavior. Record the game account corresponding to the game object and the fraudulent behavior.
9. The method according to claim 8, characterized in that, The area of the field of view is the area of the game object's view frustum; Within the area of the view frustum, if ray detection determines that there is an obstruction between the path of this game object and other game objects, then the other game objects will not be displayed.
10. The method according to claim 8, characterized in that, The step of determining whether the decision-making behavior based on the game object's existing decision-making behavior satisfies the occurrence conditions in the field of view scenario includes: The path between this game object and other game objects is determined by ray detection. If the path is clear, the decision-making behavior meets the conditions for occurrence; if the path is obstructed, the decision-making behavior does not meet the conditions for occurrence.
11. The method according to claim 8, characterized in that, The calculation of the field of view that the game object should acquire at the current time includes: In the field of view, obtain the types of all dynamic game objects and the offset coordinates of the outline points of each type of dynamic game object relative to the center point of the game object; The updated coordinates of the outline points are calculated and obtained based on the center point coordinates of the dynamic game object at the end of the most recent preset cycle and the offset coordinates of the outline points. After the dynamic game object is refreshed, the updated coordinates of all outline points are written into voxel data, and the original voxel data of all outline points before the dynamic game object is refreshed are erased. This completes the dynamic refresh of all game objects in the field of view, thus obtaining the calculated refreshed field of view.
12. The method according to claim 8, characterized in that, The step of determining whether the decision-making behavior based on the game object meets the occurrence conditions in the field of view scenario, and considering fraudulent behavior if the occurrence conditions are not met, includes: Calculate and obtain the navigation path and mode of transportation between the game object and the destination; the number of navigation paths is one or more, and the number of modes of transportation is one or more. Determine whether the navigation path includes the actual walking path of the game object, and determine whether the passage methods supported on the actual walking path include the passage methods actually used by the game object. If not, it is considered that there is fraudulent behavior.
13. The method according to claim 12, characterized in that, The calculation of the navigation path and mode of travel between the game object and the destination includes: In the x, y, z three-dimensional space of the voxel scene, a basic plane z = z′ is taken, and there are several basic points on the basic plane; with the basic point as the base point and the z coordinate of the basic point as the height, several basic pillars are formed, and there are L element points on each basic pillar; All the base pillars are accessed in parallel in the GPU, and each element point on the base pillar is traversed in each parallel thread. The voxel scene coordinate point is indexed according to the voxel data, and it is determined whether the voxel scene coordinate point is a hollow point or a solid point. Collect continuous hollow point segments on each of the foundation columns. If the height of the continuous hollow point segment is greater than or equal to a first preset height, then define the continuous hollow point segment as a voxel layer. The positional relationship between the voxel layer where the game object is currently located and each voxel layer on the adjacent base pillar is calculated, thereby obtaining the passage mode between the voxel layer where the game object is currently located and each voxel layer on the adjacent base pillar.
14. The method according to claim 1, characterized in that, The judgment steps for X-ray detection include: Calculate the n points (a1, b1, c1), (a2, b2, c2), ..., (an, bn, cn) that the ray path formed by the current game object (x1, y1, z1) and other game objects (x2, y2, z2) passes through in the voxel scene; In the GPU, calculations are performed simultaneously on the n points: the coordinates in the voxel scene are indexed to the n points in the voxel scene, and it is checked whether they are solid points; If a solid dot is detected among the n points, then the path between this game object and other game objects is blocked; if no solid dot is detected among the n points, then the path between this game object and other game objects is unobstructed.
15. The method according to claim 14, characterized in that, The ray detection judgment step further includes: performing ray detection on m paths in the GPU: The m paths include m starting points and m ending points; simultaneously, n points traversed by each path in the voxel scene are calculated and obtained; Simultaneously, calculations are performed on the n points in the m paths: each point is indexed according to its coordinates in the voxel scene to find the corresponding point in the voxel scene, and its solid point is checked. If a solid point is detected among the n points, then the path is blocked; otherwise, the path is unobstructed, thus obtaining the detection results of m paths.
16. The method according to claim 15, characterized in that, Also includes: A detection region includes x detection targets and y nodes. Dynamic planning is performed on the detection region, including: Simultaneously, ray detection is performed on the x*y paths formed by the x detection targets and y nodes, and the detection results are saved; The detection results of different paths are retrieved for the detection area at different times to perform the dynamic planning.
17. The method according to claim 16, characterized in that, Also includes: Dynamic planning is performed on multiple detection areas, including: Simultaneously, ray detection is performed on x*y paths in different detection areas, and the detection results are saved to form a detection result table divided by the detection areas; When performing the dynamic planning on a detection area, the detection results of the detection area are retrieved from the detection result table.
18. A data processing server based on voxel data, characterized in that, The raw data of the game scene constitutes a pixel scene, which includes scene elements of several different data types, and the server includes: The export module exports the original data of several types of scene elements respectively; The conversion module sets the desired side length of the unit voxel, and converts the original data of several scene elements into voxel data based on the side length of the unit voxel. The voxel data is represented as voxel modules in the voxel scene. The stitching module stitches together the voxel modules of all the scene elements according to their relative positions in the pixel scene to obtain the voxel scene. The acquisition module crops and acquires the voxel region within the target space range of the target object in the voxel scene, and uses the voxel region as the input of the neural network in the form of a three-dimensional tensor to obtain the spatial features of the target object. The process of cropping to obtain a voxel region within the target spatial range of the target object, and using the voxel region as a three-dimensional tensor as input to a neural network to obtain the spatial features of the target object, includes: Centered on the target object, a voxel cube within the spatial range surrounding the target object is cropped and used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features around the target object.
19. A computer-readable storage medium for storing data processing instructions based on voxel data, characterized in that, The raw data of the game scene constitutes a pixel scene, which includes scene elements of several different data types, and the instruction performs the following steps when executed: Export the original data of several types of scene elements respectively; Set the desired side length of the unit voxel, and combine the side length of the unit voxel to convert the original data of several scene elements into voxel data. The voxel data is represented as voxel modules in the voxel scene. Based on the relative positions of the voxel modules of all the scene elements in the pixel scene, the voxel modules of all the scene elements are spliced together to obtain the voxel scene. Within the voxel scene, a voxel region within the target space of the target object is cropped and obtained. The voxel region is then used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features of the target object. The process of cropping to obtain a voxel region within the target spatial range of the target object, and using the voxel region as a three-dimensional tensor as input to a neural network to obtain the spatial features of the target object, includes: Centered on the target object, a voxel cube within the spatial range surrounding the target object is cropped and used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features around the target object.
20. A computer program product comprising computer-executable instructions, characterized in that, The raw data of the game scene constitutes a pixel scene, which includes scene elements of several different data types, and the instructions are executed by the processor to perform the following steps: Export the original data of several types of scene elements respectively; Set the desired side length of the unit voxel, and combine the side length of the unit voxel to convert the original data of several scene elements into voxel data. The voxel data is represented as voxel modules in the voxel scene. Based on the relative positions of the voxel modules of all the scene elements in the pixel scene, the voxel modules of all the scene elements are spliced together to obtain the voxel scene. Within the voxel scene, a voxel region within the target space of the target object is cropped and obtained. The voxel region is then used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features of the target object. The process of cropping to obtain a voxel region within the target spatial range of the target object, and using the voxel region as a three-dimensional tensor as input to a neural network to obtain the spatial features of the target object, includes: Centered on the target object, a voxel cube within the spatial range surrounding the target object is cropped and used as the input of a neural network in the form of a three-dimensional tensor to obtain the spatial features around the target object.
Citation Information
Patent Citations
Data processing method and device, electronic equipment and storage medium
CN112891945A
Game 3D scene editing method and device
CN112973127A
Method of creating a virtual game environment and interactive game system employing the method
US20180264365A1