Game mountain terrain creation method, model training method and related devices

By generating ridgeline data through the training sample set and training the game mountain creation model, the problem of low efficiency in game mountain terrain generation in the existing technology is solved, and more efficient and realistic mountain terrain generation is achieved.

CN112686996BActive Publication Date: 2024-09-27BEIJING PIXEL SOFTWARE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011579146.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-28
Publication Date
2024-09-27
Estimated Expiration
2040-12-28

AI Technical Summary

Technical Problem

Existing technology requires manual operations when creating game mountain terrain, resulting in low generation efficiency and poor authenticity.

Method used

By obtaining a training sample set, including mountain sample pictures and height map data, ridgeline data is generated, and after pairing, the game mountain creation model is trained until the convergence conditions are met, and the pre-trained model is used to generate terrain height map data, reducing manual operations.

Benefits of technology

Improved the generation efficiency of the game's mountainous terrain, reduced manual operations, and improved the authenticity of the terrain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112686996B
    Figure CN112686996B
Patent Text Reader

Abstract

The present application proposes a method for creating a game mountain terrain, a model training method and related devices, which relate to the field of game processing technology. After obtaining a training sample set, the height map data corresponding to each training mountain sample image in the training sample set is used to generate ridge line data corresponding to each training mountain sample image, so that the height map data and ridge line data corresponding to each training mountain sample image in the training sample set are paired to generate a sample image pair training set, and then the sample image pair training set is used to train a game mountain creation model until the game mountain creation model meets the set convergence conditions; in this way, in the process of creating the game mountain terrain data, the obtained ridge line data can be used to directly generate the corresponding game mountain terrain data, thereby reducing the manual operation process and improving the generation efficiency of the game mountain terrain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of game processing technology, and in particular to a method for creating a game mountain terrain, a model training method and related devices. Background Art

[0002] In application scenarios such as three-dimensional games, objects such as mountains, lakes, and trees can be constructed in the game scene to enhance the realism of the game.

[0003] However, in some solutions for creating objects such as mountains, the object model needs to be manually created, resulting in low creation efficiency. Summary of the invention

[0004] The purpose of this application is to provide a game mountain terrain creation method, a model training method and related devices, which can improve the generation efficiency of game mountain terrain.

[0005] In order to achieve the above purpose, the technical solution adopted in this application is as follows:

[0006] In a first aspect, the present application provides a method for training a game mountain creation model, the method comprising:

[0007] Obtain a training sample set; wherein the training sample set includes a plurality of training mountain sample images and height map data corresponding to each training mountain sample image;

[0008] Generate ridgeline data corresponding to each of the training mountain sample images according to the height map data corresponding to each of the training mountain sample images;

[0009] Pairing the ridgeline data and height map data corresponding to each training mountain sample image in the training sample set to generate a sample image pair training set; wherein the sample image pair training set includes a plurality of training mountain sample image pairs, each training mountain sample image pair consisting of the ridgeline data and height map data corresponding to a training mountain sample image;

[0010] The game mountain range creation model is trained using the sample image training set until the game mountain range creation model meets the set convergence condition.

[0011] In a second aspect, the present application provides a method for creating a mountain terrain in a game, the method comprising:

[0012] Obtain target ridgeline data;

[0013] Input the target ridgeline data into a pre-trained game mountain range creation model, and obtain terrain height map data output by the game mountain range creation model; wherein the game mountain range creation model is trained using the above-mentioned game mountain range creation model training method;

[0014] The terrain height map data is input into a game engine, and game mountain terrain data output by the game engine is obtained.

[0015] In a third aspect, the present application provides a training device for creating a game mountain model, the device comprising:

[0016] A first processing module is used to obtain a training sample set; wherein the training sample set includes a plurality of training mountain sample images and height map data corresponding to each training mountain sample image;

[0017] The first processing module is further used to generate ridgeline data corresponding to each of the training mountain sample images according to the height map data corresponding to each of the training mountain sample images;

