Game terrain generation method and device, electronic equipment and storage medium

Generating game terrain through AI models solves the problem of high difficulty in manually creating terrain object models, and realizes efficient terrain design and editing, which is suitable for non-professional developers and improves development efficiency.

CN119113516APending Publication Date: 2024-12-13SANDBOX NETWORK TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411066086.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, it is difficult to manually create game terrain object models, and it is not conducive to non-professional game developers and affects development efficiency.

Method used

Combining the AI ​​model to generate game terrain, obtain the terrain description information input by the user, use the pre-trained AI model to generate terrain creation instructions, and generate target terrain according to the instructions, divide the terrain area for editing, and use the second AI model for area editing operations. .

Benefits of technology

It lowers the entry threshold for game terrain design, improves development efficiency, is suitable for non-professional game developers, and improves the efficiency of terrain creation and editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119113516A_ABST
    Figure CN119113516A_ABST
Patent Text Reader

Abstract

The invention provides a game terrain generation method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining terrain description information input by a user, inputting the terrain description information into a pre-trained first AI model, and obtaining a terrain creation instruction output by the first AI model; and generating a target terrain according to the terrain creation instruction. The AI model is combined on the basis of the game engine, the description information input by the user is understood through the AI model, the corresponding operation instruction is generated through the AI model, and then the game engine generates the game terrain based on the generated operation instruction, so that compared with a manual editing mode of the user in the prior art, the entry threshold can be reduced, the working efficiency is effectively improved, and the user experience is improved. And the development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game technology, and in particular to a method, device, electronic equipment and storage medium for generating game terrain. Background Art

[0002] Game level design refers to the work of designing game maps and levels during the video game development process.

[0003] Currently, developers in the industry mainly use commercial engines such as Unity and UE4 to create game terrain. Such game engine tools usually have the function of generating a basic terrain block with one click, and also provide various attribute options for the basic terrain, such as size, height, texture and other attribute options, as well as various drawing tools, such as smooth brush and flattening brush. Developers can create undulating terrain forms by setting attribute parameters and using drawing tools to edit the details of the basic terrain.

[0004] However, manually creating a game terrain object model is difficult to get started with and is not conducive to development by non-professional game developers, which affects the work efficiency of developers and leads to low development efficiency. Summary of the invention

[0005] The present invention provides a game terrain generation method, device, electronic device and storage medium, which are used to solve the defects in the prior art that manually creating a game terrain object model is difficult to get started and is not conducive to development by non-professional game developers. Combining an AI (Artificial Intelligence) model to generate game terrain can effectively improve work efficiency and development efficiency.

[0006] The present invention provides a method for generating game terrain, comprising: Obtaining terrain description information input by a user, inputting the terrain description information into a pre-trained first AI model, and obtaining a terrain creation instruction output by the first AI model; According to the terrain creation instruction, a target terrain is generated.

[0007] According to a method for generating game terrain provided by the present invention, the terrain creation instruction includes parameters required for generating terrain, and the parameters required for generating terrain include at least terrain size, landform and material; generating target terrain according to the terrain creation instruction includes: Determine the terrain space according to the target terrain size; Generating a terrain model corresponding to the target landform in the terrain space; Applying a target material to the surface of the terrain model to obtain a target terrain.

[0008] According to a method for generating game terrain provided by the present invention, the parameters required for generating terrain also include terrain layout, and the terrain layout is used to represent the position of landforms and materials in the terrain; the terrain model corresponding to the target landform is generated in the terrain space, including: In the terrain space, a terrain model corresponding to the target landform is generated according to the target terrain layout.

[0009] According to a method for generating game terrain provided by the present invention, after generating the target terrain according to the terrain creation instruction, the method further comprises: Dividing the target terrain into a plurality of terrain regions, and displaying the target terrain and each terrain region; Acquire terrain area editing information input by a user, input the terrain area editing information into a pre-trained second AI model, and obtain a terrain area editing instruction output by the second AI model; According to the terrain area editing instruction, a target editing operation is performed on the target terrain area.

