Object processing method and device in game scene, electronic equipment and storage medium
By generating target vertices and building graph structures in the game scene, and combining the attribute information of the source object for breadth priority search and enclosing box size calculation, the accuracy problem of cliff wall generation depends on terrain grid segmentation in the existing technology is solved, and the accuracy of cliff wall generation depends on terrain grid segmentation is improved. The arrangement efficiency and authenticity of rock objects.
Patent Information
- Application Number
- CN202411507494.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-14
AI Technical Summary
When generating cliff walls in game scenes, the prior art relies heavily on the accuracy of tiling of terrain mesh, and the tiling efficiency is inefficient, making it difficult to improve the arrangement efficiency and authenticity of rock objects.
By generating multiple target vertices in the target terrain area and building a graph structure, combining the attribute information of the source object to generate sub-objects and their attributes, using graph structure and sub-object properties for breadth-first search and enclosing box size calculation, generating arrangementable sub-object arrangement information.
It improves the efficiency of rock objects on the cliff wall and the authenticity of the arrangement effect, ensuring that the arrangement of sub-objects meets the needs of game design and effectively utilizes space.
Smart Images

Figure CN119425082A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for processing objects in a game scene. Background Art
[0002] In the editing process of some game scenes, the generation of cliffs is often involved to enhance the realism of the game scenes and bring visual shock.
[0003] Currently, the area where rock objects can be arranged can be segmented based on the terrain grid, and then the segmented area can be filled with matching rock objects to simulate the rock arrangement effect on the cliff.
[0004] However, the above methods are heavily dependent on the accuracy of terrain grid segmentation, and when the terrain grid is large, the segmentation efficiency will also be affected. Summary of the invention
[0005] The purpose of the present application is to provide a method, device, electronic device and storage medium for processing objects in a game scene, so as to improve the efficiency of arranging rock objects in a cliff and the authenticity of the arrangement effect.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for processing objects in a game scene, including:
[0008] According to the position information of each mesh vertex in the target terrain area, a plurality of target vertices are generated in the target terrain area, and a graph structure is constructed according to each target vertex, wherein the target terrain area is a terrain area to be arranged in the game scene, and the graph structure is used to indicate the connection relationship between each target vertex;
[0009] Generate sub-objects corresponding to each source object and object attributes of each sub-object according to attribute information of each source object; wherein the source object is a pre-made virtual model for modifying the target terrain area, and the sub-object refers to a virtual model obtained by rotating the source object according to preset rotation information;
[0010] According to the graph structure, the sub-objects corresponding to each source object and the object properties of each sub-object, arrangement information of at least one sub-object to be arranged is generated; the arrangement information includes: the identification of the sub-object, the placement position of the sub-object, the placement size of the sub-object and the placement orientation of the sub-object; wherein the arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area.
[0011] In a second aspect, an embodiment of the present application further provides an object processing device in a game scene, including: a construction module and a generation module;
[0012] The construction module is used to generate multiple target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, and to construct a graph structure according to each target vertex, wherein the target terrain area is a terrain area to be arranged in the game scene, and the graph structure is used to indicate the connection relationship between each target vertex;
[0013] The generating module is used to generate sub-objects corresponding to each source object and object properties of each sub-object according to the property information of each source object; wherein the source object is a pre-made virtual model for modifying the target terrain area, and the sub-object refers to a virtual model obtained by rotating the source object according to preset rotation information;
[0014] The generation module is used to generate arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object and the object attributes of each sub-object; the arrangement information includes: the identification of the sub-object, the placement position of the sub-object, the placement size of the sub-object and the placement orientation of the sub-object; wherein the arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area.
[0015] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to execute the object processing method in the game scene provided in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the object processing method in the game scene provided in the first aspect is executed.
[0017] The beneficial effects of this application are:
[0018] The present application provides an object processing method, device, electronic device and storage medium in a game scene, including: generating multiple target vertices in a target terrain area according to position information of each mesh vertex in a target terrain area, and constructing a graph structure according to each target vertex; generating sub-objects corresponding to each source object and object properties of each sub-object according to attribute information of each source object; generating arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object and the object properties of each sub-object; the arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area. This method selects the target terrain area where rocks need to be arranged from the terrain of the game scene, and generates a graph structure corresponding to the target terrain area by scattering points in the target terrain area based on the scattering results. In addition, by preprocessing each source object to be selected, the sub-objects corresponding to each source object can be generated, so that based on the sub-objects and the graph structure, breadth-first search and bounding box size calculation are performed to generate the arrangement information of the sub-objects that can be arranged. The arrangement information of the sub-objects that can be arranged can be used for subsequent rendering of the target terrain area to display specific terrain and landforms. Among them, the optimal placement position and placement order of the sub-objects in the target terrain area can be determined by breadth-first search, ensuring that the arrangement of the sub-objects not only meets the game design requirements but also effectively utilizes the space; and by bounding box size calculation, the reasonable placement size and orientation of the sub-objects can be determined to ensure the consistency and coordination of the placement between the sub-objects. Thereby improving the efficiency of sub-object arrangement and the authenticity of the arrangement effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A flowchart of a method for processing objects in a game scene provided by an embodiment of the present application;
[0021] Figure 2 A flowchart of another method for processing objects in a game scene provided by an embodiment of the present application;
[0022] Figure 3 A flowchart of another method for processing objects in a game scene provided in an embodiment of the present application;
[0023] Figure 4 A flowchart of another method for processing objects in a game scene provided by an embodiment of the present application;
[0024] Figure 5 A flowchart of another method for processing objects in a game scene provided in an embodiment of the present application;
[0025] Figure 6 A flowchart of another method for processing objects in a game scene provided by an embodiment of the present application;
[0026] Figure 7 A flowchart of another method for processing objects in a game scene provided by an embodiment of the present application;
[0027] Figure 8 A flowchart of another method for processing objects in a game scene provided in an embodiment of the present application;
[0028] Fig. 9 A flowchart of another method for processing objects in a game scene provided in an embodiment of the present application;
[0029] Fig.10 A schematic diagram of an object processing device in a game scene provided by an embodiment of the present application;
[0030] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0032] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0033] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0034] In the scene editing of open world games, the terrain described by the height map often faces the following problems: the map is stretched vertically and cannot describe the horizontal convex and concave effects. Therefore, the complexity of the cliffs in the real world cannot be reproduced by relying solely on the terrain. Therefore, a large number of rock decorations are needed to enhance the sense of reality.
[0035] There are currently two mainstream solutions:
[0036] 1. Manual placement of art.
[0037] 2. Based on the arrangable area mesh (a collection of vertices and edges used to build a 3D model), cut out the bounding and fill it with matching assets.
[0038] The effect of manual placement of artists is certainly good, but when facing a large world map, the human resources consumed are immeasurable.
[0039] The arrangable area mesh segmentation scheme uses a geometric processing method, which is prone to errors and low segmentation efficiency, resulting in high requirements for the input mesh and difficult to control the output effect.
[0040] Based on this, this solution provides an object processing method in a game scene, by screening out the cliff terrain grid where rocks need to be arranged from the game scene terrain grid, and by scattering points in the cliff terrain grid, based on the scattering results, a vertex graph structure corresponding to the cliff terrain grid is generated. In addition, by pre-processing each selected rock object, a sub-rock object corresponding to each rock object can be generated, so that based on the sub-rock object and the vertex graph structure, a breadth-first search and bounding box size calculation are performed to generate the arrangement information of the sub-rock object that can be arranged. Based on the arrangement information of the sub-rock object that can be arranged, the arrangement position of each sub-rock object in the cliff terrain grid can be determined, and then the sub-rock object is rendered together with the cliff terrain according to the arrangement position of the sub-rock object to simulate the cliff effect in the game scene. A rock arrangement method that does not rely on the segmentation effect of the cliff terrain grid is realized. Among them, the optimal placement and order of rock objects in the cliff can be determined through breadth-first search, ensuring that the arrangement of rock objects meets the game design requirements and effectively utilizes space; and the reasonable placement size and orientation of rock objects can be determined through bounding box size calculation, ensuring the consistency and coordination of the placement of rock objects. This improves the efficiency of rock object arrangement and the authenticity of the arrangement effect.
[0041] Figure 1The following is a flow chart of a method for processing objects in a game scene provided by an embodiment of the present application. The execution subject of the method can be a computer device such as a terminal or a server. Figure 1 As shown, the method may include:
[0042] S101 . Generate multiple target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, and construct a graph structure according to each target vertex.
[0043] The target terrain area is the terrain area to be arranged in the game scene, and the graph structure is used to indicate the connection relationship between the target vertices.
[0044] This solution can be applied to the arrangement of rocks on cliffs in game scenes with various terrains.
[0045] According to the arrangement requirements, only the rock objects need to be arranged in the cliff terrain, so the target terrain area can be screened out from the game terrain of the game scene, and the target terrain area corresponds to the area where the cliff terrain in the game scene is located. That is, the cliff area where the rock objects need to be arranged is screened out from the game scene.
[0046] Optionally, according to the position information of each mesh vertex in the target terrain area, points can be scattered in the target terrain area to randomly distribute the target vertices in the target terrain area to generate multiple target vertices in the target terrain area, so that a graph structure corresponding to the target terrain area can be constructed according to each target vertex. Among them, any terrain area corresponds to a unique terrain mesh, and the terrain mesh can include a set of vertices and edges that constitute a terrain model.
[0047] It is worth noting that by scattering points in the target terrain area, based on the graph structure composed of the target vertices generated by scattering points, the search path of the target terrain area during the traversal search process can be planned, thereby guiding a comprehensive and accurate search of the target terrain area.
[0048] S102: Generate sub-objects corresponding to each source object and object attributes of each sub-object according to attribute information of each source object.
[0049] The source object is a pre-made virtual model for modifying the target terrain area, and the sub-object refers to a virtual model obtained by rotating the source object according to preset rotation information.
[0050] The object in this embodiment may refer to a rock object, and the source object may refer to an original rock object. The source object may be pre-made by an artist according to scene requirements, and the sub-object generated based on the source object may be a rock object obtained by axially rotating the source object. A sub-object may be generated corresponding to any axial rotation angle of the source object.
[0051] Optionally, the source object may include multiple ones, and the shape, size and attributes of each object surface of each source object may be different.
[0052] According to the attribute information of each source object, a sub-object corresponding to each source object can be generated. The attribute information of the source object can refer to the attributes of each object surface of the source object. Taking the rock object as an example, the rock object can usually contain 6 surfaces, each of which can be used as an object surface of the rock object.
[0053] Based on each obtained sub-object, object attributes of each sub-object may also be generated, and the object attributes of the sub-object may be used to uniquely identify the sub-object.
[0054] S103: Generate arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object, and the object attributes of each sub-object.
[0055] The arrangement information includes: an identifier of the sub-object, a placement position of the sub-object, a placement size of the sub-object, and a placement orientation of the sub-object.
[0056] The arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area.
[0057] Optionally, based on the graph structure generated above, the sub-objects corresponding to each source object, and the object properties of each sub-object, a breadth-first search and bounding box size calculation can be performed to match each sub-object to be arranged that meets the conditions to a specified position in the target terrain area, and generate arrangement information for each sub-object to be arranged.
[0058] The sub-objects to be arranged may be part of or all of the sub-objects corresponding to each source object.
[0059] In some embodiments, the identification of the sub-object is used to indicate which sub-object the sub-object to be arranged corresponds to which source object; the placement position of the sub-object is used to indicate the placement position or arrangement position of the sub-object in the target terrain area; the placement size of the sub-object is used to indicate the size of the sub-object when it is placed in the target area; the placement orientation of the sub-object is used to indicate the orientation of the sub-object when it is placed at the placement position in the target area.
[0060] Optionally, based on the generated arrangement information of each sub-object to be arranged, the appropriate arrangement position and arrangement posture of each sub-object to be arranged in the target terrain area can be determined, that is, the target terrain area can be appropriately matched with a suitable sub-object to be arranged, so that the sub-object to be arranged can be rendered together with the target terrain area to show a specific terrain and simulate the real cliff effect in the game scene.
[0061] In summary, the object processing method in the game scene provided by this embodiment includes: generating multiple target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, and constructing a graph structure according to each target vertex; generating sub-objects corresponding to each source object and object properties of each sub-object according to the attribute information of each source object; generating arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object and the object properties of each sub-object; the arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area. This method selects the target terrain area where rocks need to be arranged from the terrain of the game scene, and generates a graph structure corresponding to the target terrain area by scattering points in the target terrain area based on the scattering results. In addition, by preprocessing each source object to be selected, the sub-objects corresponding to each source object can be generated, so that based on the sub-objects and the graph structure, breadth-first search and bounding box size calculation are performed to generate the arrangement information of the sub-objects that can be arranged. The arrangement information of the sub-objects that can be arranged can be used for subsequent rendering of the target terrain area to display specific terrain and landforms. Among them, the optimal placement position and placement order of the sub-objects in the target terrain area can be determined by breadth-first search, ensuring that the arrangement of the sub-objects not only meets the game design requirements but also effectively utilizes the space; and by bounding box size calculation, the reasonable placement size and orientation of the sub-objects can be determined to ensure the consistency and coordination of the placement between the sub-objects. Thereby improving the efficiency of sub-object arrangement and the authenticity of the arrangement effect.
[0062] Figure 2 A flowchart of another object processing method in a game scene provided by an embodiment of the present application. Optionally, in step S101, generating multiple target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area may include:
[0063] S201 : Determine at least one triangular face in the target terrain area according to the positional relationship between mesh vertices in the target terrain area.
[0064] Usually, a triangular face is composed of three vertices. The target terrain area can be divided according to the positional relationship of each mesh vertices in the terrain mesh corresponding to the target terrain area to generate multiple triangular facets corresponding to the target terrain area, wherein the basis for division can be that a triangular face is composed of three mesh vertices, and there is no overlapping area between the triangular facets.
[0065] S202: Determine the proportion of each triangular facet according to the area of each triangular facet and the area of the target terrain region.
[0066] Optionally, according to the area of any triangular facet and the area of the target terrain region, the percentage of each triangular facet in the total area of the target terrain region may be calculated.
[0067] S203: Determine the number of target vertices to be generated on each triangular face according to the preset number of vertices and the ratio of each triangular face.
[0068] The number of target vertices to be spread in the target terrain area can be preset according to the vertex spreading requirement, that is, the preset number of vertices is obtained. For example, if 1000 vertices need to be spread in the target terrain area, the preset number of vertices is 1000.
[0069] Optionally, the number of target vertices to be spread on each triangular facet may be calculated according to a preset number of vertices and the percentage of the total area occupied by each triangular facet, thereby obtaining the number of target vertices to be generated on each triangular facet.
[0070] S204 , determining the position of the target vertex to be generated on each triangular facet according to the number of the target vertices to be generated on each triangular facet, the position information of each mesh vertex constituting each triangular facet, and the seed parameter.
[0071] In some embodiments, the distribution result of the target vertices to be generated on each triangular facet may be randomly adjusted by using a seed parameter seed, thereby determining the position of the target vertices to be generated on the triangular facet.
[0072] The seed parameter can range from 0 to 1, and can be considered as a random number between 0 and 1. The position of any target vertex on any triangle can be calculated using the following function: P = lerp (lerp (pA, pB, seed), pC, seed).
[0073] Among them, P represents the position of the target vertex, pA, pB and pC respectively represent the positions of the three mesh vertices that constitute the triangle patch, seed is a random number between 0 and 1, and lerp is a linear interpolation function.
[0074] The above formula can be used to calculate the positions of each target vertex that needs to be spread (to be generated) on each triangular face.
[0075] S205 . Generate a plurality of target vertices in the target terrain area according to the positions of the target vertices to be generated on each triangular facet.
[0076] Since the target terrain region is composed of triangular facets, points may be scattered on the triangular facets constituting the target terrain region based on the positions of the target vertices to be generated on the triangular facets, thereby generating a plurality of target vertices in the target terrain region.
[0077] Figure 3 A flowchart of another method for processing objects in a game scene provided by an embodiment of the present application is shown in FIG. 1. Optionally, in step S101, constructing a graph structure according to each target vertex may include:
[0078] S301 , generating point cloud data according to each target vertex based on a spatial segmentation data structure.
[0079] In some embodiments, the target vertices generated above may be managed in a KD tree to form point cloud data.
[0080] Among them, the KD (K-Dimensional Tree) tree is a space segmentation data structure for organizing point data. Optionally, each target vertex can be converted into a KD tree based on the space segmentation data structure of the KD tree, that is, each target vertex is stored in the form of a space segmentation data structure to generate point cloud data.
[0081] S302: Determine placement orientation information of each target vertex based on the point cloud data and the grid layout orientation information of the target terrain area.
[0082] The placement orientation information includes: a normal vector and an upward direction vector.
[0083] In this embodiment, the placement orientation information includes a normal vector (N vector) and an upward direction vector (up vector) as an example, wherein the normal vector is a vector perpendicular to a plane or curve, and is often used to describe the orientation of the surface of an object; the up vector is a vector that usually points upward (such as the positive direction of the y axis). In a three-dimensional coordinate system, the up vector is often used to define the vertical direction of an object.
[0084] In some embodiments, the normal vectors of the triangular facets constituting the target terrain area may be determined according to the grid layout direction of the target terrain area, so that the normal vectors of the triangular facets are used as the normal vectors of the target vertices in the triangular facets.
[0085] The up vector of each target vertex can be calculated based on the normal vector of each target vertex.
[0086] Optionally, for any target vertex, the normal vector of the target vertex can be multiplied by the unit vector (0, 1, 0) pointing in the positive direction of the y-axis, and the obtained product is then rotated 90 degrees based on the normal vector to obtain the up vector of the target vertex.
[0087] S303: Search the point cloud data according to a preset search distance and search quantity, and connect each target vertex according to the search results to generate a graph structure.
[0088] Next, each target vertex in the point cloud data is searched by a preset search distance and search quantity, so as to connect the target vertices with edges and generate a graph structure.
[0089] Assuming that the search distance is 1 meter and the search quantity is 50, the search can be performed at a search distance of 1 meter, and a maximum of 50 target vertices can be connected within 1 meter, so that after all the point cloud data are searched, a graph structure is generated.
[0090] It is worth mentioning that point cloud data is a data structure for quickly indexing points adjacent to vertices, while the graph structure is a data structure that builds connectivity between vertices based on the point cloud and is used for searching.
[0091] Figure 4 A flowchart of another object processing method in a game scene provided by an embodiment of the present application; Optionally, in step S102, generating sub-objects corresponding to each source object and object properties of each sub-object according to the attribute information of each source object may include:
[0092] S401. Determine a target object face from among the object faces of the source object according to a structural attribute of the source object, wherein the target object face is a face among the object faces that is allowed to face the player's field of view.
[0093] This embodiment uses the processing process of any source object as an example. In a three-dimensional coordinate system, it is assumed that the source object includes six faces, namely +X, -X, +Y, -Y, +Z, and -Z. Optionally, the structural properties of the source object can be analyzed to determine whether the above six faces can be used as the front side facing the player, and the object face that can be used as the front side facing the player is determined as the target object face.
[0094] The structural attributes here are used to indicate the appearance aesthetics of each object surface of the source object, the degree of interpenetration between each object surface and the terrain, the display area of each object surface, etc.
[0095] For example, when a certain object surface has little interweaving with the terrain, most of the structure of this object surface can be exposed to the outside and can be seen by the player to the maximum extent, then it can be considered that this object surface can be used as a target object surface facing the player.
[0096] S402: Determine the splitting information of the source object according to each target object face and the available attributes of each target object face under at least one target rotation angle.
[0097] Available property to indicate whether the target object face is allowed to face the player's field of view at the target rotation angle.
[0098] Next, for each target object face, the available attributes of the target object face at at least one target rotation angle may be analyzed according to the above judgment principle, that is, whether the target object face can be used as the front side facing the player's field of view at each target rotation angle may be determined.
[0099] In this embodiment, the target rotation angles are all axial rotation angles, which can be 0 degrees, 90 degrees, 180 degrees, and 270 degrees respectively. In actual applications, other rotation angles can also be set, but 0 degrees, 90 degrees, 180 degrees, and 270 degrees can be used as preferred rotation angles.
[0100] Optionally, the source object segmentation information may be generated according to the determined target object faces and the available attributes of each target object face at each target rotation angle.
[0101] In some embodiments, the splitting information of the source object can be represented by a character string, which records the relevant information of each target object face that can be used as the front facing the player and whether each target object face can be used as the front facing the player at each target rotation angle.
[0102] For example, assuming that the split information of the source object is "+Zf", it can be seen that the +Z face of the source object can be used as the front side facing the player, and f is a hexadecimal number, which is "1111" after expansion, indicating that the +Z face can be used as the front side at four rotation angles of 0 degrees, 90 degrees, 180 degrees, and 270 degrees.
[0103] Of course, the split information of the source object can also be represented by text data or in digital form, as long as the relevant information of the target object face that can be used as the front side and whether the target object face can be used as the front side at each target rotation angle can be accurately recorded.
[0104] S403: Generate at least one sub-object corresponding to the source object according to the split information of the source object, and generate object attributes of each sub-object.
[0105] Object attributes include: the sub-object's identifier, the sub-object's bounding box size, and the sub-object's rotation information relative to the source object.
[0106] Then, based on the splitting information of the source object, at least one sub-object corresponding to the source object can be generated, wherein each sub-object is obtained by rotating the source object based on a certain rotation angle.
[0107] Each generated sub-object may also have corresponding object attributes recorded therein, and the object attributes may include but are not limited to the identification of the sub-object, the size of the bounding box of the sub-object, and the rotation information of the sub-object relative to the source object.
[0108] The sub-object identifier is used to uniquely identify the sub-object, and the rotation information of the sub-object relative to the source object indicates that the sub-object is obtained by rotating the source object along which axis and by how many degrees.
[0109] Figure 5 A flowchart of another object processing method in a game scene provided by an embodiment of the present application; Optionally, in step S402, determining the splitting information of the source object according to each target object face and the available attributes of each target object face under at least one target rotation angle may include:
[0110] S501: Determine sub-segmentation information of the target object surface according to available attributes of the target object surface at each target rotation angle.
[0111] Taking any target object face that can be used as the front face as an example, the sub-splitting information of the target object can be determined based on the available attributes of the target object face at each target rotation angle. The sub-splitting information of the target object face can record whether the target object face of the source object is used as the front face at each target rotation angle.
[0112] S502: Determine the splitting information of the source object according to the sub-splitting information of each target object face in the source object.
[0113] The sub-segmentation information of each target object face of the source object is summarized to generate the segmentation information of the source object.
[0114] The splitting information includes: the identifier of each target object face in the source object that is allowed to be facing the player's field of view and the available attribute identifier of each target object face at each target rotation angle.
[0115] Optionally, the splitting information may record the identification of each target object face that can be used as the front side. At the same time, it may also record the identification of whether each target object face can be used as the front side at each target rotation angle. Therefore, based on the splitting information, it can be clearly known which object faces of the source object can be used as the front side and at which target rotation angles each object face that can be used as the front side can be used as the front side.
[0116] Figure 6 A flowchart of another object processing method in a game scene provided by an embodiment of the present application; Optionally, in step S403, generating at least one sub-object corresponding to the source object according to the splitting information of the source object may include:
[0117] S601. Determine the number of object face splits of the source object according to the identifiers of the target object faces in the source object that are allowed to face the player's field of view.
[0118] According to the identification of each target object face that is allowed to be the front face in the source object, it can be determined how many object faces in the source object can be used as the front face, thereby determining the number of object face splits of the source object.
[0119] Assuming that there are three target object faces in the source object that are allowed to be the front faces, it can be determined that the number of object face splits of the source object is 3.
[0120] S602: Determine the number of splits of each target object face in the source object according to the available attribute identifiers of each target object face at each target rotation angle.
[0121] According to the available attribute identifiers of each target object face at each target rotation angle, it can be determined at how many target rotation angles each target object face can be used as the front face, thereby determining the number of splits of each target object face.
[0122] For example, if target object face 1 can be used as the front face at four target rotation angles, then the number of splittable target object face 1 of the source object is four.
[0123] S603: Determine the number of sub-objects corresponding to the source object according to the number of object face splits and the number of target object face splits.
[0124] The number of sub-objects into which the source object can be split can be determined based on the number of object face splits and the number of target object face splits.
[0125] Taking the best quality source object as an example, all six faces of the best quality source object can be used as the front side, and all six faces can be used as the front side at the four target rotation angles. Then the number of sub-objects corresponding to the source object can be 6 times 4, that is, 24.
[0126] S604: Split the source object according to the split information of the source object and the number of sub-objects corresponding to the source object, and generate sub-objects corresponding to the source object.
[0127] According to the splitting information of the source object and the number of sub-objects corresponding to the source object, the source object can be axially rotated to obtain the sub-objects corresponding to the source object.
[0128] Assuming that the +Y face of the source object can be used as the front face, and the +Y face can also be used as the front face when the axial rotation is 90 degrees and 180 degrees, the source object can be rotated to the +Y face as the front face to obtain a sub-object 1, and then with sub-object 1 as the reference, sub-object 1 is axially rotated 90 degrees to obtain sub-object 2, and sub-object 1 is axially rotated 180 degrees to obtain sub-object 3.
[0129] Figure 7A flowchart of another object processing method in a game scene provided by an embodiment of the present application; Optionally, in step S103, generating arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object, and the object attributes of each sub-object may include:
[0130] S701 , traversing each sub-object corresponding to each source object, and determining a size range of a bounding box of the current sub-object according to the size of the bounding box of the traversed current sub-object.
[0131] The bounding box size range includes: the maximum bounding box size and the minimum bounding box size.
[0132] In this embodiment, the breadth-first search algorithm and bounding box size calculation can be combined to anchor the search range in a single round with the sub-object, and each sub-object is searched in turn to match each sub-object to the target terrain area.
[0133] Optionally, each sub-object of each source object may be added to a list to obtain an object list, and the vertices in the graph structure may be added to an array to obtain a vertex array.
[0134] To increase the diversity of the effect, you can start traversing each sub-object in the object list from a random index instead of starting from index 0.
[0135] According to the traversed current sub-object, the size range of the bounding box of the current sub-object may be determined based on the introduced scaling parameter and the size of the bounding box of the current sub-object recorded in the object properties of the current sub-object.
[0136] S702. Starting from the initial target vertex of the first unplaced object in the graph structure, traverse the current adjacent point of the initial target vertex and the next adjacent point of the current adjacent point in sequence according to the adjacency relationship of the vertices until all adjacent points are traversed, and determine the vertex set corresponding to the current sub-object according to the usage attributes of each traversed adjacent point.
[0137] Starting from the first initial target vertex in the vertex array where no object has been placed, use breadth-first search to traverse the current adjacent point of the initial target vertex and the next adjacent point of the current adjacent point in sequence according to the adjacency relationship between vertices. That is, according to the adjacency relationship of each vertex, traverse all adjacent points in sequence starting from the initial target vertex until all adjacent points are traversed. Then, based on the usage attributes of each traversed adjacent point, a vertex set corresponding to the current sub-object can be generated.
[0138] Each target vertex in the graph structure is configured with a placed attribute, which is used to describe whether the target vertex has been searched and occupied by an instantiated object. The usage attribute refers to the placed attribute.
[0139] S703: Determine whether to treat the current sub-object as a sub-object to be arranged according to the size range of the bounding box of the current sub-object and the size of the bounding box of the vertex set; if so, generate arrangement information of the current sub-object.
[0140] Optionally, based on the vertex set of the current sub-object, the bounding box size of the vertex set can be calculated, so as to compare the bounding box size range of the current sub-object and the bounding box size of the vertex set to determine whether the current sub-object can be used as a sub-object to be arranged.
[0141] If the current sub-object can be used as a sub-object to be arranged, the arrangement information of the current sub-object can be generated. If the current sub-object cannot be used as a sub-object to be arranged, the next sub-object in the object list is traversed again.
[0142] Optionally, in step S701, determining the size range of the bounding box of the current sub-object according to the traversed bounding box size of the current sub-object may include: determining the size range of the bounding box of the current sub-object according to the bounding box size of the current sub-object and a preset size scaling range.
[0143] The maximum size of the bounding box of the current sub-object can be determined according to the size of the bounding box of the current sub-object and the upper limit of the size in the preset size scaling range; the minimum size of the bounding box of the current sub-object can be determined according to the size of the bounding box of the current sub-object and the lower limit of the size in the preset size scaling range.
[0144] Optionally, in step S702, determining the vertex set corresponding to the current sub-object based on the usage attributes of each traversed adjacent point may include: based on the usage attributes of each traversed adjacent point, adding to the set each adjacent point whose usage attributes indicate that the adjacent point has not been traversed and is not occupied by an object, to obtain the vertex set corresponding to the current sub-object.
[0145] Optionally, for each traversed adjacent point, the adjacent points indicated by the placed attribute that have not been traversed and are not occupied by the object can be added to a set according to the placed attribute of each adjacent point to obtain the vertex set corresponding to the current sub-object.
[0146] Optionally, in step S703, determining whether to treat the current sub-object as a sub-object to be arranged is performed based on the bounding box size range of the current sub-object and the bounding box size of the vertex set, which may include: if the bounding box size of the vertex set is larger than the maximum bounding box size of the current sub-object, determining that the current sub-object is a sub-object to be arranged, updating the usage attributes of each vertex in the graph structure, and traversing the next sub-object.
[0147] Optionally, if the bounding box size of the vertex set is larger than the maximum bounding box size of the current sub-object, it is considered that the current sub-object can be accommodated in the terrain area formed by the vertices in the current vertex set, so the current sub-object can be arranged in the terrain area corresponding to the vertex set, and the current sub-object can be used as a sub-object to be arranged.
[0148] At the same time, the usage attributes of each vertex in the graph structure can also be updated according to each vertex in the vertex set of the current sub-object.
[0149] After determining that the current sub-object can be used as a sub-object to be arranged, the arrangement information of the current sub-object can be generated, and the next round of search can be entered to traverse the next sub-object from the object list as the new current sub-object. And in the same traversal method as above, a new vertex set of the current sub-object is generated until it is determined whether the new current sub-object can be used as a sub-object to be arranged.
[0150] If the bounding box size of the vertex set is smaller than the minimum bounding box size of the current sub-object, traverse the next sub-object.
[0151] If the bounding box size of the vertex set of the current sub-object is smaller than the minimum bounding box size of the current sub-object, it is considered that the terrain area formed by the vertices in the current vertex set is not enough to accommodate the current sub-object, so the current sub-object cannot be arranged in the terrain area corresponding to the vertex set, and the current sub-object cannot be used as a sub-object to be arranged. In this case, the next round of search is also entered, and the next sub-object is traversed from the object list as the new current sub-object. And the new vertex set of the current sub-object is generated in the same traversal method as above, until it is determined whether the new current sub-object can be used as a sub-object to be arranged.
[0152] In some embodiments, in order to ensure the accuracy of the calculated bounding box size of the vertex set, an inverse matrix can be generated based on the placement orientation information of each vertex in the vertex set, and then the placement orientation vector of the vertex set is multiplied by the inverse matrix to correct the placement orientation of the vertex set to a horizontal and vertical orientation.
[0153] In the above manner, after traversing all sub-objects in the object list, the arrangement information of all sub-objects to be arranged can be obtained.
[0154] It is worth noting that if a search for adjacent points is performed for a certain initial target vertex, and all sub-objects in the vertex set of all searched sub-objects cannot be used as an arrangeable sub-object, then the initial target vertex can be deleted from the vertex array, and the first unplaced vertex in the vertex array can be used as the new initial target vertex.
[0155] Figure 8A flowchart of another method for processing objects in a game scene provided by an embodiment of the present application; Optionally, in step S703, generating arrangement information of the current sub-object may include:
[0156] S801. Perform linear interpolation calculation according to the maximum size of the bounding box of the current sub-object and the minimum size of the bounding box of the current sub-object to obtain the target bounding box size.
[0157] Optionally, if the current sub-object can be used as a sub-object to be arranged, a linear interpolation calculation can be performed based on the maximum bounding box size of the current sub-object and the minimum bounding box size of the current sub-object to obtain a new bounding box size as the target bounding box size.
[0158] S802: Determine the placement position of the current sub-object according to the position information of each vertex contained in the target bounding box size.
[0159] The average value of the position can be calculated according to the position information of each vertex contained in the target bounding box size, and the average value is used as the placement position of the current sub-object.
[0160] S803: Determine the placement orientation of the current sub-object according to the placement orientation information of each vertex contained in the target bounding box size.
[0161] Similarly, the average normal vector can be calculated based on the normal vectors of each vertex contained in the target bounding box size, and the average normal vector is used as the normal vector of the current sub-object. The average up vector can be calculated based on the up vectors of each vertex contained in the target bounding box size, and the average up vector is used as the up vector of the current sub-object, thereby obtaining the placement orientation of the current sub-object.
[0162] S804: Determine the placement size of the current sub-object according to the target bounding box size and the bounding box size of the current sub-object.
[0163] By dividing the target bounding box size by the bounding box size of the current sub-object, the placement size of the current sub-object can be obtained.
[0164] S805: Generate arrangement information of the current sub-object according to the identifier of the current sub-object, the placement position of the current sub-object, the placement direction of the current sub-object, and the placement size of the current sub-object.
[0165] The identifier of the current sub-object may inherit the identifier in the object properties of the current sub-object, thereby generating arrangement information of the current sub-object according to the identifier of the current sub-object, the placement position of the current sub-object, the placement orientation of the current sub-object, and the placement size of the current sub-object.
[0166] Optionally, in the above steps, updating the usage attribute of each vertex in the graph structure may include: updating the usage attribute of each vertex included in the target bounding box size to: having been traversed and occupied by an object.
[0167] In some embodiments, when it is determined that a certain sub-object can be used as a sub-object to be arranged, the usage attributes of all vertices in the vertex set corresponding to the sub-object can be updated to: the vertex has been traversed and occupied by the object. In this way, when the next sub-object is traversed, these vertices will not be used to form a vertex set, thereby ensuring that each sub-object to be arranged does not cause mutual occlusion during arrangement, ensuring that the arrangement of the sub-objects is more orderly.
[0168] Fig. 9 A flowchart of another method for processing objects in a game scene provided by an embodiment of the present application; optionally, in step S101, before generating multiple target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, the method further includes:
[0169] S901. Determine the slope of each mesh vertex in the game terrain area.
[0170] The game terrain in the game scene is composed of grid data, so the complete game terrain area in the game scene can be determined, and the slope of each grid vertex in the game terrain area can be calculated.
[0171] Optionally, the function slope=dot(N,{0,1,0}) may be used to calculate the slope of each mesh vertex, where N represents the mesh vertex to be calculated.
[0172] S902, deleting mesh vertices whose slopes do not satisfy a preset condition from the game terrain area to obtain a target terrain area.
[0173] Generally speaking, for mesh vertices with slope>0 and slope<0.8, it is considered that their slopes meet the conditions and can be retained, thereby deleting mesh vertices that do not meet the conditions from the terrain mesh corresponding to the game terrain area to obtain the target terrain area. The obtained target terrain area can refer to the cliff area where rock objects need to be arranged.
[0174] Of course, in actual applications, the target terrain area can also be screened out from the entire game terrain area by manual visual inspection.
[0175] In summary, the object processing method in the game scene provided by this embodiment includes: generating multiple target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, and constructing a graph structure according to each target vertex; generating sub-objects corresponding to each source object and object properties of each sub-object according to the attribute information of each source object; generating arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object and the object properties of each sub-object; the arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area. This method selects the target terrain area where rocks need to be arranged from the terrain of the game scene, and generates a graph structure corresponding to the target terrain area by scattering points in the target terrain area based on the scattering results. In addition, by preprocessing each source object to be selected, the sub-objects corresponding to each source object can be generated, so that based on the sub-objects and the graph structure, breadth-first search and bounding box size calculation are performed to generate the arrangement information of the sub-objects that can be arranged. The arrangement information of the sub-objects that can be arranged can be used for subsequent rendering of the target terrain area to display specific terrain and landforms. Among them, the optimal placement position and placement order of the sub-objects in the target terrain area can be determined by breadth-first search, ensuring that the arrangement of the sub-objects not only meets the game design requirements but also effectively utilizes the space; and by bounding box size calculation, the reasonable placement size and orientation of the sub-objects can be determined to ensure the consistency and coordination of the placement between the sub-objects. Thereby improving the efficiency of sub-object arrangement and the authenticity of the arrangement effect.
[0176] The following describes the apparatus, device, storage medium, etc. used to execute the object processing method in the game scene provided by this application. The specific implementation process and technical effects are described above and will not be repeated below.
[0177] Fig.10 A schematic diagram of an object processing device in a game scene provided in an embodiment of the present application, wherein the functions implemented by the object processing device in the game scene correspond to the steps performed by the above method. The device can be understood as the above server, or a processor of the server, or can be understood as a component independent of the above server or processor that implements the functions of the present application under the control of the server. Optionally, the device may include: a construction module 110, a generation module 120;
[0178] A construction module 110 is used to generate a plurality of target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, and to construct a graph structure according to each target vertex, wherein the target terrain area is a terrain area to be arranged in the game scene, and the graph structure is used to indicate the connection relationship between each target vertex;
[0179] The generating module 120 is used to generate sub-objects corresponding to each source object and object properties of each sub-object according to the property information of each source object; wherein the source object is a pre-made virtual model for modifying the target terrain area, and the sub-object refers to a virtual model obtained by rotating the source object according to the preset rotation information;
[0180] The generation module 120 is used to generate arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object and the object attributes of each sub-object; the arrangement information includes: the identification of the sub-object, the placement position of the sub-object, the placement size of the sub-object and the placement orientation of the sub-object; wherein the arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area.
[0181] Optionally, the construction module 110 is specifically configured to determine at least one triangular face in the target terrain area according to the positional relationship between the mesh vertices in the target terrain area;
[0182] Determine the proportion of each triangle according to the area of each triangle and the area of the target terrain area;
[0183] According to the preset number of vertices and the ratio of each triangle, the number of target vertices to be generated on each triangle is determined;
[0184] Determine the position of the target vertex to be generated on each triangular face according to the number of target vertices to be generated on each triangular face, the position information of each mesh vertex constituting each triangular face, and the seed parameter;
[0185] A plurality of target vertices are generated in the target terrain area according to the positions of the target vertices to be generated on each triangular facet.
[0186] Optionally, the construction module 110 is specifically configured to generate point cloud data based on the spatial segmentation data structure according to each target vertex;
[0187] Determine the orientation information of each target vertex based on the point cloud data and the grid layout direction information of the target terrain area. The orientation information includes: a normal vector and an upward direction vector.
[0188] According to the preset search distance and search quantity, the point cloud data is searched, and the target vertices are connected according to the search results to generate a graph structure.
[0189] Optionally, the generating module 120 is specifically configured to determine a target object face from each object face of the source object according to a structural attribute of the source object, wherein the target object face is a face of each object face that is allowed to face the player's field of view;
[0190] Determine the splitting information of the source object according to each target object face and the available attribute of each target object face under at least one target rotation angle; the available attribute is used to indicate whether the target object face is allowed to face the player's field of view under the target rotation angle;
[0191] At least one sub-object corresponding to the source object is generated according to the splitting information of the source object, and object properties of each sub-object are generated. The object properties include: the identification of the sub-object, the size of the bounding box of the sub-object, and the rotation information of the sub-object relative to the source object.
[0192] Optionally, the generating module 120 is specifically configured to determine sub-segmentation information of the target object surface according to available attributes of the target object surface at each target rotation angle;
[0193] The splitting information of the source object is determined according to the sub-splitting information of each target object face in the source object; the splitting information includes: the identification of each target object face in the source object that is allowed to be facing the player's field of view and the available attribute identification of each target object face at each target rotation angle.
[0194] Optionally, the generating module 120 is specifically configured to determine the number of object face splits of the source object according to the identifiers of each target object face in the source object that is allowed to be facing the player's field of view;
[0195] Determine the number of splits of each target object face in the source object according to the available attribute identifiers of each target object face at each target rotation angle;
[0196] Determine the number of sub-objects corresponding to the source object according to the number of object face splits and the number of target object face splits;
[0197] According to the splitting information of the source object and the number of sub-objects corresponding to the source object, the source object is split and processed to generate sub-objects corresponding to the source object.
[0198] Optionally, the generating module 120 is specifically used to traverse each sub-object corresponding to each source object, and determine the bounding box size range of the current sub-object according to the bounding box size of the traversed current sub-object; the bounding box size range includes: a maximum bounding box size and a minimum bounding box size;
[0199] Starting from the initial target vertex of the first unplaced object in the graph structure, according to the adjacency relationship of the vertices, traverse the current adjacent point of the initial target vertex and the next adjacent point of the current adjacent point in sequence until all adjacent points are traversed, and determine the vertex set corresponding to the current sub-object according to the usage attributes of each traversed adjacent point;
[0200] According to the bounding box size range of the current sub-object and the bounding box size of the vertex set, determine whether to use the current sub-object as a sub-object to be arranged. If so, generate arrangement information of the current sub-object.
[0201] Optionally, the generating module 120 is specifically configured to determine a size range of the bounding box of the current sub-object according to the size of the bounding box of the current sub-object and a preset size scaling range.
[0202] Optionally, the generation module 120 is specifically configured to add adjacent points whose usage attributes indicate that the adjacent points have not been traversed and are not occupied by objects to the set according to the usage attributes of the traversed adjacent points, so as to obtain a vertex set corresponding to the current sub-object.
[0203] Optionally, the generating module 120 is specifically configured to determine that the current sub-object is a sub-object to be arranged if the bounding box size of the vertex set is greater than the maximum bounding box size of the current sub-object, and update the usage attributes of each vertex in the graph structure, and traverse the next sub-object;
[0204] If the bounding box size of the vertex set is smaller than the minimum bounding box size of the current sub-object, traverse the next sub-object.
[0205] Optionally, the generating module 120 is specifically configured to perform linear interpolation calculation according to the maximum size of the bounding box of the current sub-object and the minimum size of the bounding box of the current sub-object to obtain the target bounding box size;
[0206] Determine the placement of the current sub-object according to the position information of each vertex contained in the target bounding box size;
[0207] Determine the placement orientation of the current sub-object according to the placement orientation information of each vertex contained in the target bounding box size;
[0208] Determine the placement size of the current sub-object based on the target bounding box size and the bounding box size of the current sub-object;
[0209] The arrangement information of the current sub-object is generated according to the identifier of the current sub-object, the placement position of the current sub-object, the placement direction of the current sub-object, and the placement size of the current sub-object.
[0210] Optionally, the generating module 120 is specifically configured to update the usage attribute of each vertex included in the target bounding box size to: having been traversed and occupied by an object.
[0211] Optionally, it also includes a processing module;
[0212] A processing module for determining the slope of each mesh vertex in a game terrain area;
[0213] Each mesh vertex whose slope does not satisfy a preset condition is deleted from the game terrain area to obtain a target terrain area.
[0214] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0215] The above modules can be connected or communicated with each other via a wired connection or a wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may include a connection in the form of a LAN, a WAN, Bluetooth, a ZigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. Those skilled in the art will clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application.
[0216] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application includes: a processor 801, a storage medium 802 and a bus 803, wherein the storage medium 802 stores machine-readable instructions executable by the processor 801. When the electronic device runs an object processing method in a game scene in the embodiment, the processor 801 communicates with the storage medium 802 via the bus 803, and the processor 801 executes the machine-readable instructions to perform the following steps:
[0217] According to the position information of each mesh vertex in the target terrain area, a plurality of target vertices are generated in the target terrain area, and a graph structure is constructed according to each target vertex, wherein the target terrain area is a terrain area to be arranged in the game scene, and the graph structure is used to indicate the connection relationship between each target vertex;
[0218] Generate sub-objects corresponding to each source object and object attributes of each sub-object according to the attribute information of each source object; wherein the source object is a pre-made virtual model for modifying the target terrain area, and the sub-object refers to a virtual model obtained by rotating the source object according to the preset rotation information;
[0219] According to the graph structure, the sub-objects corresponding to each source object and the object properties of each sub-object, the arrangement information of at least one sub-object to be arranged is generated; the arrangement information includes: the identification of the sub-object, the placement position of the sub-object, the placement size of the sub-object and the placement orientation of the sub-object; wherein the arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area.
[0220] In a feasible implementation, when the processor 801 generates a plurality of target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, the processor 801 is specifically used to: determine at least one triangular face in the target terrain area according to the position relationship of each mesh vertex in the target terrain area;
[0221] Determine the proportion of each triangle according to the area of each triangle and the area of the target terrain area;
[0222] According to the preset number of vertices and the ratio of each triangle, the number of target vertices to be generated on each triangle is determined;
[0223] Determine the position of the target vertex to be generated on each triangular face according to the number of target vertices to be generated on each triangular face, the position information of each mesh vertex constituting each triangular face, and the seed parameter;
[0224] A plurality of target vertices are generated in the target terrain area according to the positions of the target vertices to be generated on each triangular facet.
[0225] In a feasible implementation, when executing the construction of the graph structure according to each target vertex, the processor 801 is specifically used to: generate point cloud data according to each target vertex based on the space segmentation data structure;
[0226] Determine the orientation information of each target vertex based on the point cloud data and the grid layout direction information of the target terrain area. The orientation information includes: a normal vector and an upward direction vector.
[0227] According to the preset search distance and search quantity, the point cloud data is searched, and the target vertices are connected according to the search results to generate a graph structure.
[0228] In a feasible implementation, when the processor 801 generates the sub-objects corresponding to each source object and the object attributes of each sub-object according to the attribute information of each source object, it is specifically used to: determine the target object surface from each object surface of the source object according to the structural attributes of the source object, and the target object surface is the surface of each object surface that is allowed to be facing the player's field of view;
[0229] Determine the splitting information of the source object according to each target object face and the available attribute of each target object face under at least one target rotation angle; the available attribute is used to indicate whether the target object face is allowed to face the player's field of view under the target rotation angle;
[0230] At least one sub-object corresponding to the source object is generated according to the splitting information of the source object, and object properties of each sub-object are generated. The object properties include: the identification of the sub-object, the size of the bounding box of the sub-object, and the rotation information of the sub-object relative to the source object.
[0231] In a feasible implementation, when the processor 801 determines the splitting information of the source object according to each target object face and the available attributes of each target object face at at least one target rotation angle, it is specifically used to: determine the sub-splitting information of the target object face according to the available attributes of the target object face at each target rotation angle;
[0232] The splitting information of the source object is determined according to the sub-splitting information of each target object face in the source object; the splitting information includes: the identification of each target object face in the source object that is allowed to be facing the player's field of view and the available attribute identification of each target object face at each target rotation angle.
[0233] In a feasible implementation, when the processor 801 generates at least one sub-object corresponding to the source object according to the splitting information of the source object, it is specifically used to: determine the number of object face splits of the source object according to the identifiers of each target object face allowed to be facing the player's field of view in the source object;
[0234] Determine the number of splits of each target object face in the source object according to the available attribute identifiers of each target object face at each target rotation angle;
[0235] Determine the number of sub-objects corresponding to the source object according to the number of object face splits and the number of target object face splits;
[0236] According to the splitting information of the source object and the number of sub-objects corresponding to the source object, the source object is split and processed to generate sub-objects corresponding to the source object.
[0237] In a feasible implementation scheme, when the processor 801 generates arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object, and the object attributes of each sub-object, it is specifically used to: traverse each sub-object corresponding to each source object, and determine the size range of the bounding box of the current sub-object according to the bounding box size of the traversed current sub-object; the bounding box size range includes: the maximum size of the bounding box and the minimum size of the bounding box;
[0238] Starting from the initial target vertex of the first unplaced object in the graph structure, according to the adjacency relationship of the vertices, traverse the current adjacent point of the initial target vertex and the next adjacent point of the current adjacent point in sequence until all adjacent points are traversed, and determine the vertex set corresponding to the current sub-object according to the usage attributes of each traversed adjacent point;
[0239] According to the bounding box size range of the current sub-object and the bounding box size of the vertex set, determine whether to use the current sub-object as a sub-object to be arranged. If so, generate arrangement information of the current sub-object.
[0240] In a feasible implementation scheme, when the processor 801 determines the size range of the bounding box of the current sub-object based on the bounding box size of the traversed current sub-object, it is specifically used to: determine the size range of the bounding box of the current sub-object based on the bounding box size of the current sub-object and a preset size scaling range.
[0241] In a feasible implementation scheme, when the processor 801 determines the vertex set corresponding to the current sub-object based on the usage attributes of each traversed adjacent point, it is specifically used to: based on the usage attributes of each traversed adjacent point, add each adjacent point whose usage attributes indicate that the adjacent point has not been traversed and is not occupied by the object to the set, so as to obtain the vertex set corresponding to the current sub-object.
[0242] In a feasible implementation, when the processor 801 determines whether to use the current sub-object as a sub-object to be arranged according to the bounding box size range of the current sub-object and the bounding box size of the vertex set, it is specifically used to: if the bounding box size of the vertex set is greater than the maximum bounding box size of the current sub-object, determine to use the current sub-object as a sub-object to be arranged, update the usage attributes of each vertex in the graph structure, and traverse the next sub-object;
[0243] If the bounding box size of the vertex set is smaller than the minimum bounding box size of the current sub-object, traverse the next sub-object.
[0244] In a feasible implementation, when the processor 801 generates the arrangement information of the current sub-object, it is specifically used to: perform linear interpolation calculation according to the maximum size of the bounding box of the current sub-object and the minimum size of the bounding box of the current sub-object to obtain the target bounding box size;
[0245] Determine the placement of the current sub-object according to the position information of each vertex contained in the target bounding box size;
[0246] Determine the placement orientation of the current sub-object according to the placement orientation information of each vertex contained in the target bounding box size;
[0247] Determine the placement size of the current sub-object based on the target bounding box size and the bounding box size of the current sub-object;
[0248] The arrangement information of the current sub-object is generated according to the identifier of the current sub-object, the placement position of the current sub-object, the placement direction of the current sub-object, and the placement size of the current sub-object.
[0249] In a feasible implementation, when executing the update of the usage attribute of each vertex in the graph structure, the processor 801 is specifically used to: update the usage attribute of each vertex included in the target bounding box size to: having been traversed and occupied by an object.
[0250] In a feasible implementation, before executing the process of generating a plurality of target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, the processor 801 is further configured to: determine the slope of each mesh vertex in the game terrain area;
[0251] Each mesh vertex whose slope does not satisfy a preset condition is deleted from the game terrain area to obtain a target terrain area.
[0252] Among them, the storage medium 802 stores program code, and when the program code is executed by the processor 801, the processor 801 executes various steps of the object processing method in the game scene according to various exemplary embodiments of the present application described in the above "Exemplary Method" section of this specification.
[0253] Processor 801 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware processor to be executed, or a combination of hardware and software modules in the processor can be executed.
[0254] Storage medium 802, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), programmable read-only memory (Programmable Read Only Memory, PROM), read-only memory (Read Only Memory, ROM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), magnetic memory, disk, optical disk, etc. The memory is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The storage medium 802 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0255] Optionally, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor performs the following steps:
[0256] According to the position information of each mesh vertex in the target terrain area, a plurality of target vertices are generated in the target terrain area, and a graph structure is constructed according to each target vertex, wherein the target terrain area is a terrain area to be arranged in the game scene, and the graph structure is used to indicate the connection relationship between each target vertex;
[0257] Generate sub-objects corresponding to each source object and object attributes of each sub-object according to the attribute information of each source object; wherein the source object is a pre-made virtual model for modifying the target terrain area, and the sub-object refers to a virtual model obtained by rotating the source object according to the preset rotation information;
[0258] According to the graph structure, the sub-objects corresponding to each source object and the object properties of each sub-object, the arrangement information of at least one sub-object to be arranged is generated; the arrangement information includes: the identification of the sub-object, the placement position of the sub-object, the placement size of the sub-object and the placement orientation of the sub-object; wherein the arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area.
[0259] In a feasible implementation, when the processor 801 generates a plurality of target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, the processor 801 is specifically used to: determine at least one triangular face in the target terrain area according to the position relationship of each mesh vertex in the target terrain area;
[0260] Determine the proportion of each triangle according to the area of each triangle and the area of the target terrain area;
[0261] According to the preset number of vertices and the ratio of each triangle, the number of target vertices to be generated on each triangle is determined;
[0262] Determine the position of the target vertex to be generated on each triangular face according to the number of target vertices to be generated on each triangular face, the position information of each mesh vertex constituting each triangular face, and the seed parameter;
[0263] A plurality of target vertices are generated in the target terrain area according to the positions of the target vertices to be generated on each triangular facet.
[0264] In a feasible implementation, when executing the construction of the graph structure according to each target vertex, the processor 801 is specifically used to: generate point cloud data according to each target vertex based on the space segmentation data structure;
[0265] Determine the orientation information of each target vertex based on the point cloud data and the grid layout direction information of the target terrain area. The orientation information includes: a normal vector and an upward direction vector.
[0266] According to the preset search distance and search quantity, the point cloud data is searched, and the target vertices are connected according to the search results to generate a graph structure.
[0267] In a feasible implementation, when the processor 801 generates the sub-objects corresponding to each source object and the object attributes of each sub-object according to the attribute information of each source object, it is specifically used to: determine the target object surface from each object surface of the source object according to the structural attributes of the source object, and the target object surface is the surface of each object surface that is allowed to be facing the player's field of view;
[0268] Determine the splitting information of the source object according to each target object face and the available attribute of each target object face under at least one target rotation angle; the available attribute is used to indicate whether the target object face is allowed to face the player's field of view under the target rotation angle;
[0269] At least one sub-object corresponding to the source object is generated according to the splitting information of the source object, and object properties of each sub-object are generated. The object properties include: the identification of the sub-object, the size of the bounding box of the sub-object, and the rotation information of the sub-object relative to the source object.
[0270] In a feasible implementation, when the processor 801 determines the splitting information of the source object according to each target object face and the available attributes of each target object face at at least one target rotation angle, it is specifically used to: determine the sub-splitting information of the target object face according to the available attributes of the target object face at each target rotation angle;
[0271] The splitting information of the source object is determined according to the sub-splitting information of each target object face in the source object; the splitting information includes: the identification of each target object face in the source object that is allowed to be facing the player's field of view and the available attribute identification of each target object face at each target rotation angle.
[0272] In a feasible implementation, when the processor 801 generates at least one sub-object corresponding to the source object according to the splitting information of the source object, it is specifically used to: determine the number of object face splits of the source object according to the identifiers of each target object face allowed to be facing the player's field of view in the source object;
[0273] Determine the number of splits of each target object face in the source object according to the available attribute identifiers of each target object face at each target rotation angle;
[0274] Determine the number of sub-objects corresponding to the source object according to the number of object face splits and the number of target object face splits;
[0275] According to the splitting information of the source object and the number of sub-objects corresponding to the source object, the source object is split and processed to generate sub-objects corresponding to the source object.
[0276] In a feasible implementation scheme, when the processor 801 generates arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object, and the object attributes of each sub-object, it is specifically used to: traverse each sub-object corresponding to each source object, and determine the size range of the bounding box of the current sub-object according to the bounding box size of the traversed current sub-object; the bounding box size range includes: the maximum size of the bounding box and the minimum size of the bounding box;
[0277] Starting from the initial target vertex of the first unplaced object in the graph structure, according to the adjacency relationship of the vertices, traverse the current adjacent point of the initial target vertex and the next adjacent point of the current adjacent point in sequence until all adjacent points are traversed, and determine the vertex set corresponding to the current sub-object according to the usage attributes of each traversed adjacent point;
[0278] According to the bounding box size range of the current sub-object and the bounding box size of the vertex set, determine whether to use the current sub-object as a sub-object to be arranged. If so, generate arrangement information of the current sub-object.
[0279] In a feasible implementation scheme, when the processor 801 determines the size range of the bounding box of the current sub-object based on the bounding box size of the traversed current sub-object, it is specifically used to: determine the size range of the bounding box of the current sub-object based on the bounding box size of the current sub-object and a preset size scaling range.
[0280] In a feasible implementation scheme, when the processor 801 determines the vertex set corresponding to the current sub-object based on the usage attributes of each traversed adjacent point, it is specifically used to: based on the usage attributes of each traversed adjacent point, add each adjacent point whose usage attributes indicate that the adjacent point has not been traversed and is not occupied by the object to the set, so as to obtain the vertex set corresponding to the current sub-object.
[0281] In a feasible implementation, when the processor 801 determines whether to use the current sub-object as a sub-object to be arranged according to the bounding box size range of the current sub-object and the bounding box size of the vertex set, it is specifically used to: if the bounding box size of the vertex set is greater than the maximum bounding box size of the current sub-object, determine to use the current sub-object as a sub-object to be arranged, update the usage attributes of each vertex in the graph structure, and traverse the next sub-object;
[0282] If the bounding box size of the vertex set is smaller than the minimum bounding box size of the current sub-object, traverse the next sub-object.
[0283] In a feasible implementation, when the processor 801 generates the arrangement information of the current sub-object, it is specifically used to: perform linear interpolation calculation according to the maximum size of the bounding box of the current sub-object and the minimum size of the bounding box of the current sub-object to obtain the target bounding box size;
[0284] Determine the placement of the current sub-object according to the position information of each vertex contained in the target bounding box size;
[0285] Determine the placement orientation of the current sub-object according to the placement orientation information of each vertex contained in the target bounding box size;
[0286] Determine the placement size of the current sub-object based on the target bounding box size and the bounding box size of the current sub-object;
[0287] The arrangement information of the current sub-object is generated according to the identifier of the current sub-object, the placement position of the current sub-object, the placement direction of the current sub-object, and the placement size of the current sub-object.
[0288] In a feasible implementation, when executing the update of the usage attribute of each vertex in the graph structure, the processor 801 is specifically used to: update the usage attribute of each vertex included in the target bounding box size to: having been traversed and occupied by an object.
[0289] In a feasible implementation, before the processor 801 generates a plurality of target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, it is further used to: determine the slope of each mesh vertex in the game terrain area;
[0290] Each mesh vertex whose slope does not satisfy a preset condition is deleted from the game terrain area to obtain a target terrain area.
[0291] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0292] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0293] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0294] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
Claims
1. A method for processing objects in a game scene, characterized in that: include: According to the position information of each mesh vertex in the target terrain area, a plurality of target vertices are generated in the target terrain area, and a graph structure is constructed according to each target vertex, wherein the target terrain area is a terrain area to be arranged in the game scene, and the graph structure is used to indicate the connection relationship between each target vertex; Generate sub-objects corresponding to each source object and object attributes of each sub-object according to attribute information of each source object, wherein the source object is a pre-made virtual model for modifying the target terrain area, and the sub-object refers to a virtual model obtained by rotating the source object according to preset rotation information; According to the graph structure, the sub-objects corresponding to each source object and the object properties of each sub-object, arrangement information of at least one sub-object to be arranged is generated; the arrangement information includes: the identification of the sub-object, the placement position of the sub-object, the placement size of the sub-object and the placement orientation of the sub-object; wherein the arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area.
2. The method according to claim 1, characterized in that Generating a plurality of target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area comprises: Determine at least one triangular face in the target terrain area according to the positional relationship of each mesh vertices in the target terrain area; Determining the proportion of each triangular facet according to the area of each triangular facet and the area of the target terrain area; According to the preset number of vertices and the ratio of each triangle, the number of target vertices to be generated on each triangle is determined; Determine the position of the target vertex to be generated on each triangular face according to the number of target vertices to be generated on each triangular face, the position information of each mesh vertex constituting each triangular face, and the seed parameter; According to the positions of the target vertices to be generated on each triangular facet, a plurality of target vertices are generated in the target terrain area.
3. The method according to claim 1, characterized in that The step of constructing a graph structure according to each target vertex includes: According to each target vertex, point cloud data is generated based on the spatial segmentation data structure; Determine placement orientation information of each target vertex according to the point cloud data and the grid layout orientation information of the target terrain area, wherein the placement orientation information includes: a normal vector and an upward direction vector; The point cloud data is searched according to a preset search distance and search quantity, and the target vertices are connected according to the search results to generate the graph structure.
4. The method according to claim 1, characterized in that: The step of generating sub-objects corresponding to each source object and object attributes of each sub-object according to the attribute information of each source object includes: According to the structural attribute of the source object, a target object face is determined from each object face of the source object, wherein the target object face is a face of each object face that is allowed to be facing the player's field of view; Determine the splitting information of the source object according to each target object face and an available attribute of each target object face under at least one target rotation angle; the available attribute is used to indicate whether the target object face is allowed to face the player's field of view under the target rotation angle; At least one sub-object corresponding to the source object is generated according to the splitting information of the source object, and object properties of each sub-object are generated, wherein the object properties include: an identifier of the sub-object, a bounding box size of the sub-object, and rotation information of the sub-object relative to the source object.
5. The method according to claim 4, characterized in that The determining the splitting information of the source object according to each target object face and the available attributes of each target object face under at least one target rotation angle includes: Determining sub-splitting information of the target object surface according to available attributes of the target object surface at each target rotation angle; The splitting information of the source object is determined according to the sub-splitting information of each target object face in the source object; the splitting information includes: the identification of each target object face in the source object that is allowed to be facing the player's field of view and the available attribute identification of each target object face at each target rotation angle.
6. The method according to claim 5, characterized in that The step of generating at least one sub-object corresponding to the source object according to the splitting information of the source object includes: Determine the number of object face splits of the source object according to the identifiers of each target object face allowed to be facing the player's field of view in the source object; Determining the number of splits of each target object face in the source object according to available attribute identifiers of each target object face at each target rotation angle; Determining the number of sub-objects corresponding to the source object according to the number of splits of the object surface and the number of splits of each target object surface; The source object is split according to the split information of the source object and the number of sub-objects corresponding to the source object to generate sub-objects corresponding to the source object.
7. The method according to claim 1, characterized in that The generating arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object, and the object attributes of each sub-object includes: Traversing each sub-object corresponding to each source object, and determining a bounding box size range of the current sub-object according to the bounding box size of the traversed current sub-object; the bounding box size range includes: a maximum bounding box size and a minimum bounding box size; Starting from the first initial target vertex in the graph structure where no object is currently placed, according to the adjacency relationship of the vertices, traverse the current adjacent point of the initial target vertex and the next adjacent point of the current adjacent point in sequence until all adjacent points are traversed, and determine the vertex set corresponding to the current sub-object according to the usage attributes of each traversed adjacent point; According to the size range of the bounding box of the current sub-object and the size of the bounding box of the vertex set, it is determined whether to use the current sub-object as a sub-object to be arranged, and if so, arrangement information of the current sub-object is generated.
8. The method according to claim 7, characterized in that The step of determining the size range of the bounding box of the current sub-object according to the traversed bounding box size of the current sub-object includes: The size range of the bounding box of the current sub-object is determined according to the size of the bounding box of the current sub-object and a preset size scaling range.
9. The method according to claim 7, characterized in that: Determining the vertex set corresponding to the current sub-object according to the usage attributes of each traversed adjacent point includes: According to the usage attribute of each traversed adjacent point, each adjacent point whose usage attribute indicates that the adjacent point has not been traversed and is not occupied by an object is added to the set to obtain a vertex set corresponding to the current sub-object.
10. The method according to claim 7, characterized in that The determining whether to use the current sub-object as a sub-object to be arranged according to the bounding box size range of the current sub-object and the bounding box size of the vertex set includes: If the bounding box size of the vertex set is larger than the maximum bounding box size of the current sub-object, determine to use the current sub-object as a sub-object to be arranged, update the usage attributes of each vertex in the graph structure, and traverse the next sub-object; If the bounding box size of the vertex set is smaller than the minimum bounding box size of the current sub-object, traverse the next sub-object.
11. The method according to claim 10, characterized in that The generating arrangement information of the current sub-object includes: Perform linear interpolation calculation according to the maximum size of the bounding box of the current sub-object and the minimum size of the bounding box of the current sub-object to obtain the target bounding box size; Determining the placement position of the current sub-object according to the position information of each vertex contained in the target bounding box size; Determining the placement orientation of the current sub-object according to the placement orientation information of each vertex contained in the target bounding box size; Determine the placement size of the current sub-object according to the target bounding box size and the bounding box size of the current sub-object; Arrangement information of the current sub-object is generated according to the identifier of the current sub-object, the placement position of the current sub-object, the placement orientation of the current sub-object, and the placement size of the current sub-object.
12. The method according to claim 11, characterized in that The updating of the usage attribute of each vertex in the graph structure includes: The usage attribute of each vertex included in the target bounding box size is updated to: having been traversed and occupied by an object.
13. The method according to claim 1, characterized in that Before generating a plurality of target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, the method further comprises: Determine the slope of each mesh vertex in the game terrain area; Each mesh vertex whose slope does not satisfy a preset condition is deleted from the game terrain area to obtain the target terrain area.
14. An object processing device in a game scene, characterized in that: include: Building modules, generating modules; The construction module is used to generate multiple target vertices in the target terrain area according to the position information of each mesh vertex in the target terrain area, and to construct a graph structure according to each target vertex, wherein the target terrain area is a terrain area to be arranged in the game scene, and the graph structure is used to indicate the connection relationship between each target vertex; The generating module is used to generate sub-objects corresponding to each source object and object properties of each sub-object according to the property information of each source object; wherein the source object is a pre-made virtual model for modifying the target terrain area, and the sub-object refers to a virtual model obtained by rotating the source object according to preset rotation information; The generation module is used to generate arrangement information of at least one sub-object to be arranged according to the graph structure, the sub-objects corresponding to each source object and the object attributes of each sub-object; the arrangement information includes: the identification of the sub-object, the placement position of the sub-object, the placement size of the sub-object and the placement orientation of the sub-object; wherein the arrangement information of each sub-object to be arranged is used to render and display each sub-object to be arranged in the target terrain area according to the arrangement information when rendering the target terrain area.
15. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor and the storage medium communicate via the bus, and the processor executes the program instructions to execute the object processing method in the game scene as described in any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the object processing method in the game scene according to any one of claims 1 to 13 is executed.