[0018] The first processing module is further used to pair the ridgeline data and height map data corresponding to each training mountain sample image in the training sample set to generate a sample image pair training set; wherein the sample image pair training set includes a plurality of training mountain sample image pairs, each training mountain sample image pair consisting of ridgeline data and height map data corresponding to a training mountain sample image;

[0019] The training module is used to train the game mountain creation model using the sample image training set until the game mountain creation model meets the set convergence condition.

[0020] In a fourth aspect, the present application provides a device for creating a mountain terrain in a game, the device comprising:

[0021] The second processing module is used to obtain target ridgeline data;

[0022] The second processing module is further used to input the target ridgeline data into a pre-trained game mountain creation model, and obtain terrain height map data output by the game mountain creation model; wherein the game mountain creation model is trained using the above-mentioned game mountain creation model training method;

[0023] The terrain generation module is used to input the terrain height map data into the game engine and obtain the game mountain terrain data output by the game engine.

[0024] In a fifth aspect, the present application provides an electronic device, comprising a memory for storing one or more programs; a processor; when the one or more programs are executed by the processor, the above-mentioned method for training a game mountain creation model or the method for creating a game mountain terrain is implemented.

[0025] In a sixth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for training a game mountain creation model or a method for creating a game mountain terrain.

[0026] The present application provides a method for creating a game mountain terrain, a model training method and related devices. After obtaining a training sample set, the height map data corresponding to each training mountain sample image in the training sample set is used to generate ridge line data corresponding to each training mountain sample image, so that the height map data and ridge line data corresponding to each training mountain sample image in the training sample set are paired to generate a sample image pair training set, and then the sample image pair training set is used to train the game mountain creation model until the game mountain creation model meets the set convergence conditions; in this way, in the process of creating the game mountain terrain data, the obtained ridge line data can be used to directly generate the corresponding game mountain terrain data, thereby reducing the manual operation process and improving the generation efficiency of the game mountain terrain.

[0027] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 A schematic structural block diagram of an electronic device provided by the present application is shown;

[0030] Figure 2 A schematic flow chart showing a method for training a game mountain creation model provided by the present application;

[0031] Figure 3 An exemplary flow chart showing a method for creating a mountain terrain for a game provided by the present application;

[0032] Figure 4 A schematic structural block diagram of a training device for creating a game mountain model provided by the present application is shown;

[0033] Figure 5 A schematic structural block diagram of a device for creating a mountain terrain for a game provided in the present application is shown.

[0034] In the figure: 100-electronic device; 101-memory; 102-processor; 103-communication interface; 400-training device for creating a game mountain range model; 401-first processing module; 402-training module; 500-game mountain range terrain creation device; 501-second processing module; 502-terrain generation module. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below in conjunction with the drawings in some embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Generally, the components of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0036] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents some selected embodiments of the present application. All other embodiments obtained by ordinary technicians in the field without creative work based on some embodiments in the present application are within the scope of protection of the present application.

[0037] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0038] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0039] In application scenarios such as the above-mentioned three-dimensional games, developers can use some software to generate a terrain height map including mountains, and perform grid stretching through each pixel value in the generated terrain height map to generate a game terrain including mountains.

[0040] Among them, in some implementations of generating terrain heightmaps, developers can use terrain software such as World Machine or Houdini to generate random terrain heightmaps containing mountains, and then use the randomly generated terrain heightmaps to stretch the mesh, and finally generate game terrain containing mountains.

[0041] However, the terrain height map randomly generated by terrain software has poor authenticity, and the game terrain surface obtained by stretching is generally smooth, which is quite different from the terrain surface in the real scene.

[0042] Therefore, in some related implementations, developers may also manually draw some terrain height maps containing mountains to improve the realism of the game terrain.

[0043] However, the implementation of the terrain height map manually drawn by developers requires more manual input and the efficiency of generating the game terrain is also low.

[0044] Therefore, based on the above-mentioned defects, the present application provides a game mountain terrain creation method, a model training method and related devices to reduce the manual operation process and improve the generation efficiency of the game mountain terrain in the process of creating game mountain terrain data.