[0010] According to a method for generating game terrain provided by the present invention, the step of inputting the terrain region editing information into a pre-trained second AI model to obtain a terrain region editing instruction output by the second AI model comprises: Inputting the terrain region editing information into a pre-trained second AI model, and having the second AI model determine a target terrain region, a target editing algorithm, and editing parameters for configuring the target editing algorithm based on the terrain region editing information; Using the editing parameters, configuring the target editing algorithm; A terrain region editing instruction is generated according to the configured target editing algorithm and the target terrain region.

[0011] According to a method for generating game terrain provided by the present invention, the AI ​​model is trained in the following manner: Acquire sample data; the sample data includes a sample description and sample parameters for generating a game terrain; The AI ​​model to be trained is trained according to the sample data to obtain the AI ​​model.

[0012] According to a method for generating game terrain provided by the present invention, dividing the target terrain into a plurality of terrain areas comprises: The target terrain is divided into a plurality of terrain regions according to a preset division level and a preset division strategy.

[0013] According to a method for generating game terrain provided by the present invention, after displaying the target terrain and each terrain area, the method further comprises: In response to a movement operation on a border of a terrain area, determining a movement distance corresponding to the movement operation; The border of the terrain area is moved to a target position according to the moving distance.

[0014] The present invention also provides a game terrain generating device, comprising: A first input module, used to obtain terrain description information input by a user, input the terrain description information into a pre-trained first AI model, and obtain a terrain creation instruction output by the first AI model; A generating module, used for generating a target terrain according to the terrain creation instruction; A division module, used for dividing the target terrain into a plurality of terrain regions, and displaying the target terrain and each terrain region; A second input module, used to obtain terrain area editing information input by a user, input the terrain area editing information into a pre-trained second AI model, and obtain a terrain area editing instruction output by the second AI model; The editing module is used to perform a target editing operation on the target terrain area according to the terrain area editing instruction.

