A virtual scene generation method and device
By determining the target terrain and generation strategies, the virtual scenes are automatically generated, which solves the problem of time-consuming and labor-consuming manually setting virtual scenes in the prior art, and improves the generation efficiency and scene richness.
Patent Information
- Application Number
- CN202211319584.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-10-26
AI Technical Summary
In the prior art, generating virtual scenes that are not related to game logic requires a lot of manual settings, resulting in wasted time and labor costs.
By determining the target terrain and virtual scene generation strategy, the initial virtual scene is generated based on the virtual scene configuration information, the area information is adjusted and the virtual object model is added, the placement point is determined in combination with the preset terrain conditions, and the target virtual scene is automatically generated.
The automatic generation of virtual scenes is realized, which avoids the waste of time and manpower caused by manual settings, and improves the generation efficiency and the richness of the scene.
Smart Images

Figure CN115531883B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more particularly to a method for generating a virtual scene. The present application also relates to a virtual scene generating apparatus, a computing device, and a computer-readable storage medium. Background Art
[0002] With the development of Internet technology, the virtual scenes encountered in games have gradually diversified. Virtual scenes related to the main storyline or logical gameplay of the game are generally set up by developers based on specific game terrain and logical gameplay. Most games generally have some virtual scenes that are not related to logical gameplay, further enriching the richness of the game and the player experience.
[0003] However, if developers still have to manually set up these virtual scenes that are not related to the logical gameplay one by one, it will inevitably take up a lot of time and manpower costs. Therefore, it is of great significance to automatically generate virtual scenes and avoid wasting time and manpower costs. Summary of the Invention
[0004] In view of this, the embodiments of the present application provide a virtual scene generation method to solve the technical defects existing in the prior art. The embodiments of the present application also provide a virtual scene generation device, a computing device, and a computer-readable storage medium.
[0005] According to a first aspect of an embodiment of the present application, a method for generating a virtual scene is provided, comprising:
[0006] Determining a target terrain and a virtual scene generation strategy corresponding to the target terrain, wherein the virtual scene generation strategy includes virtual scene configuration information;
[0007] Determining area information of an initial virtual scene and a virtual object model corresponding to the initial virtual scene according to the virtual scene configuration information;
[0008] Adjusting the initial virtual scene according to the area information, and adding the virtual object model to the adjusted initial virtual scene to generate a candidate virtual scene;
[0009] A virtual scene placement point is determined in the target terrain according to preset terrain conditions, and a target virtual scene is generated according to the virtual scene placement point and the candidate virtual scenes.
[0010] According to a second aspect of an embodiment of the present application, a virtual scene generating device is provided, comprising:
[0011] A first determining device is configured to determine a target terrain and a virtual scene generation strategy corresponding to the target terrain, wherein the virtual scene generation strategy includes virtual scene configuration information;
[0012] a second determining device configured to determine area information of an initial virtual scene and a virtual object model corresponding to the initial virtual scene according to the virtual scene configuration information;
[0013] a first generating device configured to adjust the initial virtual scene according to the area information, and add the virtual object model to the adjusted initial virtual scene to generate a candidate virtual scene;
[0014] The second generating device is configured to determine a virtual scene placement point in the target terrain according to a preset terrain condition, and generate a target virtual scene according to the virtual scene placement point and the candidate virtual scene.
[0015] According to a third aspect of an embodiment of the present application, a computing device is provided, including:
[0016] memory and processor;
[0017] The memory is used to store computer-executable instructions, and the processor implements the steps of the virtual scene generation method when executing the computer-executable instructions.
[0018] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the virtual scene generation method are implemented.
[0019] According to a fifth aspect of the embodiments of the present application, a chip is provided, which stores a computer program, and when the computer program is executed by the chip, the steps of the virtual scene generation method are implemented.
[0020] The virtual scene generation method provided in the present application includes determining a target terrain and a virtual scene generation strategy corresponding to the target terrain, wherein the virtual scene generation strategy includes virtual scene configuration information; determining area information of an initial virtual scene and a virtual object model corresponding to the initial virtual scene based on the virtual scene configuration information; adjusting the initial virtual scene based on the area information, and adding the virtual object model to the adjusted initial virtual scene to generate a candidate virtual scene; determining a virtual scene placement point in the target terrain based on preset terrain conditions, and generating a target virtual scene based on the virtual scene placement point and the candidate virtual scene.
[0021] Specifically, by determining the virtual scene generation strategy corresponding to the target terrain, and then determining the area information corresponding to the initial virtual scene and the virtual object model based on the virtual scene configuration information in the virtual scene generation strategy to generate a candidate virtual scene, and then generating the target virtual scene based on the preset terrain conditions and the determined virtual scene placement points, the automatic generation of the virtual scene is realized, avoiding the waste of time and manpower caused by manual generation of the virtual scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a scene diagram of a virtual scene generation method provided by an embodiment of the present application;
[0023] Figure 2 This is a flowchart of a virtual scene generation method provided by an embodiment of the present application;
[0024] Figure 3 This is a processing flow chart of a virtual game camp generation method in a virtual scene generation method provided in one embodiment of the present application;
[0025] Figure 4 This is an application diagram of removing a mask layer in a virtual scene generation method provided by an embodiment of the present application;
[0026] Figure 5 1 is a schematic diagram of a target virtual game camp in a virtual scene generation method provided in one embodiment of the present application;
[0027] Figure 6 This is a structural diagram of a virtual scene generation device provided by an embodiment of the present application;
[0028] Figure 7 This is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0029] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.
[0030] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0031] It should be understood that although the terms "first," "second," and the like may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, "first" may also be referred to as "second," and similarly, "second" may also be referred to as "first," without departing from the scope of one or more embodiments of the present application.
[0032] First, the terms involved in one or more embodiments of the present invention are explained.
[0033] Baking: This is a pre-calculation process that speeds up subsequent steps. Depending on the options selected, rendering from scratch can take a significant amount of time. Therefore, it allows you to "bake" parts of the rendering for selected objects in advance. Then, when you hit render, the entire scene will render much faster because the colors of these objects don't need to be recalculated.
[0034] This application provides a virtual scene generation method, a virtual scene generation apparatus, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments.
[0035] Figure 1 A scene diagram of a virtual scene generation method provided according to an embodiment of the present application is shown. Specifically, the following steps are included:
[0036] Among them, virtual scenes can be understood as fictional digital scenes, such as military bases, castles, villages, camps, etc. in games.
[0037] Specifically, a virtual scene generation method provided in an embodiment of this specification is taken as an example to generate a virtual scene of a game camp for detailed introduction.
[0038] Terminal 102 sends a virtual campsite generation instruction to server 104. Server 104 determines, based on the plain terrain and virtual scene configuration information in the virtual campsite generation strategy corresponding to the plain terrain carried in the virtual campsite generation instruction, that three tents and two trees are virtual props to be generated in the virtual campsite. The server also determines that the initial virtual campsite is a 200-square-meter circular campsite. Based on the 200-square-meter circular campsite, the server adjusts the generation style of the initial virtual campsite to generate an irregularly shaped initial virtual campsite to better fit the plain terrain. Virtual prop models are then added to the adjusted initial virtual campsite according to preset model addition rules. Collision bodies are added to the virtual prop models to prevent overlap between models. The server then bakes the initial virtual campsite with the added virtual prop models to generate candidate virtual campsites. Furthermore, based on preset terrain conditions, a location near a stream in the plain terrain is selected as the virtual campsite placement point. A target virtual campsite is generated based on the virtual campsite placement point and the candidate virtual campsites. Finally, the target virtual campsite is returned to terminal 102, completing the automatic generation of the virtual campsite.
[0039] This application determines a virtual scene generation strategy corresponding to the target terrain, and then determines the area information corresponding to the initial virtual scene and the virtual object model to generate a candidate virtual scene based on the virtual scene configuration information in the virtual scene generation strategy, and then generates the target virtual scene based on the preset terrain conditions and the determined virtual scene placement points, thereby realizing the automatic generation of virtual scenes and avoiding the waste of time and manpower caused by manual generation of virtual scenes.
[0040] See also Figure 2 , Figure 2 A flowchart of a virtual scene generation method according to an embodiment of the present application is provided, which specifically includes the following steps:
[0041] Step S202: determining a target terrain and a virtual scene generation strategy corresponding to the target terrain, wherein the virtual scene generation strategy includes virtual scene configuration information.
[0042] The target terrain can be understood as the scene terrain in the game, such as hills, plains, deserts and other terrains.
[0043] The virtual scene generation strategy can be understood as a virtual scene generation method pre-configured for the current target terrain; for example, a large virtual scene with a certain number of tents and stables, two medium-sized virtual scenes with a certain number of trees and campfires, and three small virtual scenes with a certain number of bushes and torches are generated in the target terrain. The virtual scene configuration information can be understood as configuration information in the generated virtual scene, which includes configuration information such as the scene parameters of the virtual scene, the area calculation parameters of the virtual scene determined according to the scene parameters of the virtual scene, and virtual object configuration information; wherein the scene parameters of the virtual scene may include the number of virtual scenes generated, the size of the generated virtual scene, the display form of the virtual scene, and other scene parameters. For example, the scene parameters of the virtual scene may be to generate 2 large virtual scenes with a radius of 2000, 3 medium virtual scenes with a side length of 800, and 5 small virtual scenes with a length of 500 and a width of 300 in the target, the large virtual scene is displayed as a circular virtual scene, the medium virtual scene is displayed as a square virtual scene, and the small virtual scene is displayed as a rectangular virtual scene, etc.; the area calculation parameters can be understood as the basic parameters required for calculating the area, for example, the radius basic parameters are required to calculate the area of a circle, and the side length basic parameters are required to calculate the area of a square. The virtual object configuration information in the virtual scene configuration information can be set according to actual application, and the embodiments of this specification do not impose any restrictions on this.
[0044] Moreover, a target terrain may correspond to multiple virtual scene generation strategies. The virtual scenes generated by the same target terrain using different virtual scene generation strategies may also be different. The number of virtual scene generation strategies corresponding to the target terrain may be set according to actual applications, and this specification does not make any specific restrictions here.
[0045] Specifically, determining the target terrain and the virtual scene generation strategy corresponding to the target terrain can be understood as determining the virtual scene generation strategy corresponding to the target terrain based on the preset correspondence between the target terrain and the virtual scene generation strategy, and then generating the virtual scene according to the virtual scene configuration information in the virtual scene generation strategy. Before determining the target terrain and the virtual scene generation strategy corresponding to the target terrain, it is necessary to receive a virtual scene generation instruction and then start generating the virtual scene. The target terrain and the virtual scene generation strategy corresponding to the target terrain are quickly determined by using the terrain information and strategy identifier carried in the generation instruction. The specific implementation method is as follows:
[0046] Before determining the target terrain and the virtual scene generation strategy corresponding to the target terrain, the method further includes:
[0047] receiving a virtual scene generation instruction, wherein the virtual scene generation instruction includes terrain information of the target terrain and a strategy identifier of a virtual scene generation strategy corresponding to the target terrain;
[0048] Accordingly, the determination of the target terrain and the virtual scene generation strategy corresponding to the target terrain include:
[0049] The target terrain is determined according to the terrain information, and a virtual scene generation strategy corresponding to the target terrain is determined according to the strategy identifier.
[0050] The virtual scene generation instruction may be understood as an instruction for causing the server to start performing a virtual scene generation operation.
[0051] Terrain information can be understood as information about the terrain of the scene in the game, such as: terrain location information, terrain identification information and other information.
[0052] The strategy identifier can be understood as an identifier carried in each virtual scene generation strategy for uniquely identifying the strategy, which can be a character number, ID number, or other identifier.
[0053] Specifically, a virtual scene generation instruction is received, and the terrain in which the virtual scene is to be generated is determined based on the terrain identification information in the terrain information carried in the generation instruction. This terrain is determined as the target terrain, and then the virtual scene generation strategy corresponding to the target terrain is determined based on the correspondence between the target terrain and the strategy identifier.
[0054] In one embodiment, based on the terrain identifier a and its corresponding virtual scene generation strategy b carried in the virtual scene generation instruction, it is determined that the terrain a will generate a virtual scene according to the virtual scene configuration information in the virtual scene generation strategy b.
[0055] In an embodiment of the present application, by receiving a virtual scene generation instruction, the terrain in which the virtual scene needs to be generated and the generation strategy of the virtual scene are determined based on the terrain information carried in the virtual scene generation instruction and the strategy identifier of the virtual scene generation strategy, so as to speed up the generation efficiency of subsequent virtual scenes.
[0056] Step S204: determining the area information of the initial virtual scene and the virtual object model corresponding to the initial virtual scene according to the virtual scene configuration information.
[0057] The area information may be understood as information determined by performing area calculation according to area calculation parameters. For example, when the area calculation parameter is a side length of 200, the area information is 40,000.
[0058] The virtual object model can be understood as a model of a virtual object to be added to a virtual scene, determined based on the virtual object configuration information. For example, the virtual object configuration information may include configuration information such as three horse stables, one straw house, and five trees, and the virtual object model may be determined to be three horse stable models, one straw house model, and five tree models. The virtual object configuration information can be configured based on actual applications and is not limited in this embodiment of the present specification.
[0059] Specifically, when determining the area information of the virtual scene and the virtual object model, it is necessary to accurately determine them based on the virtual scene configuration information to facilitate the subsequent placement of the virtual scene and the virtual object model in the target terrain. The specific implementation method is as follows:
[0060] The virtual scene configuration information includes scene parameters of the virtual scene, area calculation parameters of the virtual scene determined according to the scene parameters of the virtual scene, and virtual object configuration information corresponding to the virtual scene;
[0061] Accordingly, determining the area information of the initial virtual scene and the virtual object model corresponding to the initial virtual scene according to the virtual scene configuration information includes:
[0062] Determining area information of an initial virtual scene according to scene parameters of the virtual scene and area calculation parameters of the virtual scene;
[0063] A virtual object model corresponding to the initial virtual scene is determined according to the virtual object configuration information corresponding to the virtual scene.
[0064] Among them, the area calculation parameters can be understood as basic parameters for determining the area information of the virtual scene, such as radius, side length, etc.
[0065] Specifically, determining the area information of the virtual scene based on the scene parameters of the virtual scene and the area calculation parameters of the virtual scene can be understood as: determining the area information of a corresponding number of virtual scenes based on the number of virtual scenes preset in the scene parameters of the virtual scene and the area basic parameters of the corresponding number of virtual scenes.
[0066] In one embodiment, the scene parameters are to generate one large virtual scene and two medium virtual scenes, and the corresponding area calculation parameters are: the side length of the large virtual scene a is 2000 meters, the side length of the medium virtual scene b is 400 meters, and the length and width of the medium virtual scene c are 400 meters and 200 meters, then the calculated area information of the virtual scene a is 4,000,000 square meters, the area information of the virtual scene b is 160,000 square meters, and the area information of the virtual scene c is 8,000 square meters.
[0067] The embodiments of this specification use the scene parameters of the virtual scene in the pre-set virtual scene configuration to quickly determine and calculate the basic data of the virtual scene area information and the virtual object model, thereby further accelerating the generation rate of the virtual scene.
[0068] In addition, the generated virtual scene can not only calculate the area of the virtual scene rectangle based on the side length information, but also determine the area of the virtual scene's center circle based on the virtual scene's radius information. By diversifying the set area calculation parameters, the generated initial virtual scene style is richer, which can further improve the user experience. The specific implementation method is as follows:
[0069] The determining the area information of the initial virtual scene according to the scene parameters of the virtual scene and the area calculation parameters of the virtual scene includes:
[0070] The area information of the initial virtual scene is determined according to the scene parameters of the virtual scene and the center circle radius information of the virtual scene.
[0071] In another embodiment, when the scene parameters of the virtual scene are to generate one large virtual scene and its corresponding center circle radius information is 2000 meters, the area information of the initial virtual scene is determined to be 12,560,000 square meters.
[0072] Specifically, determining the virtual object model corresponding to the initial virtual scene according to the virtual object configuration information corresponding to the virtual scene can be understood as: determining the type of virtual object model placed in the initial virtual scene according to the virtual object configuration information corresponding to the virtual scene.
[0073] The embodiments of this specification can quickly determine the area information of the virtual scene and the virtual object model by pre-setting the basic data for determining the virtual scene area information and the virtual object model, providing a basis for subsequent adjustment of the initial virtual scene generation style and addition of virtual object models, further accelerating the generation rate of the virtual scene.
[0074] Step S206: adjusting the initial virtual scene according to the area information, and adding the virtual object model to the adjusted initial virtual scene to generate a candidate virtual scene.
[0075] Specifically, the initial virtual scene is adjusted according to the area information, and the virtual object model is added to the adjusted initial virtual scene. Generating a candidate virtual scene can be understood as: adjusting the generation form of the initial virtual scene according to the area information, and then adding the determined virtual object model to the adjusted initial virtual scene through a preset adding method to generate a candidate virtual scene.
[0076] In order to make the generated virtual scene more beautiful or closer to the target terrain, the virtual scene can be adjusted, and then the virtual object model can be added to the adjusted virtual scene to generate the virtual scene. The specific implementation method is as follows:
[0077] The initial virtual scene is adjusted according to the area information, and the virtual object model is added to the adjusted initial virtual scene to generate a candidate virtual scene, including:
[0078] Adjusting the generation style of the initial virtual scene according to the area information to obtain an adjusted initial virtual scene;
[0079] According to a preset model adding rule, the virtual object model is added to the adjusted initial virtual scene, and the initial virtual scene with the virtual object model added is baked to generate a candidate virtual scene.
[0080] The generation style can be understood as the shape and presentation form of the virtual scene, such as a diamond-shaped generation style, an irregular-shaped generation style, etc. The generation style can be set according to actual application, and this specification does not impose any limitation.
[0081] The preset model adding rule can be understood as an adding rule for adding the model to the initial virtual scene in a certain adding form, for example: a center-type adding rule and a ring-type adding rule.
[0082] The candidate virtual scene can be understood as a virtual scene that will be placed in the target terrain.
[0083] Specifically, the generation style of the initial virtual scene is adjusted according to the area information to obtain the adjusted initial virtual scene. This can be understood as adjusting the shape of the initial virtual scene through a random noise algorithm based on the area information of the initial virtual scene to obtain the adjusted initial virtual scene.
[0084] According to the preset model adding rules, the virtual object model is added to the adjusted initial virtual scene, and the initial virtual scene with the added virtual object model is baked to generate a candidate virtual scene. This can be understood as: according to the preset model adding rules, the virtual object model is added to the adjusted initial virtual scene according to a preset density, and the initial virtual scene with the added virtual object model is baked to generate a candidate virtual scene.
[0085] In one embodiment, the preset model addition rule may be a center-based addition rule, which determines the center point of the initial virtual scene and then adds virtual object models to the initial virtual scene at a predetermined density from the center point toward the edges of the initial virtual scene. The predetermined density may be set based on actual application and is not limited in this specification.
[0086] In another embodiment, the preset model adding rule may be a ring adding rule, which adds the virtual object model to the initial virtual scene according to a predetermined density by determining the edge position of the initial virtual scene.
[0087] In another embodiment, the ring-shaped adding rule and the center-shaped adding rule can be used simultaneously to add the virtual object model to the initial virtual scene. The predetermined model adding rule can be set according to actual application, and this specification does not impose any limitation on this.
[0088] In the process of adding virtual object models to the adjusted initial virtual scene, since the addition of virtual object models is somewhat random, there may be overlap between virtual object models. In order to solve the overlap problem between virtual object models, it is necessary to add a collision body to each virtual object model added to the adjusted initial virtual scene. Some large buildings require the addition of other virtual object models. If a collision body is created, a virtual object model cannot be added to another virtual object model. Therefore, it is necessary to pre-create placeholders for some virtual object models. The specific implementation method is as follows:
[0089] Before adding the virtual object model to the adjusted initial virtual scene and generating a candidate virtual scene, the method further includes:
[0090] When it is determined that the virtual object model does not meet a preset virtual object superposition condition, creating a collision body for the virtual object model;
[0091] When it is determined that the virtual object model satisfies the preset virtual object superposition condition, determining a base virtual object model and a superimposed virtual object model from the virtual object model, and determining a superimposition relationship between the base virtual object model and the superimposed virtual object model;
[0092] A collision volume is created for the basic virtual object model and the superimposed virtual object model based on the superimposed relationship, and a placeholder patch is created for the basic virtual object model.
[0093] Among them, the virtual object overlay condition can be understood as a preset instruction to overlay a virtual object with another virtual object, for example: overlaying a virtual object model horse in a virtual object model stable, overlaying a virtual object model vase on a virtual object model table, etc., and when it is determined that a virtual object vase needs to be overlaid on the virtual object model table, it is determined that there is an overlay relationship between the virtual object model table and the virtual object model vase; the virtual object overlay condition can be set according to actual application, and this manual does not make specific restrictions on this.
[0094] The basic virtual object model can be understood as a virtual object model on the basis of which other virtual object models need to be superimposed; the superimposed virtual object model can be understood as a virtual object model that needs to be superimposed on the basic virtual object model; for example: when the virtual object superposition condition is virtual object model: table superimposed virtual object model: vase, the basic virtual object model is the virtual object model table, and the superimposed virtual object model is the virtual object vase.
[0095] The collision body can be understood as a bounding box. By adding a collision body to a virtual object model, the virtual object model will not overlap with other virtual object models.
[0096] A placeholder patch can be understood as a virtual object model placement point reserved for another virtual object model b in a virtual object model a. Even if a collision body has been created for the virtual object model a, the virtual object model b can be superimposed on the virtual object model a.
[0097] Specifically, when it is determined that the virtual object model does not have other virtual object models that need to be superimposed with it, a collision body is created for the virtual object model; or, when it is determined that the virtual object model has other virtual object models that need to be superimposed with it, a basic virtual object model and an overlaid virtual object model are determined from the determined virtual object models, and the overlay relationship between the two is determined to be superimposed on the basic virtual object model, and then collision bodies are created for both the basic virtual object model and the overlaid virtual object model according to the overlay relationship, and a placeholder patch is created on the basic virtual object model.
[0098] The embodiments of this specification add a collision body to each virtual object model to prevent overlap between virtual object models, thereby avoiding problems in the final generated virtual scene; and, by adding placeholder surfaces to virtual object models that meet the overlay conditions, it avoids the problem of virtual object models not being able to overlay when they need to be overlaid later.
[0099] In one embodiment, when it is determined that a virtual object model table has a virtual object model vase that needs to be superimposed with it, the basic virtual object model is determined from the determined virtual object models as the virtual object model: table, and the superimposed virtual object model is determined as the virtual object: vase, and the superimposed relationship between the two is determined as superimposing the virtual object model: vase onto the basic virtual object model: table, and then a collision body is created for the virtual object model: table and the virtual object model: vase according to the superimposed relationship, and a placeholder surface is created on the virtual object model.
[0100] In another embodiment, there may be multiple virtual object models superimposed on each other. In order to better determine which virtual object model is superimposed on which virtual object model, placeholder identifiers can be created for the virtual object models to more quickly determine the superimposition relationship between the virtual object models. The specific implementation method is as follows:
[0101] The determining of the overlay relationship between the basic virtual object model and the overlay virtual object model includes:
[0102] Determining placeholder identifiers carried by the basic virtual object model and the superimposed virtual object model;
[0103] A corresponding overlay relationship between the basic virtual object model and the overlay virtual object model is determined according to the placeholder identifier.
[0104] The placeholder identifier can be understood as an identifier that uniquely identifies the virtual object model; for example, a string identifier, a name identifier, etc.
[0105] Specifically, the placeholder identifiers carried by the basic virtual object model and the superimposed virtual object model are determined; based on the placeholder identifiers, the corresponding superposition relationship between the basic virtual object model and the superimposed virtual object model is determined, which can be understood as determining the placeholder identifiers carried by the basic virtual object model and the superimposed virtual object model, and then determining the superposition relationship between the two based on the determined placeholder identifiers, which can be to superimpose the superimposed virtual object model onto the basic virtual object model.
[0106] In one embodiment, when the basic virtual object model is a floor and the superimposed virtual objects are a table and a vase, the placeholder identifier of the floor is determined to be a, the placeholder identifier of the table is b, and the placeholder identifier of the vase is c. Then, based on the placeholder identifiers of the floor, table, and vase, their superposition relationship can be determined as table b superimposed on floor a, and vase c superimposed on table b.
[0107] After determining the overlay relationship between the basic virtual object model and the overlay virtual object model, the basic virtual object model and the overlay virtual object model can be added to the initial virtual object model according to the overlay relationship between the basic virtual object model and the overlay virtual object model and the placeholder identifier, thereby realizing rapid overlay of the virtual object model and accelerating the rate of generating candidate virtual scenes. The specific implementation method is as follows:
[0108] Adding the virtual object model to the adjusted initial virtual scene includes:
[0109] adding the basic virtual object model to the adjusted initial virtual scene;
[0110] The superimposed virtual object model is superimposed on the placeholder surface of the basic virtual object model according to the superimposition relationship.
[0111] Specifically, the base virtual object model is first added to the initial virtual scene adjusted based on the area information according to the preset model addition rules. Then, based on the overlay relationship between the base virtual object model and the overlay virtual object model, the overlay virtual object is overlaid on the placeholder surface of the base virtual object model. The preset model addition rules can be found in the above embodiment and will not be detailed here.
[0112] The embodiments of this specification improve the user experience by adjusting the initial virtual scene to generate a virtual scene that fits the target terrain; and improve the richness of the generated virtual scene by adding virtual object models to the adjusted initial virtual scene.
[0113] Step S208: determining a virtual scene placement point in the target terrain according to a preset terrain condition, and generating a target virtual scene according to the virtual scene placement point and the candidate virtual scenes.
[0114] The preset terrain conditions can be understood as pre-set conditions for the placement of the desired virtual scene in the target terrain. For example, the terrain conditions can be a 30° slope, proximity to a stream, or a hill, etc. The terrain conditions can be set according to actual applications and are not specifically limited in this specification.
[0115] The virtual scene placement point can be understood as a placement point where the candidate virtual scene is placed at a certain position on the target terrain.
[0116] Specifically, a virtual scene placement point is determined in the target terrain according to the preset terrain conditions, and a target virtual scene is generated based on the virtual scene placement point and the candidate virtual scene. This can be understood as: a virtual scene placement point that meets the predetermined terrain conditions is determined in the target terrain according to the preset terrain conditions, and then the candidate virtual scene is placed at the virtual scene placement point to generate the target virtual scene.
[0117] When determining the virtual scene placement point, multiple virtual scene placement points may be determined, and then the best virtual scene placement point may be determined from the multiple virtual scene placement points according to a predetermined elimination rule to improve the user experience. The specific implementation method is as follows:
[0118] Determining a virtual scene placement point in the target terrain according to preset terrain conditions includes:
[0119] Determining a mask layer corresponding to the target terrain, and determining an initial virtual scene placement point according to the preset terrain conditions and the mask layer;
[0120] According to a preset elimination rule, a mask layer to be eliminated is determined from the mask layer corresponding to the initial virtual scene placement point, and the virtual scene placement point is determined based on the initial virtual scene placement point and the mask layer to be eliminated.
[0121] The mask can be understood as the range information of the coordinate information. For example, the mask can store a stream 10 meters away from the target terrain and a hill 100 meters away. The virtual scene can be placed within the range from the stream to the hill.
[0122] The preset elimination rules can be understood as preset terrain screening rules; for example: eliminating virtual scene placement points of existing virtual scenes, virtual scene placement points of basic scenes such as streams, etc., which can be set according to actual applications, and this manual does not impose any restrictions on this.
[0123] Specifically, at least two mask layers contained in the target terrain are determined, and by superimposing the at least two mask layers on each other, overlapping virtual scene placement points between the at least two mask layers are determined, and an initial virtual scene placement point is determined from the overlapping virtual scene placement points according to preset terrain conditions, and then according to preset screening rules, a mask layer to be removed is determined from the initial virtual scene placement point, and then the mask layer to be removed is removed from the initial virtual scene placement point, and then the virtual scene placement points in the remaining mask layers are determined as virtual scene placement points.
[0124] In one embodiment, the target terrain corresponds to mask a, mask b and mask c, and masks a, b, and c are superimposed to determine placement points a1, b1, b2, and c2 that overlap with masks a, b, and c. Then, placement points a1, b2, and c2 that meet the preset terrain requirements and have streams within 50 meters are determined as initial virtual scene placement points; then, according to the preset elimination rules, if other virtual scenes already exist at the current placement point, the mask layers b and c corresponding to b2 and c2 are determined as mask layers to be eliminated, and then the mask layers b and c are eliminated, and the placement point a1 in the mask layer a is determined as the virtual scene placement point.
[0125] In actual applications, multiple terrain conditions may be preset, but it is impossible to find a virtual scene placement point that satisfies all of these conditions in the target terrain. Therefore, it is necessary to pre-set more desirable terrain conditions so that when multiple terrain conditions cannot be met at the same time, the corresponding virtual scene placement point can still be determined to avoid the problem of virtual scene generation failure. The specific implementation method is as follows:
[0126] Determining a virtual scene placement point in the target terrain according to preset terrain conditions includes:
[0127] In the case where there are at least two preset terrain conditions and the at least two preset terrain conditions cannot be satisfied simultaneously, the virtual scene placement point is determined in the target terrain according to terrain weight information of the at least two preset terrain conditions.
[0128] Among them, the terrain weight information can be understood as the preference information of the pre-set terrain conditions when the terrain conditions cannot be met at the same time. For example, the weight information of the terrain condition with a slope of 30° is 0.7, and the weight information of the existence of a stream within 100 meters is 0.3.
[0129] Specifically, when there are at least two preset terrain conditions and there is no virtual scene placement point in the target terrain that satisfies both terrain conditions, the terrain condition with a higher weight value is determined based on the terrain weight information of the preset terrain condition, and the virtual scene placement point that better meets the terrain condition is preferentially selected.
[0130] In one embodiment, when the preset terrain conditions are a terrain slope of 30° and a stream within 100 meters, the corresponding weight information is 0.7 and 0.3 respectively, and when the target terrain does not simultaneously satisfy the conditions of a terrain slope of 30° and a stream within 100 meters, the virtual scene placement point is selected to be closer to a slope of 30° based on the weight values of these two conditions.
[0131] After the current target virtual scene is generated, when creating virtual scenes later, due to some factors, other virtual scenes may need to be placed in the location of the target virtual scene, resulting in overlap between the two virtual scenes. Therefore, it is necessary to record the location information of the current target virtual scene so that when a new virtual scene needs to be created later, the virtual scene placement point at the location of the target virtual scene can be removed to avoid the problem of virtual scene overlap. The specific implementation method is as follows:
[0132] After the candidate virtual scene is added to the virtual scene placement point to generate a target virtual scene, the method further includes:
[0133] Generating placeholder information of the target virtual scene, wherein the placeholder information is virtual scene placement point information of the target virtual scene;
[0134] Accordingly, the step of determining the mask layer to be removed from the mask layer corresponding to the initial virtual scene placement point according to a preset removal rule includes:
[0135] In a case where the initial virtual scene placement point is identical to the placeholder information, the initial virtual scene placement point is determined as the mask layer to be removed.
[0136] Specifically, generating the placeholder information of the target virtual scene can be understood as: information generated according to virtual scene placement point information of the target virtual scene in the target terrain.
[0137] After the placeholder information is generated, when the initial virtual scene placement points are subsequently eliminated using a preset elimination rule, the virtual scene placement points corresponding to the placeholder information will be eliminated from the initial virtual scene placement points based on the placeholder information.
[0138] In order to make the placement of candidate virtual scenes in the virtual scene placement points placed in the target terrain more diverse, the candidate virtual scenes can be placed in the virtual scene placement points in an additional manner to improve the user experience. The specific implementation method is as follows:
[0139] Generating a target virtual scene according to the virtual scene placement point and the candidate virtual scene includes:
[0140] The candidate virtual scene is attached to the virtual scene placement point to generate a target virtual scene.
[0141] Specifically, after determining a placeable point of the virtual scene in the target terrain, the candidate virtual scene can be directly attached / superimposed on the virtual scene placement point.
[0142] In practical applications, the candidate virtual scene can also be automatically adsorbed to the virtual scene placement point by adsorption when the candidate virtual scene is close to the virtual scene placement point at a certain distance, thereby saving the possible need to adjust the position of the virtual scene placement point and the candidate virtual scene.
[0143] In one embodiment, a scene adsorption point is first set in the candidate virtual scene. This scene adsorption point can be the center point of the virtual scene or any location in the virtual scene. If the distance between the scene adsorption point of the candidate virtual scene and the virtual scene placement point is determined to be 50 meters, the scene adsorption point of the candidate virtual scene is directly aligned with the virtual scene placement point, thereby completing the placement of the candidate virtual scene. The distance can be set based on actual application and is not specifically limited in this specification.
[0144] In the embodiment of this specification, by setting terrain conditions, virtual scene placement points that meet user expectations are screened out from the target terrain, and then the virtual scene placement points are added to the candidate virtual scenes to generate the target virtual scene, thereby improving the user experience.
[0145] The virtual scene generation method provided in the present application includes determining a target terrain and a virtual scene generation strategy corresponding to the target terrain, wherein the virtual scene generation strategy includes virtual scene configuration information; determining area information of an initial virtual scene and a virtual object model corresponding to the initial virtual scene based on the virtual scene configuration information; adjusting the initial virtual scene based on the area information, and adding the virtual object model to the adjusted initial virtual scene to generate a candidate virtual scene; determining a virtual scene placement point in the target terrain based on preset terrain conditions, and generating a target virtual scene based on the virtual scene placement point and the candidate virtual scene.
[0146] Specifically, by determining the virtual scene generation strategy corresponding to the target terrain, and then determining the area information corresponding to the initial virtual scene and the virtual object model based on the virtual scene configuration information in the virtual scene generation strategy to generate a candidate virtual scene, and then generating the target virtual scene based on the preset terrain conditions and the determined virtual scene placement points, the automatic generation of the virtual scene is realized, avoiding the waste of time and manpower caused by manual generation of the virtual scene.
[0147] The following combined Figure 3 Taking the virtual scene generation method provided in this application as an example of applying it to generate a virtual game camp, the virtual scene generation method is further described. Figure 3 A processing flow chart of a virtual game camp generation method in a virtual scene generation method provided in an embodiment of the present application is shown, which specifically includes the following steps:
[0148] S302: Receive a virtual game camp generation instruction.
[0149] Among them, the virtual game camp generation instruction can be understood as a virtual scene generation instruction.
[0150] S304: Determine a corresponding virtual game campsite generation configuration table according to the target terrain and configuration table identifier carried in the virtual game campsite generation instruction.
[0151] The configuration table identifier can be understood as a policy identifier; the virtual game camp generation configuration table can be understood as virtual scene configuration information. The virtual game camp generation configuration table is as follows:
[0152] ID demand 0 huge:5 mid:2-5 small:5 1 huge: 5
[0153] Table 1
[0154]
[0155] Table 2
[0156] name tag modelPath infoModelPath unityInstance horseHous stables standard . / WJ_Tent_Ver_L.FBX . / camp1Info / info.FBX Asset / that.fbx tent standard . / WJ_Tent_Tra_M.FBX Asset / this.fbx
[0157] Table 3
[0158]
[0159] Table 4
[0160] Specifically, Table 1 is used to load a specific campsite generation template. It sets the terrain ID (i.e., configuration table identifier) and the number of large (i.e., huge in Table 1), medium (i.e., mid in Table 1), and small (i.e., small in Table 1) campsites. The ID column in Table 1 is used to index the current column, and the demand column (i.e., the demand column in Table 1) specifies the desired campsite type label and quantity. To switch to a different virtual game campsite generation configuration table for the same terrain, simply switch the terrain ID (i.e., identity document).
[0161] Table 2 sets the basic properties of different camps (such as the number of generated basic objects and camp size). It sets the radius of large, medium, and small camps, the minimum spacing between camps, and the size and quantity of props. The tag column specifies the number and type of objects to be placed in the camp; bonefire specifies the minimum spacing; and the tentSet column specifies the type and quantity of objects to be placed in the camp.
[0162] Table 3 is used to set the placement rules and child hosting for different objects. It sets the model name, model tag, Houdini preview path, bounding box and placeholder path, and Unity path (i.e., game engine path). Name (i.e., name): name for easy indexing; tag (i.e., tag): current object tag, which can have multiple tags simultaneously, for categorized queries and loading indexes; modelPath: current object FBX (filmbox, a three-dimensional universal model format) path, used for instantiation preview in the process; infoModelPath: FBX path storing additional properties for the current object, used to store child hosting position and collision model information; unityInstance: additional properties stored on the model, used for Houdini engine instantiation; maxAngle: maximum rotation angle of the model in the placement position; towardCenter: the angle at which the model always deviates towards the center of the placeholder when rotating in the placement position.
[0163] It should be noted that modelPath and infoModelPath can be filled with the configured relative path such as $HIP or absolute path, and unityInstance can be filled with the relative path within Unity.
[0164] Table 4 is used to set the child loading and placement rules for the carrier patch. It sets the ID number, tag, size, and placement method of the placeholder patch. ID: corresponds to the ID number of the placeholder patch; label: has no functional role, used to conveniently record the current carrier patch's user object and index; instance: specifies the type label and number of placement objects loaded on the carrier patch; placingMode: specifies the placement mode of the loaded placement objects. 0 means that the placed object will be placed on the surface regardless of parent-level collision, and 1 means that the placed object will be placed on its surface according to parent-level collision.
[0165] In addition, the virtual game camp generation configuration table also includes the following contents as shown in Table 5:
[0166]
[0167]
[0168]
[0169] Table 5
[0170] Specifically, Table 5 is used to set the basic camp (based on the model loaded in Table 1) walking, sampling, placement quantity, etc.
[0171] S306: Determine the area information of the initial virtual game camp and the virtual prop model corresponding to the initial virtual game camp according to the virtual game camp configuration table.
[0172] Among them, the initial virtual game camp is equivalent to the initial virtual scene; the virtual prop model is equivalent to the virtual object model.
[0173] S308: Adjust the generation style of the initial game camp based on the area information.
[0174] S310: Determine whether the virtual prop model meets the preset virtual prop superposition conditions. If so, execute step S316; otherwise, execute step S312.
[0175] Among them, the virtual props superposition condition is equivalent to the virtual object superposition condition;
[0176] S312: Determine a basic virtual prop model and an overlay virtual prop model from the virtual prop model, create a collision body according to the overlay relationship between the basic virtual prop model and the overlay virtual prop model, and create a placeholder patch for the basic virtual prop model.
[0177] Among them, the basic virtual prop model is equivalent to the basic virtual object model; the superimposed virtual prop model is equivalent to the superimposed virtual object model.
[0178] S314: adding the basic virtual prop model to the adjusted initial virtual game camp according to a preset prop adding rule, and superimposing the superimposed virtual prop model onto the placeholder surface of the basic virtual prop model according to the superposition relationship.
[0179] S316: Create a collision body for the virtual prop model.
[0180] S318: Bake the initial virtual game camp with the virtual prop model added to generate a candidate virtual game camp.
[0181] Among them, the candidate virtual game camps are equivalent to the candidate virtual scenes.
[0182] S320: determining an initial virtual game campsite placement point in the mask layer where the target terrain is located according to a preset terrain condition, and determining a target virtual game campsite placement point from the initial virtual game campsite placement point according to a preset elimination rule.
[0183] Among them, the target virtual game camp placement point can be understood as a virtual scene placement point.
[0184] Specifically, determining the initial virtual game campsite placement point in the mask layer where the target terrain is located according to the preset terrain conditions can be achieved through the scatter mask layer in Table 6; and determining the target virtual game campsite placement point from the initial virtual game campsite placement point according to the preset culling rule can be achieved through the culling mask layer in Table 6, which is shown below:
[0185]
[0186] Table 6
[0187] See also Figure 4 , Figure 4 A diagram showing the application of a culling mask layer in a virtual scene generation method is shown.
[0188] Specifically, through Figure 4 The a in the figure is an image without culling mask. Figure 4 Figure b shows an example of using a culling mask. By using a culling mask layer, campsites that don't meet the specified culling rules can be removed from the target terrain according to the preset culling rules, improving the quality of the generated virtual game campsite and indirectly enhancing the user experience.
[0189] S322: Adding the candidate virtual game campsite to the target virtual game campsite placement point according to a preset campsite addition rule to generate the target virtual game campsite.
[0190] Among them, the preset camp additional rules are equivalent to the preset scene additional rules.
[0191] In practical applications, after the target virtual game camp is generated, a fence curve may be added to the target virtual game camp.
[0192] See also Figure 5 , Figure 5 2 is a schematic diagram of a target virtual game camp in a virtual scene generation method provided in one embodiment of the present application.
[0193] Figure 5 The generated target virtual game camp contains virtual props such as 4 horse stables and 2 tents, and is surrounded by a fence.
[0194] The specific implementation of the above steps S302-S322 is consistent with the specific implementation of the virtual scene generation method in the above embodiment, and will not be discussed in detail here. For details, please refer to the virtual scene generation method in the above embodiment.
[0195] The virtual scene generation method provided in the present application includes determining a target terrain and a virtual scene generation strategy corresponding to the target terrain, wherein the virtual scene generation strategy includes virtual scene configuration information; determining area information of an initial virtual scene and a virtual object model corresponding to the initial virtual scene based on the virtual scene configuration information; adjusting the initial virtual scene based on the area information, and adding the virtual object model to the adjusted initial virtual scene to generate a candidate virtual scene; determining a virtual scene placement point in the target terrain based on preset terrain conditions, and generating a target virtual scene based on the virtual scene placement point and the candidate virtual scene.
[0196] Specifically, by determining the virtual scene generation strategy corresponding to the target terrain, and then determining the area information corresponding to the initial virtual scene and the virtual object model based on the virtual scene configuration information in the virtual scene generation strategy to generate a candidate virtual scene, and then generating the target virtual scene based on the preset terrain conditions and the determined virtual scene placement points, the automatic generation of the virtual scene is realized, avoiding the waste of time and manpower caused by manual generation of the virtual scene.
[0197] Corresponding to the above method embodiment, the present application also provides a virtual scene generation device embodiment, Figure 6 FIG. 1 shows a schematic diagram of a virtual scene generation device provided by an embodiment of the present application. Figure 6 As shown, the device includes:
[0198] The first determining means 602 is configured to determine a target terrain and a virtual scene generation strategy corresponding to the target terrain, wherein the virtual scene generation strategy includes virtual scene configuration information;
[0199] The second determining means 604 is configured to determine the area information of the initial virtual scene and the virtual object model corresponding to the initial virtual scene according to the virtual scene configuration information;
[0200] The first generating means 606 is configured to adjust the initial virtual scene according to the area information, and add the virtual object model to the adjusted initial virtual scene to generate a candidate virtual scene;
[0201] The second generating device 608 is configured to determine a virtual scene placement point in the target terrain according to a preset terrain condition, and generate a target virtual scene according to the virtual scene placement point and the candidate virtual scenes.
[0202] Optionally, the device further includes:
[0203] The instruction receiving module is configured as follows:
[0204] receiving a virtual scene generation instruction, wherein the virtual scene generation instruction includes terrain information of the target terrain and a strategy identifier of a virtual scene generation strategy corresponding to the target terrain;
[0205] Accordingly, the first receiving module 602 is further configured to:
[0206] The target terrain is determined according to the terrain information, and a virtual scene generation strategy corresponding to the target terrain is determined according to the strategy identifier.
[0207] Optionally, the device further includes:
[0208] The virtual scene configuration information includes scene parameters of the virtual scene, area calculation parameters of the virtual scene determined according to the scene parameters of the virtual scene, and virtual object configuration information corresponding to the virtual scene;
[0209] Accordingly, the second determining means 604 is further configured to:
[0210] Determining area information of an initial virtual scene according to scene parameters of the virtual scene and area calculation parameters of the virtual scene;
[0211] A virtual object model corresponding to the initial virtual scene is determined according to the virtual object configuration information corresponding to the virtual scene.
[0212] Optionally, the second determining means 604 is further configured to:
[0213] The area information of the initial virtual scene is determined according to the scene parameters of the virtual scene and the center circle radius information of the virtual scene.
[0214] Optionally, the first generating means 606 is further configured to:
[0215] Adjusting the generation style of the initial virtual scene according to the area information to obtain an adjusted initial virtual scene;
[0216] According to a preset model adding rule, the virtual object model is added to the adjusted initial virtual scene, and the initial virtual scene with the virtual object model added is baked to generate a candidate virtual scene.
[0217] Optionally, the device further includes:
[0218] The first creation module is configured to:
[0219] When it is determined that the virtual object model does not meet a preset virtual object superposition condition, creating a collision body for the virtual object model;
[0220] When it is determined that the virtual object model satisfies the preset virtual object superposition condition, determining a base virtual object model and a superimposed virtual object model from the virtual object model, and determining a superimposition relationship between the base virtual object model and the superimposed virtual object model;
[0221] A collision volume is created for the basic virtual object model and the superimposed virtual object model based on the superimposed relationship, and a placeholder patch is created for the basic virtual object model.
[0222] Optionally, the first creation module is further configured to:
[0223] Determining placeholder identifiers carried by the basic virtual object model and the superimposed virtual object model;
[0224] A corresponding overlay relationship between the basic virtual object model and the overlay virtual object model is determined according to the placeholder identifier.
[0225] Optionally, the first generating means 606 is further configured to:
[0226] adding the basic virtual object model to the adjusted initial virtual scene;
[0227] The superimposed virtual object model is superimposed on the placeholder surface of the basic virtual object model according to the superimposition relationship.
[0228] Optionally, the second generating means 608 is further configured to:
[0229] Determining a mask layer corresponding to the target terrain, and determining an initial virtual scene placement point according to the preset terrain conditions and the mask layer;
[0230] According to a preset elimination rule, a mask layer to be eliminated is determined from the mask layer corresponding to the initial virtual scene placement point, and the virtual scene placement point is determined based on the initial virtual scene placement point and the mask layer to be eliminated.
[0231] Optionally, the second generating means 608 is further configured to:
[0232] In the case where there are at least two preset terrain conditions and the at least two preset terrain conditions cannot be satisfied simultaneously, the virtual scene placement point is determined in the target terrain according to terrain weight information of the at least two preset terrain conditions.
[0233] Optionally, the second generating means 608 is further configured to:
[0234] The candidate virtual scene is attached to the virtual scene placement point to generate a target virtual scene.
[0235] Optionally, the device further includes:
[0236] The information generating device is configured to:
[0237] Generating placeholder information of the target virtual scene, wherein the placeholder information is virtual scene placement point information of the target virtual scene;
[0238] Accordingly, the second generating means 608 is further configured to:
[0239] In a case where the initial virtual scene placement point is identical to the placeholder information, the initial virtual scene placement point is determined as the mask layer to be removed.
[0240] The virtual scene generation device provided in the present application includes determining a target terrain and a virtual scene generation strategy corresponding to the target terrain, wherein the virtual scene generation strategy includes virtual scene configuration information; determining the area information of an initial virtual scene and a virtual object model corresponding to the initial virtual scene based on the virtual scene configuration information; adjusting the initial virtual scene based on the area information, and adding the virtual object model to the adjusted initial virtual scene to generate a candidate virtual scene; determining a virtual scene placement point in the target terrain based on preset terrain conditions, and generating a target virtual scene based on the virtual scene placement point and the candidate virtual scene.
[0241] Specifically, by determining the virtual scene generation strategy corresponding to the target terrain, and then determining the area information corresponding to the initial virtual scene and the virtual object model based on the virtual scene configuration information in the virtual scene generation strategy to generate a candidate virtual scene, and then generating the target virtual scene based on the preset terrain conditions and the determined virtual scene placement points, the automatic generation of the virtual scene is realized, avoiding the waste of time and manpower caused by manual generation of the virtual scene.
[0242] The above is a schematic scheme of a virtual scene generation device of this embodiment. It should be noted that the technical solution of the virtual scene generation device and the technical solution of the above-mentioned virtual scene generation method belong to the same concept. For details not described in detail in the technical solution of the virtual scene generation device, please refer to the description of the technical solution of the above-mentioned virtual scene generation method. In addition, the various components in the device embodiment should be understood as functional modules that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0243] Figure 7 7 shows a block diagram of a computing device 700 according to an embodiment of the present application. Components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.
[0244] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0245] In one embodiment of the present application, the above components of the computing device 700 and Figure 7Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 7 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0246] Computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 700 may also be a mobile or stationary server.
[0247] The processor 720 is configured to execute computer executable instructions of the virtual scene generation method.
[0248] The above is a schematic diagram of a computing device according to this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the aforementioned virtual scene generation method are based on the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the aforementioned virtual scene generation method.
[0249] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which are used in a virtual scene generation method when executed by a processor.
[0250] The above is a schematic diagram of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the aforementioned virtual scene generation method are based on the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the aforementioned virtual scene generation method.
[0251] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0252] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the virtual scene generation method when executed by the chip.
[0253] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0254] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0255] The preferred embodiments of the present application disclosed above are intended only to help illustrate the present application. The optional embodiments do not describe all details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of this application. This application selects and describes these embodiments in detail in order to better explain the principles and practical applications of this application, so that those skilled in the art can better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.
Claims
1. A virtual scene generation method, characterized in that: include: Determining a target terrain and a virtual scene generation strategy corresponding to the target terrain, wherein the virtual scene generation strategy includes virtual scene configuration information; Determining area information of an initial virtual scene and a virtual object model corresponding to the initial virtual scene according to the virtual scene configuration information; The initial virtual scene is adjusted according to the area information, and the virtual object model is added to the adjusted initial virtual scene to generate a candidate virtual scene, wherein the adding of the virtual object model to the adjusted initial virtual scene includes: adding a base virtual object model to the adjusted initial virtual scene; and superimposing the superimposed virtual object model on a placeholder surface of the base virtual object model according to an overlay relationship between the base virtual object model and the superimposed virtual object model, wherein the base virtual object model is a virtual object model on which other virtual object models need to be superimposed, and the superimposed virtual object model is a virtual object model that needs to be superimposed on the base virtual object model; A virtual scene placement point is determined in the target terrain according to preset terrain conditions, and a target virtual scene is generated according to the virtual scene placement point and the candidate virtual scenes.
2. The virtual scene generation method according to claim 1, characterized in that: Before determining the target terrain and the virtual scene generation strategy corresponding to the target terrain, the method further includes: receiving a virtual scene generation instruction, wherein the virtual scene generation instruction includes terrain information of the target terrain and a strategy identifier of a virtual scene generation strategy corresponding to the target terrain; Accordingly, the determination of the target terrain and the virtual scene generation strategy corresponding to the target terrain include: The target terrain is determined according to the terrain information, and a virtual scene generation strategy corresponding to the target terrain is determined according to the strategy identifier.
3. The virtual scene generation method according to claim 1, characterized in that: The virtual scene configuration information includes scene parameters of the virtual scene, area calculation parameters of the virtual scene determined according to the scene parameters of the virtual scene, and virtual object configuration information corresponding to the virtual scene; Accordingly, determining the area information of the initial virtual scene and the virtual object model corresponding to the initial virtual scene according to the virtual scene configuration information includes: Determining area information of an initial virtual scene according to scene parameters of the virtual scene and area calculation parameters of the virtual scene; A virtual object model corresponding to the initial virtual scene is determined according to the virtual object configuration information corresponding to the virtual scene.
4. The virtual scene generation method according to claim 3, characterized in that: The determining the area information of the initial virtual scene according to the scene parameters of the virtual scene and the area calculation parameters of the virtual scene includes: The area information of the initial virtual scene is determined according to the scene parameters of the virtual scene and the center circle radius information of the virtual scene.
5. The virtual scene generation method according to claim 1 or 3, characterized in that: The adjusting the initial virtual scene according to the area information and adding the virtual object model to the adjusted initial virtual scene to generate a candidate virtual scene includes: Adjusting the generation style of the initial virtual scene according to the area information to obtain an adjusted initial virtual scene; According to a preset model adding rule, the virtual object model is added to the adjusted initial virtual scene, and the initial virtual scene with the virtual object model added is baked to generate a candidate virtual scene.
6. The virtual scene generation method according to claim 1, characterized in that: Before adding the virtual object model to the adjusted initial virtual scene and generating a candidate virtual scene, the method further includes: When it is determined that the virtual object model does not meet a preset virtual object superposition condition, creating a collision body for the virtual object model; When it is determined that the virtual object model satisfies the preset virtual object superposition condition, determining a base virtual object model and a superimposed virtual object model from the virtual object model, and determining a superimposition relationship between the base virtual object model and the superimposed virtual object model; A collision volume is created for the basic virtual object model and the superimposed virtual object model based on the superimposed relationship, and a placeholder patch is created for the basic virtual object model.
7. The virtual scene generation method according to claim 6, characterized in that: The determining of the overlay relationship between the basic virtual object model and the overlay virtual object model includes: Determining placeholder identifiers carried by the basic virtual object model and the superimposed virtual object model; A corresponding overlay relationship between the basic virtual object model and the overlay virtual object model is determined according to the placeholder identifier.
8. The virtual scene generation method according to claim 1, characterized in that: Determining a virtual scene placement point in the target terrain according to preset terrain conditions includes: Determining a mask layer corresponding to the target terrain, and determining an initial virtual scene placement point from the mask layer according to the preset terrain conditions; According to a preset elimination rule, a mask layer to be eliminated is determined from the mask layer corresponding to the initial virtual scene placement point, and the virtual scene placement point is determined based on the initial virtual scene placement point and the mask layer to be eliminated.
9. The virtual scene generation method according to claim 1, characterized in that: Determining a virtual scene placement point in the target terrain according to preset terrain conditions includes: In the case where there are at least two preset terrain conditions and the at least two preset terrain conditions cannot be satisfied simultaneously, the virtual scene placement point is determined in the target terrain according to terrain weight information of the at least two preset terrain conditions.
10. The virtual scene generation method according to claim 1, characterized in that: Generating a target virtual scene according to the virtual scene placement point and the candidate virtual scene includes: The candidate virtual scene is attached to the virtual scene placement point to generate a target virtual scene.
11. The virtual scene generation method according to claim 1, characterized in that: After the candidate virtual scene is added to the virtual scene placement point to generate a target virtual scene, the method further includes: Generating placeholder information of the target virtual scene, wherein the placeholder information is virtual scene placement point information of the target virtual scene; Accordingly, the step of determining the mask layer to be removed from the mask layer corresponding to the initial virtual scene placement point according to a preset removal rule includes: In a case where the initial virtual scene placement point is identical to the placeholder information, the initial virtual scene placement point is determined as the mask layer to be removed.
12. A virtual scene generating device, characterized in that: include: A first determining device is configured to determine a target terrain and a virtual scene generation strategy corresponding to the target terrain, wherein the virtual scene generation strategy includes virtual scene configuration information; a second determining device configured to determine area information of an initial virtual scene and a virtual object model corresponding to the initial virtual scene according to the virtual scene configuration information; a first generating device configured to adjust the initial virtual scene according to the area information, and add the virtual object model to the adjusted initial virtual scene to generate a candidate virtual scene; The first generating device is further configured to add a base virtual object model to the adjusted initial virtual scene; and superimpose the superimposed virtual object model on a placeholder patch of the base virtual object model according to a superposition relationship between the base virtual object model and the superimposed virtual object model, wherein the base virtual object model is a virtual object model on which other virtual object models need to be superimposed, and the superimposed virtual object model is a virtual object model that needs to be superimposed on the base virtual object model; The second generating device is configured to determine a virtual scene placement point in the target terrain according to a preset terrain condition, and generate a target virtual scene according to the virtual scene placement point and the candidate virtual scene.
13. A computing device, characterized in that include: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the virtual scene generation method according to any one of claims 1 to 11.
14. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the virtual scene generation method described in any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Method and device for making virtual terrain scene
CN111617485A