[0045] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0046] See also Figure 1 , Figure 1 A schematic structural block diagram of an electronic device 100 provided by the present application is shown, and the electronic device 100 may include a memory 101, a processor 102, and a communication interface 103. The memory 101, the processor 102, and the communication interface 103 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines.

[0047] The memory 101 can be used to store software programs and modules, such as the program instructions / modules corresponding to the training device for creating a game mountain model or the game mountain terrain creation device provided in the present application. The processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 101, thereby executing the training method for creating a game mountain model or the steps of the game mountain terrain creation method provided in the present application. The communication interface 103 can be used to communicate signaling or data with other node devices.

[0048] Among them, the memory 101 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable programmable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.

[0049] The processor 102 may be an integrated circuit chip with signal processing capability. The processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0050] Understandably, Figure 1 The structure shown is for illustration only. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0051] Below Figure 1The electronic device 100 shown is used as an illustrative execution entity to exemplify the training method of the game mountain creation model provided in the present application, wherein the electronic device 100 may store a pre-created game mountain creation model having some initial model parameters.

[0052] See also Figure 2 , Figure 2 A schematic flow chart showing a method for training a game mountain creation model provided by the present application may include the following steps:

[0053] Step 201: Obtain a training sample set.

[0054] Step 203: Generate ridgeline data corresponding to each training mountain sample image based on the height map data corresponding to each training mountain sample image.

[0055] Step 205 , pairing the ridgeline data and height map data corresponding to each training mountain sample image in the training sample set to generate a sample image pair training set.

[0056] Step 207, using the sample images to train the game mountain range creation model, until the game mountain range creation model meets the set convergence conditions.

[0057] In some embodiments, the electronic device may first obtain a training sample set during the process of training the game mountain creation model, wherein the training sample set may include multiple training mountain sample images and height map data corresponding to each training mountain sample image.

[0058] For example, the training mountain sample images included in the training sample set may be images obtained through DEM (Digital Elevation Model), and the height corresponding to each pixel point in the training mountain sample images may be obtained through DEM.

[0059] Next, for each training mountain sample image in the training sample set, the electronic device can use methods such as the central axis algorithm to extract the ridge line data corresponding to each training mountain sample image based on the height map data corresponding to each training mountain sample image. Among them, in some possible scenarios, based on the different thicknesses of the ridges, the ridge line data extracted by the electronic device also have some differences; for example, for training mountain sample images that include thicker ridges, the corresponding ridge line data is relatively dense; and for training mountain sample images that include thinner ridges, the corresponding ridge line data is relatively sparse.

[0060] Then, the electronic device can pair the ridge line data and height map data corresponding to each training mountain sample image in the training sample set, that is, pair the ridge line data and height map data corresponding to a training mountain sample image into a training mountain sample image pair; in this way, after all the training mountain sample images are paired, a sample image pair training set is generated, and the sample image pair training set includes multiple training mountain sample image pairs.

[0061] Next, based on the generated sample image pair training set, the electronic device can use the sample image pair training set to train the game mountain creation model, so that the trained game mountain creation model can learn the mapping relationship between the ridge line data and the height map data, until the game mountain creation model meets the set convergence conditions, and save the model parameters of the game mountain creation model at this time.

[0062] In this way, for the above-mentioned trained game mountain creation model, a drawn ridge line image data can be input into the trained game mountain creation model to obtain the height map output by the trained game mountain creation model, and then the output height map is used to generate the game terrain.

[0063] Among them, in some possible implementations, based on the different sizes of image inputs of different models, the electronic device may store a preset image database, and the preset image database may store training mountain sample images with different image size rules.

[0064] Based on this, when executing step 201, the electronic device can filter out all training mountain sample images that meet the received image size specifications from the preset image database according to the received image size specifications, and use all the filtered training mountain sample images as the training sample set.