[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the game terrain generation method as described in any one of the above items are implemented.

[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the game terrain generation method as described in any one of the above items are implemented.

[0017] The game terrain generation method, device, electronic device and storage medium provided by the present invention are combined with an AI model on the basis of a game engine, and the AI ​​model is used to understand the description information input by the user. The AI ​​model generates corresponding operation instructions, and then the game engine generates the game terrain based on the generated operation instructions. Compared with the manual editing method of the user in the prior art, the entry threshold can be lowered, the work efficiency can be effectively improved, and the development efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 It is a flowchart of a method for generating game terrain provided by an embodiment of the present invention.

[0020] Figure 2 It is a structural schematic diagram of a game terrain generating device provided by an embodiment of the present invention.

[0021] Figure 3 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] Figure 1 1 is a flow chart of a method for editing game terrain provided by an embodiment of the present invention. Figure 1 The embodiment of the present invention provides a method for editing game terrain, which may specifically include the following steps: Step 101, obtain terrain description information input by a user, input the terrain description information into a pre-trained first AI model, and obtain a terrain creation instruction output by the first AI model.

[0024] A game engine is a software framework that can be used to implement and run the core functions of a game, including graphics rendering, physics simulation, collision detection, animation control, audio processing, etc.

[0025] The game engine may include a corresponding game editor. The game editor may be a tool for editing various functions provided by the game engine, and may provide a visual interface, allowing developers to define objects, scenes, materials, animations, logic, and other contents in the game world through operations such as dragging and dropping and setting parameters. The game editor may also provide tools such as script writing, previewing, and debugging to help developers make games more efficiently.

[0026] The execution subject of the game terrain editing method provided in the embodiment of the present invention can be a game engine, such as a unity engine, a UE4 engine, a Cocos engine, etc., and the present invention is not limited here. The user can input terrain description information on the visual interface provided by the game editor, and the game engine can receive the terrain description information input by the user, and input the terrain description information into the pre-trained first AI model, so that the first AI model can generate a terrain creation instruction for creating a game terrain based on the terrain description information.

[0027] The terrain description information may be a terrain description text in a natural language form. After the game engine receives the terrain description text input by the user, it may input the terrain description text into the first AI model, so that the first AI model generates a terrain creation instruction for the game terrain described by the terrain description text based on the terrain description text input by the user.

[0028] The terrain creation instruction may be an instruction in the instruction format of the game engine for creating terrain. Specifically, a neural network model may be built based on the instruction format of the game engine, and the first AI model may be obtained by training the neural network model, so that the first AI model may generate a terrain creation instruction in the instruction format of the game engine based on the terrain description information input by the user.

[0029] The terrain creation instruction may include parameters required for generating terrain. The parameters required for generating terrain may include at least one of parameters such as terrain size, landform, material, and landform size. The first AI model may generate a terrain creation instruction in a game engine instruction format for creating a game terrain based on the terrain description information input by the user. The instruction may include at least one of parameters such as terrain size, landform, material, and landform size, so that the terrain creation instruction generated by the first AI model is input into the game engine, and the target terrain is generated by the game engine.

[0030] It should be noted that the parameters required for generating terrain can be determined by the first AI model based on the terrain description information input by the user, or can be customized by the first AI model based on the terrain described by the terrain description information input by the user. For example, assuming that the terrain description information input by the user is "help me generate a wild terrain", the user does not enter the description of terrain attributes such as landforms and materials, and the first AI model can customize the parameters required for generating terrain such as landforms and materials.

[0031] In one embodiment, the first AI model is usually large in size, and the pre-trained first AI model can be installed in the cloud, that is, on the server side. The game engine can establish remote communication with the server side, and the game engine can send the terrain description information input by the user to the first AI model on the server side for processing, and receive the terrain creation instructions output by the first AI model returned by the server side. The game engine can generate the target terrain according to the received terrain creation instructions.

[0032] The embodiment of the present invention uses an AI model to understand the terrain description information input by the user, and the AI ​​model generates terrain creation instructions containing corresponding attribute parameters, and then the game engine generates the target terrain based on the generated terrain creation instructions. Compared with the method in the prior art where users manually set parameters to generate terrain, work efficiency can be effectively improved.

[0033] Step 102: Generate target terrain according to the terrain creation instruction.

[0034] The terrain creation instruction may include parameters required for generating the terrain. The parameters required for generating the terrain may include at least one of parameters such as terrain size, landform, material, and landform size.

[0035] Landforms can represent the shape of the surface. The game engine can preset a variety of landforms, such as plain landforms, dune landforms, mountain landforms, hilly landforms, etc. Different landforms can represent different surface shapes, for example, mountain landforms can correspond to undulating shapes, and plain landforms can correspond to flat land shapes.

[0036] Materials can represent the texture details of the terrain model surface and can be used to simulate real surface materials. Game engines can preset a variety of materials, such as stone, water, soil, gravel, grass, etc.

[0037] The same terrain block can contain multiple landforms, for example, the wild terrain can include mountains, hills, plains, etc. The same landform can be composed of different materials, for example, a plain can contain soil, water, grass, etc.

[0038] The game engine can generate a terrain model corresponding to each landform based on a preset terrain model generation algorithm, for example, a terrain model corresponding to a mountain landform. The preset terrain model generation algorithm can be implemented using a Perlin noise algorithm, a Fractal algorithm, or a hybrid algorithm, which is not limited in the present invention. After generating the terrain model, the game engine can apply a corresponding material to the surface of the terrain model, for example, applying a grass material to the terrain surface corresponding to a plain landform, thereby obtaining the target terrain.

[0039] The command formats of terrain creation commands of different game engines may be different. The different parameters contained in the terrain creation commands may indicate that the command formats of the terrain creation commands are different. For example, game engine M needs to generate game terrain based on terrain size and landforms, and game engine N needs to generate game terrain based on terrain size, landforms, and materials.

[0040] The embodiment of the present invention combines an AI model with a game engine, and uses the AI ​​model to understand the terrain description information input by the user. The AI ​​model generates corresponding operation instructions, and then the game engine generates the game terrain based on the generated operation instructions. Compared with the manual editing method of users in the prior art, the entry threshold can be lowered, work efficiency can be effectively improved, and development efficiency can be improved.

[0041] In an optional embodiment, the terrain creation instruction includes parameters required for generating terrain, and the parameters required for generating terrain include at least terrain size, landform and material; step 102 may include the following sub-steps S11-S13: Sub-step S11, determining the terrain space according to the target terrain size; Sub-step S12, generating a terrain model corresponding to the target landform in the terrain space; Sub-step S13, applying a target material to the surface of the terrain model to obtain a target terrain.

[0042] For example, if the terrain description information input by the user is "Help me generate a terrain that includes plains and hills on the plains", the first AI model can generate terrain creation instructions based on this terrain description information: terrain size: 800×800×50; landform: plains, hills; material: plains-grassland, hills-grass, soil.

[0043] The game engine can generate a three-dimensional terrain space of 800×800×50 according to the terrain size parameter "800×800×50", generate terrain models corresponding to plain landforms and hilly landforms in the three-dimensional terrain space, apply grass material to the plain terrain, and apply grass and soil materials to the hilly terrain, thereby generating a target terrain including a plain landform composed of grass and a hilly landform composed of grass and soil.

[0044] In the embodiment of the present invention, the game engine generates the target terrain based on the parameters generated by the AI ​​model. Compared with the method in the prior art where the game engine generates the target terrain based on the parameters manually set by the user, the efficiency of terrain creation can be improved.

[0045] In an optional embodiment, the parameters required for generating the terrain may also include a terrain layout, which is used to represent the position of landforms and materials in the terrain; generating a terrain model corresponding to the target landform in the terrain space includes: generating a terrain model corresponding to the target landform in the terrain space according to the target terrain layout.

[0046] For example, if the terrain description information input by the user is "Help me generate a terrain that includes mountains and plains, and the plains are surrounded by mountains", the terrain creation instructions generated by the first AI model may include: terrain layout: middle of the terrain - plains, surrounding terrain - mountains.

[0047] The game engine can generate a terrain model corresponding to the plain landform in the middle of the three-dimensional terrain space and a terrain model corresponding to the mountain landform around the three-dimensional terrain space according to the terrain layout parameters "center of the terrain - plain, surrounding of the terrain - mountain range", thereby generating a target terrain with a plain landform surrounded by mountain landforms.

[0048] In an embodiment of the present invention, the AI ​​model can output a variety of parameters required for generating terrain, and the game engine can generate game terrain based on the multiple parameters required for generating terrain, so that the generated game terrain better meets user expectations and improves work efficiency.

[0049] In an optional embodiment, after generating the target terrain according to the terrain creation instruction, the following steps 103-105 may also be included: Step 103: Divide the target terrain into a plurality of terrain regions, and display the target terrain and each terrain region.

[0050] The embodiment of the present invention divides the target terrain into multiple terrain areas and displays the target terrain and the multiple terrain areas obtained by division to the user, so that the user can further adjust some terrain areas in the target terrain, thereby improving the editing efficiency of the target terrain by local correction.

[0051] Specifically, multiple terrain regions may be displayed to the user in one display mode or in combination of multiple display modes. In one display mode, different terrain regions may be displayed in different colors, and when a user selects a certain terrain region, the selected terrain region may be displayed in a highlighted state. In another display mode, different terrain regions may be marked with a unique ID (Identity document) in the target terrain region, and the user may specify the terrain region that needs to be edited and modified through text instructions.

[0052] Step 104, obtaining terrain area editing information input by the user, inputting the terrain area editing information into a pre-trained second AI model, and obtaining a terrain area editing instruction output by the second AI model.

[0053] After the game engine displays each terrain area in the target terrain, the user can input terrain area editing information on the visual interface provided by the game editor. The game engine can receive the terrain area editing information input by the user and input the terrain area editing information into a pre-trained second AI model, so that the second AI model can generate terrain area editing instructions for editing the terrain areas in the target terrain based on the terrain area editing information.

[0054] The terrain area editing instruction may include parameters required to modify the terrain, and the parameters required to modify the terrain may include at least a target terrain area and a target editing algorithm. Specifically, the second AI model may determine the target terrain area to be edited based on the terrain area editing information input by the user. For example, if the user selects terrain area A, the target terrain area may be determined to be terrain area A; for another example, if the user enters a text description "help me make the terrain of area A smoother", the target terrain area may be determined to be area A.

[0055] The second AI model can also determine the target editing algorithm to be applied to the target terrain area based on the terrain area editing information input by the user. For example, if the user inputs a text description "help me make the terrain of area A smoother", the target editing algorithm can be determined to be a smoothing algorithm, and then the terrain area editing instructions can be generated according to the target terrain area and the target editing algorithm, so that the terrain area editing instructions generated by the second AI model are input into the game engine, and the game engine applies the target editing algorithm to the target terrain area according to the terrain area editing instructions.

[0056] In one embodiment, the AI ​​model can be trained in the following manner: obtaining sample data, the sample data including a sample description and sample parameters for generating a game terrain, and training the AI ​​model to be trained based on the sample data to obtain a pre-trained AI model.

[0057] The sample data used to train the AI ​​model may include first sample data and second sample data. The first sample data may include sample terrain description text (e.g., help me generate an outdoor terrain) and sample parameters required by the game engine to generate the game terrain (e.g., terrain size, topography, material, etc.). The second sample data may include sample editing description text (e.g., there is grass in area A) and sample parameters required by the game engine to modify the game terrain (e.g., terrain area to be modified, editing algorithm, etc.).

[0058] The second AI model and the first AI model can be the same AI model or different AI models. When the first AI model and the second AI model are different AI models, the first sample data can be used to train the first AI model to obtain a trained first AI model; and the second sample data can be used to train the second AI model to obtain a trained second AI model. When the first AI model and the second AI model are the same AI model, the first sample data and the second sample data can be used simultaneously to train an AI model to obtain a trained AI model.

[0059] It should be noted that in practical applications, model training can be performed using supervised, unsupervised or deep learning methods, and the present invention is not limited here.

[0060] The embodiment of the present invention uses an AI model to understand the terrain area editing information input by the user, and the AI ​​model generates corresponding terrain area editing instructions, and then the game engine performs a target editing operation on the target terrain area in the target terrain based on the generated terrain area editing instructions. Compared with the prior art method in which users manually use drawing tools to edit the details of the basic terrain, work efficiency can be effectively improved.

[0061] Step 105: Perform a target editing operation on the target terrain area according to the terrain area editing instruction.

[0062] The game engine can preset a variety of editing algorithms, such as smoothing, elevation, depression, flattening, planting, landform, material and other algorithms. Different editing algorithms can correspond to different editing functions. For example, the smoothing algorithm can make the terrain smooth, the planting algorithm can plant trees, stones, houses and other meshes on the surface, the landform algorithm can generate the corresponding surface morphology, and the material algorithm can draw the corresponding material texture on the surface morphology.

[0063] Specifically, according to the terrain region editing instruction, the target editing algorithm may be applied to the target terrain region, and the target editing operation may be performed on the terrain objects in the target terrain region based on the target editing algorithm. For example, when the target editing algorithm is a smoothing algorithm, the surface morphology in the target terrain region to which the smoothing algorithm is applied may be smoothed, so that the surface morphology of the target terrain region presents a smooth effect.

[0064] The embodiment of the present invention combines an AI model with a game engine, and uses the AI ​​model to understand the terrain area editing information input by the user. The AI ​​model generates corresponding operation instructions, and then the game engine performs target editing on the target terrain area based on the generated terrain area editing instructions. Compared with the method in the prior art where users manually edit basic terrain details, the entry threshold can be lowered, work efficiency can be effectively improved, and development efficiency can be improved.

[0065] In an optional embodiment, the step of inputting the terrain region editing information into a pre-trained second AI model in step 104 to obtain the terrain region editing instruction output by the second AI model may include the following sub-steps S31-S33: Sub-step S31, inputting the terrain region editing information into a pre-trained second AI model, and having the second AI model determine a target terrain region, a target editing algorithm, and editing parameters for configuring the target editing algorithm based on the terrain region editing information; Sub-step S32, using target editing parameters to configure the target editing algorithm; Sub-step S33, generating a terrain area editing instruction according to the configured target editing algorithm and the target terrain area.

[0066] The editing algorithms preset in the game engine can configure corresponding editing parameters. For example, the planting algorithm can configure the planting object, the landform algorithm can configure the specific landform, the flattening algorithm can configure the specific material, and the smoothing algorithm can configure the smoothing parameters.

[0067] The terrain area editing instruction may include parameters required to modify the terrain. The parameters required to modify the terrain may include a target terrain area and a target editing algorithm, and may also include editing parameters. After the terrain area editing information input by the user is input into the pre-trained AI model, the second AI model can determine the target terrain area to be edited and the target editing algorithm based on the terrain area editing information, and can also generate editing parameters for configuring the target editing algorithm. The second AI model can use the editing parameters to configure the target editing algorithm, and generate terrain area editing instructions based on the configured target algorithm and target terrain area.

[0068] As an example, if the user enters a text description "Help me make the terrain of area A smoother", the second AI model can determine the target terrain area as area A, determine the target editing algorithm as the smoothing algorithm, and generate a smoothing parameter of 0.8 based on the text description, and can configure the smoothing algorithm with the smoothing parameter of 0.8, and generate a terrain area editing instruction based on the configured smoothing algorithm and area A. The game engine can apply the smoothing algorithm with the smoothing parameter of 0.8 to the terrain area A according to the terrain area editing instruction.

[0069] As another example, if the user inputs a text description "Help me plant trees on the plains of area A", the second AI model can determine the target terrain area as the plain landform area in area A based on the text description, determine the target editing algorithm as the planting algorithm, and determine the planting parameters as the maple mesh. The planting parameters can be used to configure the planting algorithm for the maple mesh, and a terrain area editing instruction can be generated according to the configured planting algorithm and area A. The game engine can place the maple mesh on the plain landform area in area A according to the terrain area editing instruction.

[0070] In the embodiment of the present invention, the AI ​​model understands the terrain area editing information input by the user, determines the editing parameters used to configure the target editing algorithm, and uses the editing parameters to configure the target editing algorithm to generate terrain area editing instructions, so that the game terrain generated by the game engine can better meet the user's expectations and improve work efficiency.

[0071] In an optional embodiment, dividing the target terrain into a plurality of terrain regions includes: dividing the target terrain into a plurality of terrain regions according to a preset division level and a preset division strategy.

[0072] After the game engine generates the target terrain according to the terrain creation instructions, the target terrain can be divided into multiple terrain areas according to the preset division levels and preset division strategies, so that the specific terrain areas in the target terrain can be corrected on the basis of the target terrain, thereby improving work efficiency and making the terrain details meet user expectations.

[0073] There may be multiple division levels, and the preset division level may be at least one division level. For example, the ground of the target terrain may be used as a reference to obtain multiple terrain areas on the ground, or the space where the target terrain is located may be used as a reference to divide the entire target terrain block into multiple small terrain blocks, or multiple division levels may be combined to obtain multiple smaller terrain areas in a small terrain block based on the surface of the terrain.

[0074] There may be multiple division strategies, and the preset division strategy may be at least one division strategy. For example, the division may be performed according to different grid sizes, or according to different landforms or materials, or a combination of multiple division strategies may be performed to divide a grid into multiple terrain areas according to different landforms and materials.

[0075] In one division scheme, the ground of the target terrain can be used as a reference to divide the ground into multiple terrain regions. The division can be performed according to different grid sizes, or according to different landforms or materials, or in combination with multiple division strategies. For example, a grid can be divided into multiple terrain regions according to different landforms and materials.

[0076] In another division scheme, the entire target terrain block can be divided into multiple small terrain blocks based on the space where the target terrain is located. For example, a terrain space with a terrain size of 500×500×50 can be divided into multiple 50×50×50 three-dimensional grid spaces.

[0077] In another division scheme, the above two division schemes can be combined. For example, the entire target terrain block can be divided into multiple small terrain blocks based on the space where the target terrain is located. In a small terrain block, multiple smaller terrain areas can be obtained based on the surface of the terrain. The division can be performed according to different grid sizes, according to different landforms or materials, or in combination with multiple division strategies. For example, a grid can be divided into multiple terrain areas according to different landforms and materials.

[0078] It should be noted that those skilled in the art can customize specific division levels and specific division strategies as division schemes according to actual needs, and the present invention does not limit this.

[0079] In an optional embodiment, after displaying the target terrain and each terrain area, the method further includes: in response to a moving operation on a border of the terrain area, determining a moving distance corresponding to the moving operation; and moving the border of the terrain area to a target position according to the moving distance.

[0080] After displaying the target terrain and each terrain area in the target terrain to the user, the game engine can respond to the user's movement operation on the border of the terrain area, move the border of the terrain area to the target position according to the moving distance corresponding to the movement operation, and can update the border of the terrain area in real time, thereby adjusting the size of the terrain area.

[0081] Specifically, in response to a moving operation of a first position point on the border of the terrain area, during the moving process, the border of the terrain area can be updated in real time according to the position of the first position point and the position of the second position point. The first position point can be any pixel point on the border, and the second position point can be any pixel point farthest from the first position point along the moving path of the border.

[0082] In another optional embodiment, after displaying the target terrain and each terrain area, the user can select the first terrain area and move the first terrain area to the position of the second terrain area; the game engine can detect the movement operation on the first terrain area, and when it is detected that the target position corresponding to the movement operation is located at the position of the second terrain area, the second terrain area can be moved to the position of the first terrain area, and the first terrain area can be moved to the position of the second terrain area, thereby adjusting the size of the terrain area.

[0083] The embodiment of the present invention can adjust the size of the terrain area in the target terrain so that the terrain area that needs to be edited and corrected can be adjusted to the size expected by the user, so that the target editing algorithm can be applied to the terrain area that the user expects to edit and correct, thereby effectively improving work efficiency.

[0084] The game terrain generating device provided by the present invention is described below. The game terrain generating device described below and the game terrain generating method described above can be referenced to each other.

[0085] Figure 2 Schematic diagram of the structure of the game terrain generation device provided by the embodiment of the present invention. Figure 2 The embodiment of the present invention provides a game terrain generation device, which may specifically include the following modules: A first input module 201 is used to obtain terrain description information input by a user, input the terrain description information into a pre-trained first AI model, and obtain a terrain creation instruction output by the first AI model; The generating module 202 is used to generate the target terrain according to the terrain creation instruction.

[0086] In an optional embodiment, the terrain creation instruction includes parameters required for generating terrain, and the parameters required for generating terrain include at least terrain size, landform and material; the generation module includes: A terrain space determination submodule is used to determine the terrain space according to the target terrain size; A terrain model generation submodule, used to generate a terrain model corresponding to the target landform in the terrain space; The target terrain generation submodule is used to apply the target material on the surface of the terrain model to obtain the target terrain.

[0087] In an optional embodiment, the parameters required for generating terrain also include terrain layout, and the terrain layout is used to represent the position of landforms and materials in the terrain; the terrain model generation submodule includes: The terrain model generating unit is used to generate a terrain model corresponding to the target landform in the terrain space according to the target terrain layout.

[0088] In an optional embodiment, after generating the target terrain according to the terrain creation instruction, the method further includes: A division module, used for dividing the target terrain into a plurality of terrain regions, and displaying the target terrain and each terrain region; A second input module, used to obtain terrain area editing information input by a user, input the terrain area editing information into a pre-trained second AI model, and obtain a terrain area editing instruction output by the second AI model; The editing module is used to perform a target editing operation on the target terrain area according to the terrain area editing instruction.

[0089] In an optional embodiment, the second input module includes: An editing parameter determination submodule, used for inputting the terrain region editing information into a pre-trained second AI model, and the second AI model determines a target terrain region, a target editing algorithm, and editing parameters for configuring the target editing algorithm based on the terrain region editing information; A configuration submodule, used to configure the target editing algorithm using the editing parameters; The editing instruction generation submodule is used to generate terrain area editing instructions according to the configured target editing algorithm and the target terrain area.

[0090] In an optional embodiment, the AI ​​model is trained by the following modules: A sample data acquisition module, used to acquire sample data; the sample data includes a sample description and sample parameters for generating game terrain; The model training module is used to train the AI ​​model to be trained according to the sample data to obtain the AI ​​model.

[0091] In an optional embodiment, the division module includes: The terrain region division submodule is used to divide the target terrain into a plurality of terrain regions according to a preset division level and a preset division strategy.

[0092] In an optional embodiment, after displaying the target terrain and each terrain area, the method further includes: A response module, configured to respond to a movement operation on the border of the terrain area and determine a movement distance corresponding to the movement operation; The moving module is used to move the border of the terrain area to a target position according to the moving distance.

[0093] The embodiment of the present invention combines an AI model with a game engine, and uses the AI ​​model to understand the descriptive information input by the user. The AI ​​model generates corresponding operation instructions, and then the game engine generates the game terrain based on the generated operation instructions. Compared with the manual editing method of users in the prior art, the entry threshold can be lowered, work efficiency can be effectively improved, and development efficiency can be improved.

[0094] Figure 3An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the game terrain generation method, which includes: obtaining terrain description information input by a user, inputting the terrain description information into a pre-trained first AI model, obtaining a terrain creation instruction output by the first AI model; and generating a target terrain according to the terrain creation instruction.

[0095] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product 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.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0096] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the game terrain generation method provided by the above-mentioned methods, and the method includes: obtaining terrain description information input by a user, inputting the terrain description information into a pre-trained first AI model, and obtaining a terrain creation instruction output by the first AI model; generating a target terrain according to the terrain creation instruction.

[0097] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the game terrain generation method provided by the above-mentioned methods. The method includes: obtaining terrain description information input by a user, inputting the terrain description information into a pre-trained first AI model, and obtaining a terrain creation instruction output by the first AI model; and generating a target terrain according to the terrain creation instruction.

[0098] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating game terrain, characterized in that: include: Obtaining terrain description information input by a user, inputting the terrain description information into a pre-trained first AI model, and obtaining a terrain creation instruction output by the first AI model; According to the terrain creation instruction, a target terrain is generated.

2. The method according to claim 1, characterized in that The terrain creation instruction includes parameters required for generating terrain, and the parameters required for generating terrain include at least terrain size, landform and material; Generating the target terrain according to the terrain creation instruction includes: Determine the terrain space according to the target terrain size; Generating a terrain model corresponding to the target landform in the terrain space; Applying a target material to the surface of the terrain model to obtain a target terrain.

3. The method according to claim 2, characterized in that The parameters required for generating the terrain also include terrain layout, which is used to represent the location of landforms and materials in the terrain; generating a terrain model corresponding to the target landform in the terrain space includes: In the terrain space, a terrain model corresponding to the target landform is generated according to the target terrain layout.

4. The method according to claim 1, characterized in that: After generating the target terrain according to the terrain creation instruction, the method further includes: Dividing the target terrain into a plurality of terrain regions, and displaying the target terrain and each terrain region; Acquire terrain area editing information input by a user, input the terrain area editing information into a pre-trained second AI model, and obtain a terrain area editing instruction output by the second AI model; According to the terrain area editing instruction, a target editing operation is performed on the target terrain area.