[0065] For example, assuming that the preset image database includes multiple training mountain sample images of four sizes: 128*128, 256*256, 512*512, and 1024*1024, and the image size specification received by the electronic device is 256*256, the electronic device can use all training mountain sample images of a size of 256*256 in the preset image database as the training sample set.

[0066] In this way, by pre-saving multiple training mountain sample images of different image size specifications in a preset image database, and then combining the received image size specifications, all training mountain sample images that meet the received image size specifications are screened out in the preset image database as a training sample set to improve the adaptability of the model for different input size requirements.

[0067] It is understandable that, since a large number of training mountain sample images need to be stored in the above-mentioned preset image database, some implementation methods may be adopted to pre-store a large number of training mountain sample images in the preset image database.

[0068] For example, in some embodiments, in the process of constructing the preset image database, multiple initial height maps can be first screened out from the data elevation model database; for example, global DEM data collected by satellites can be used, and tools such as WorldMachine can be used to filter the collected global DEM data in combination with the configured altitude information filtering conditions and data coverage area filtering conditions to output a large amount of high-precision height map data, such as outputting 10,000 8k (8192*8192 resolution) height maps.

[0069] Next, for each initial height map, each initial height map is segmented into multiple images according to the set multiple size specifications, and all the segmented images are classified and saved in a preset image database according to each size specification. For example, referring to the above example, the set multiple size specifications can be the four sizes of 128*128, 256*256, 512*512, and 1024*1024 in the above example. For each initial height map, it can be segmented according to the four sizes of 128*128, 256*256, 512*512, and 1024*1024, and the segmented images are saved in folders corresponding to each size, and then the segmented images are saved in the preset image database by saving the folders corresponding to each size in the preset image database.

[0070] It is worth noting that in some possible implementations, after the initial height map is segmented, since the segmented images may not contain ridge information, in the process of constructing the preset image database, for all segmented images, images that have lost valid information can also be filtered. For example, ridge information can be used as a filtering condition to filter out images that do not contain ridge information.

[0071] In addition, in some embodiments, the game mountain creation model can be created based on a generative adversarial network, wherein the game mountain creation model can include a generator neural network and a discriminator neural network. Exemplarily, in some possible implementations, the generator neural network can be constructed using a U-Net network structure, and the discriminator neural network can be constructed using a Patch-D network structure.

[0072] Based on this, when the electronic device executes step 207 to train the game mountain creation model, it can first input the ridgeline data in each training mountain sample image pair into the generator neural network to obtain the reference height map data corresponding to each training mountain sample image pair, that is: the generator neural network first uses the ridgeline data to generate a "fake" height map data.

[0073] Then, the height map data corresponding to each training mountain sample image pair and the reference height map data are input into the discriminator neural network, and the height map discriminant vector and the reference height map discriminant vector corresponding to the height map data and the reference height map data are obtained, that is, the discriminator neural network processes the "fake" height map data and the "real" height map data in the training mountain sample image pair respectively to obtain the corresponding vectors of the two.

[0074] Next, based on each training mountain sample image, the corresponding height map discriminant vector and the reference height map discriminant vector are respectively passed into the generator's loss function and the discriminator's loss function, so as to calculate the loss values ​​of the generator and the discriminator respectively, and then the model parameters of the generator neural network and the discriminator neural network are updated respectively through algorithms such as Adam (Adaptive Moment Estimation) until the models of the generator neural network and the discriminator neural network converge (for example, 400 parameter iterations have been performed), and finally the generator neural network continuously generates realistic height map data, making it impossible for the discriminator to distinguish between "fake" height map data and "real" height map data.

[0075] It can be understood that, in some possible implementations, in the process of inputting multiple training mountain sample images in the sample image training set into the game mountain creation model for training, all training mountain sample images in the sample image training set can be divided into multiple training data packets according to the batch size of the game mountain creation model, and each training data packet includes the same number of training mountain sample images.

[0076] In addition, during the training process of the game mountain creation model, when the game mountain creation model fails to reach the set convergence conditions (for example, the number of parameter iterations mentioned above does not reach 400 times), then in the next training process of the game mountain creation model, the arrangement order of multiple training mountain sample images in the sample image training set can be adjusted, and then the game mountain creation model can be continued to be trained, thereby ensuring that the data for each training of the game mountain creation model is different, thereby increasing the stability of the training.

[0077] Furthermore, in some embodiments, in the process of generating a sample picture pair training set, a sample picture pair verification set can also be generated, and the sample picture pair test set can include multiple test mountain sample picture pairs; in the process of training the game mountain creation model, the model parameters of the game mountain creation model can be saved according to a certain number of steps, for example, the model parameters of the game mountain creation model can be saved every 20 training times; thus, after the training converges, the electronic device can use the most stable model parameters of the corresponding loss function curve as the target parameters of the game mountain creation model based on all the saved model parameters, and then use the multiple test mountain sample picture pairs in the sample picture pair test set to test and verify the game mountain creation model configured with the target parameters.

[0078] In addition, after the game mountain creation model is trained using the above-mentioned training method provided in this application, the trained game mountain creation model can be used to create game terrain.

[0079] Below Figure 1 The electronic device 100 shown is used as an exemplary execution body to schematically illustrate the game mountain terrain creation method described in the present application.

[0080] It should be noted that, in some embodiments, the electronic device that executes the game mountain terrain creation method provided in the present application and the electronic device that executes the game mountain creation model training method provided in the present application can be the same device or different devices, and the present application does not limit this.

[0081] For example, see Figure 3 , Figure 3 An exemplary flow chart of a method for creating a mountain terrain in a game provided by the present application is shown. The method for creating a mountain terrain in a game may include the following steps:

[0082] Step 301, obtaining target ridgeline data.

[0083] Step 303: input the target ridgeline data into the pre-trained game mountain creation model, and obtain the terrain height map data output by the game mountain creation model.

[0084] Step 305, input the terrain height map data into the game engine, and obtain the game mountain terrain data output by the game engine.

[0085] In some embodiments, the electronic device may store a game mountain range creation model, and the game mountain range creation model may be trained using, for example, the above-mentioned game mountain range creation model training method.

[0086] Based on this, when an electronic device is executing the game mountain terrain creation method provided in the present application, a developer can input a target ridge line data into the electronic device; then, the electronic device inputs the target ridge line data into the game mountain creation model, so that the game mountain creation model outputs the terrain height map data corresponding to the target ridge line data based on the learned mapping relationship between the ridge line and the terrain height.

[0087] Next, the electronic device can input the terrain height map data into the game engine for rendering, thereby obtaining the game mountain terrain data output by the game engine.

[0088] Thus, based on the above scheme provided by the present application, after obtaining the training sample set, the height map data corresponding to each training mountain sample image in the training sample set is used to generate the ridge line data corresponding to each training mountain sample image, thereby pairing the height map data and ridge line data corresponding to each training mountain sample image in the training sample set to generate a sample image pair training set, and then the sample image pair training set is used to train the game mountain creation model until the game mountain creation model meets the set convergence conditions; thus, in the process of creating the game mountain terrain data, the obtained ridge line data can be used to directly generate the corresponding game mountain terrain data, thereby reducing the manual operation process and improving the generation efficiency of the game mountain terrain.

[0089] In addition, based on the same inventive concept as the training method for the game mountain creation model provided in this application, please refer to Figure 4 , Figure 4 A schematic structural block diagram of a training device 400 for creating a game mountain range model provided in the present application is shown. The training device 400 for creating a game mountain range model may include a first processing module 401 and a training module 402 .

[0090] The first processing module 401 is used to obtain a training sample set; wherein the training sample set includes a plurality of training mountain sample images and height map data corresponding to each training mountain sample image;

[0091] The first processing module 401 is also used to generate ridgeline data corresponding to each training mountain sample image according to the height map data corresponding to each training mountain sample image;

[0092] The first processing module 401 is also used to pair the ridgeline data and height map data corresponding to each training mountain sample image in the training sample set to generate a sample image pair training set; wherein the sample image pair training set includes a plurality of training mountain sample image pairs, and each training mountain sample image pair is composed of the ridgeline data and height map data corresponding to a training mountain sample image;