5. The method according to claim 4, characterized in that The step of inputting the terrain region editing information into a pre-trained second AI model to obtain a terrain region editing instruction output by the second AI model includes: Inputting the terrain region editing information into a pre-trained second AI model, and having the second AI model determine a target terrain region, a target editing algorithm, and editing parameters for configuring the target editing algorithm based on the terrain region editing information; Using the editing parameters, configuring the target editing algorithm; A terrain region editing instruction is generated according to the configured target editing algorithm and the target terrain region.

6. The method according to claim 4, characterized in that The step of dividing the target terrain into a plurality of terrain regions comprises: The target terrain is divided into a plurality of terrain regions according to a preset division level and a preset division strategy.

7. The method according to claim 4, characterized in that After displaying the target terrain and each terrain area, the method further includes: In response to a movement operation on a border of a terrain area, determining a movement distance corresponding to the movement operation; The border of the terrain area is moved to a target position according to the moving distance.

8. A game terrain generating device, characterized in that: include: A first input module, used to obtain terrain description information input by a user, input the terrain description information into a pre-trained first AI model, and obtain a terrain creation instruction output by the first AI model; The generating module is used to generate the target terrain according to the terrain creation instruction.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the game terrain generation method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the game terrain generation method according to any one of claims 1 to 7 is implemented.