[0093] The training module 402 is used to train the game mountain creation model using the sample image training set until the game mountain creation model meets the set convergence condition.

[0094] Optionally, in some possible implementations, the game mountain creation model is created based on a generative adversarial network, and the game mountain creation model includes a generator neural network and a discriminator neural network;

[0095] The training module 402 trains the game mountain creation model using the sample images of the training set until the game mountain creation model meets the set convergence conditions, specifically for:

[0096] Input the ridgeline data in each training mountain sample image pair into the generator neural network to obtain the reference height map data corresponding to each training mountain sample image pair;

[0097] Input the height map data and reference height map data corresponding to each training mountain sample image into the discriminator neural network, and obtain the height map discriminant vector and reference height map discriminant vector corresponding to the height map data and the reference height map data;

[0098] Based on the corresponding height map discriminant vector and reference height map discriminant vector of each training mountain sample image, the model parameters of the generator neural network and the discriminator neural network are updated respectively until the models of the generator neural network and the discriminator neural network converge.

[0099] Optionally, in some possible implementations, during the process of training the game mountain creation model, when the game mountain creation model does not reach a set convergence condition, the training module 402 is further used to:

[0100] After adjusting the arrangement order of multiple training mountain sample images in the sample image training set, continue to train the game mountain creation model.

[0101] Optionally, in some possible implementations, when acquiring the training sample set, the first processing module 401 is specifically configured to:

[0102] All training mountain sample images that meet the received image size specifications are screened out from a preset image database, and all the screened out training mountain sample images are used as a training sample set.

[0103] Optionally, in some possible implementations, the preset image database is constructed in the following manner:

[0104] Filtering multiple initial height maps from the data elevation model database;

[0105] Each initial height map is segmented into multiple images according to the set multiple size specifications, and all the segmented images are classified and saved in a preset image database according to each size specification.

[0106] In addition, based on the same inventive concept as the above-mentioned game mountain terrain creation method provided in this application, please refer to Figure 5 , Figure 5 A schematic structural block diagram of a game mountain terrain creation device 500 provided in the present application is shown. The game mountain terrain creation device 500 may include a second processing module 501 and a terrain generation module 502.

[0107] The second processing module 501 is used to obtain target ridgeline data;

[0108] The second processing module 501 is also used to input the target ridgeline data into the pre-trained game mountain creation model, and obtain the terrain height map data output by the game mountain creation model; wherein the game mountain creation model is trained using the above-mentioned game mountain creation model training method;

[0109] The terrain generation module 502 is used to input terrain height map data into the game engine and obtain game mountain terrain data output by the game engine.

[0110] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to some embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and the module, program segment or a part of a code includes one or more executable instructions for implementing a specified logical function.

[0111] It should also be noted that in some alternative implementations, the functions marked in the blocks may also occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved.

[0112] It should also be noted that each box in the block diagram and / or flowchart, and combinations of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0113] In addition, in some embodiments of the present application, the functional modules may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0114] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in some embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories, random access memories, magnetic disks or optical disks.

[0115] The above description is only a partial embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0116] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the present application is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present application. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

Claims

1. A training method for creating a game mountain range model, It is characterized in that The method comprises: Obtain a training sample set; wherein the training sample set includes a plurality of training mountain sample images and height map data corresponding to each training mountain sample image; Generate ridgeline data corresponding to each of the training mountain sample images according to the height map data corresponding to each of the training mountain sample images; Pairing the ridgeline data and height map data corresponding to each training mountain sample image in the training sample set to generate a sample image pair training set; wherein the sample image pair training set includes a plurality of training mountain sample image pairs, each training mountain sample image pair consisting of the ridgeline data and height map data corresponding to a training mountain sample image; Using the sample images to train the game mountain range creation model until the game mountain range creation model meets the set convergence conditions; The game mountain creation model is created based on a generative adversarial network, and the game mountain creation model includes a generator neural network and a discriminator neural network; The using the sample images to train the game mountain range creation model until the game mountain range creation model meets the set convergence condition includes: Inputting the ridgeline data in each of the training mountain sample image pairs into the generator neural network to obtain the reference height map data corresponding to each of the training mountain sample image pairs; Inputting the height map data and the reference height map data corresponding to each of the training mountain sample images into the discriminator neural network, and obtaining the height map discriminant vector and the reference height map discriminant vector corresponding to the height map data and the reference height map data; Based on the height map discriminant vector and the reference height map discriminant vector corresponding to each of the training mountain sample images, the model parameters of the generator neural network and the discriminator neural network are updated respectively until the models of the generator neural network and the discriminator neural network converge.

2. The method according to claim 1, It is characterized in that In the process of training the game mountain creation model, when the game mountain creation model does not reach the set convergence condition, the method further includes: After adjusting the arrangement order of the plurality of training mountain sample image pairs in the sample image pair training set, the game mountain creation model continues to be trained.

3. The method according to claim 1, It is characterized in that The step of obtaining a training sample set includes: All training mountain sample images that meet the received image size specifications are screened out from a preset image database, and all the screened out training mountain sample images are used as a training sample set.

4. The method according to claim 3, It is characterized in that The preset image database is constructed in the following manner: Filtering multiple initial height maps from the data elevation model database; Each initial height map is segmented into multiple images according to the set multiple size specifications, and all the segmented images are classified and saved in a preset image database according to each size specification.

5. A method for creating mountain terrain in a game, It is characterized in that The method comprises: Obtain target ridgeline data; Input the target ridgeline data into a pre-trained game mountain creation model, and obtain terrain height map data output by the game mountain creation model; wherein the game mountain creation model is trained using the training method for the game mountain creation model according to any one of claims 1 to 4; The terrain height map data is input into a game engine, and game mountain terrain data output by the game engine is obtained.

6. A training device for creating a game mountain model, It is characterized in that The device comprises: A first processing module is used to obtain a training sample set; wherein the training sample set includes a plurality of training mountain sample images and height map data corresponding to each training mountain sample image; The first processing module is further used to generate ridgeline data corresponding to each of the training mountain sample images according to the height map data corresponding to each of the training mountain sample images; The first processing module is further used to pair the ridgeline data and height map data corresponding to each training mountain sample image in the training sample set to generate a sample image pair training set; wherein the sample image pair training set includes a plurality of training mountain sample image pairs, each training mountain sample image pair consisting of ridgeline data and height map data corresponding to a training mountain sample image; A training module, used to train the game mountain creation model using the sample image training set until the game mountain creation model meets the set convergence condition; The game mountain creation model is created based on a generative adversarial network, and the game mountain creation model includes a generator neural network and a discriminator neural network; The training module is specifically used for: Inputting the ridgeline data in each of the training mountain sample image pairs into the generator neural network to obtain the reference height map data corresponding to each of the training mountain sample image pairs; Inputting the height map data and the reference height map data corresponding to each of the training mountain sample images into the discriminator neural network, and obtaining the height map discriminant vector and the reference height map discriminant vector corresponding to the height map data and the reference height map data; Based on the height map discriminant vector and the reference height map discriminant vector corresponding to each of the training mountain sample images, the model parameters of the generator neural network and the discriminator neural network are updated respectively until the models of the generator neural network and the discriminator neural network converge.

7. A device for creating mountain terrain in a game, It is characterized in that The device comprises: The second processing module is used to obtain target ridgeline data; The second processing module is further used to input the target ridgeline data into a pre-trained game mountain creation model, and obtain terrain height map data output by the game mountain creation model; wherein the game mountain creation model is trained using the training method for the game mountain creation model according to any one of claims 1 to 4; The terrain generation module is used to input the terrain height map data into the game engine and obtain the game mountain terrain data output by the game engine.

8. An electronic device, It is characterized in that include: A memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 4 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.