A method for mountain generation in hexagon tessellation map
By receiving the basic mountain module, defining the mountain range area, and merging them, the problem of low efficiency and poor effect in generating mountains in hexagonal tiling maps is solved, realizing the efficient generation of continuous mountain ranges and supporting the rapid iteration of art resources and the flexibility of map design.
Patent Information
- Application Number
- CN202210973929.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-15
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-08-15
AI Technical Summary
Existing technologies suffer from high repetition, lack of vividness, and low generation efficiency when generating mountain effects in hexagonal tessellation maps, especially in mobile and PC games where it is difficult to achieve efficient generation of continuous mountain ranges.
By receiving the input mountain base module, the area where the mountain range needs to be generated is defined, and the mountain modules are placed according to specific rules to fill the mountain range area. Virtual textures and depth fading technology are used for fusion, independent art asset production and map design, and generation efficiency is improved.
It achieves the effect of generating continuous mountain ranges in hexagonal tessellation maps, reduces memory usage and storage space consumption, improves workflow efficiency, and supports rapid iteration of art assets and flexibility in map design.
Smart Images

Figure CN115330965B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of interactive media scene procedural generation, in particular to a method for mountain generation in hexagonally packed map. BACKGROUND
[0002] Mountain effect is an important part of the picture performance in interactive media such as games, and most interactive media involving outdoor environments almost need to invest in the research and development of mountain effect. With the improvement of hardware technology and the iteration of research and development software, the mountain effect in interactive media also needs to have more and more rich and realistic performance. For example, strategy games that require large geographical span and more geographical elements are the most demanding subcategory of interactive media in terms of mountain effect. Although many high-profile, high-yield, and high-single-payment works or work series (such as the Civilization series, the Romance of the Three Kingdoms series, etc.) have been born in these categories, there is still room for improvement in their performance effects:
[0003] 1. Mobile phone network games in this category often use square packed maps (such as Rat Soil, The Three Kingdoms Strategy Edition) because of the poor performance of mobile phone hardware, the need for continuous update and iteration of game maps, and the need to accommodate a large number of players. However, the performance effect will have high repetition and monotonous problems. Figure 1
[0004] 2. PC games in this category (such as recent works in the Civilization series, Humankind, etc.) usually use hexagonally packed maps to improve playability and performance effects due to less performance limitations. However, since these games often need to generate a map randomly for each start, there are requirements for the time and performance of map generation, so the generated mountains are relatively simple and linearly linked, making it difficult to achieve the effect of continuous mountains. At the same time, there are also problems of high repetition and lack of vitality. Figure 2
[0005] 3. There are many studies on mountain generation and mountain erosion beautification in the academic field. However, on the one hand, there is a lack of ability to generate large-volume maps with high performance in the academic field, and on the other hand, the generation is focused on simulating the effects of the real world, making it difficult to adapt to the hexagonally packed and square packed maps commonly used in this category of interactive media, and there is a gap between the actual needs of the industry.
[0006] Overall, the quadrilateral grid is widely used due to the wide application scenarios, and has equivalent description forms with various picture technologies, height fields in games, etc. The quadrilateral grid can easily fill the delineated area without missing or overlapping. However, it is difficult to ensure the natural controllability of the shape while filling the area without missing or overlapping. However, for the most needed large and continuous mountain range with abundant mountain range effects in the industry, there is a lack of efficient generation process and algorithm of large and continuous mountain range that can be used to represent the best effect of the map form (hexagonal dense map). SUMMARY
[0007] The purpose of the present application is to solve the technical problems of poor mountain generation effect and low efficiency, and to provide a method for mountain generation in a hexagonal dense map, comprising the following steps:
[0008] S1: receiving an input mountain base module;
[0009] S2: receiving delineation of a mountain range area in the input map that needs to generate a mountain range;
[0010] S3: placing the mountain base module to fill the mountain range area, and generating a mountain effect in the map.
[0011] In some embodiments, the method for generating the mountain base module in step S1 comprises the following steps:
[0012] S1-1: producing mountain modules according to project requirements, each of the mountain modules covering a hexagonal grid area arranged in a specific manner, determining the area covered by each of the mountain modules, and generating a simple base shape to obtain a height map;
[0013] S1-2: refining the height map to obtain a base model;
[0014] S1-3: calculating the base model parameters to obtain the mountain base module;
[0015] In some embodiments, after determining the area covered by each module, the method for generating a simple base shape to obtain a height map in step S1-1 comprises the following steps:
[0016] S1-1-1: subdividing the area covered by each of the mountain modules, and setting at least one vertex;
[0017] S1-1-2: calculating the shortest distance from each vertex to the outer contour of the mountain module;
[0018] S1-1-3: setting the vertical coordinate of each vertex as the shortest distance from the vertex to the outer contour;
[0019] S1-1-4: vertically scaling the vertical coordinate of each vertex.
[0020] S1-1-5: Convert the outer contour and the scaled vertex to a height map.
[0021] In some embodiments, the method of calculating the base model parameters in step S1-3 to obtain the mountain base module includes the following steps:
[0022] S1-3-1 Extract the edge line of the module, and require that each point on the line and its two adjacent points cannot all be on the same straight line, otherwise delete the point and connect the two adjacent points of the point, repeat this step until all points meet the requirements;
[0023] S1-3-2 For each hexagon of the region, calculate the distance from each vertex to the nearest point on the module edge line obtained in step S1-3-1, and take the average value as D;
[0024] S1-3-3 For each hexagon of the region, calculate the vector distance from the center point to the center point of the hexagon with the highest D value, and record it as P;
[0025] S1-3-4 Record the highest D value in all hexagons as Dmax;
[0026] S1-3-5 Record the number of hexagons covered by the module as A;
[0027] S1-3-6 Arrange all modules first according to the A value from high to low, and then according to the Dmax value from high to low.
[0028] In some embodiments, the method of delineating the mountain region in the map where the mountain needs to be generated in step S2 includes the following steps:
[0029] S2-1: Delineate the region where the mountain needs to be generated on the large map, temporarily delete the hexagons where the mountain does not need to be generated, and each connected region is a mountain region;
[0030] S2-2: For each mountain region obtained in step S2-1, perform steps S1-3-2 and S1-3-4.
[0031] In this embodiment, the delineation of the mountain region in the map where the mountain needs to be generated can be manually delineated or generated by a random algorithm.
[0032] In some embodiments, regarding each hexagon with a side length of 1, the method of placing mountain modules to fill the mountain region in step S3 includes the following steps:
[0033] S3-1: Preprocessing, let S, F be the set of all hexagons of the mountain region;
[0034] S3-2: The first round of placing, the modules that can be placed in the first round need to satisfy: the Dmax of the module is greater than 1, the Dmax of the module is less than or equal to the Dmax of the mountain area, and the arrangement order of the module follows the sorting rule of step S1-3-6;
[0035] S3-2-1: Find the hexagon H with the largest D value in S;
[0036] S3-2-2: Align the hexagon with the largest D value of the module at the top of the sorting with the hexagon H, if S contains all the covered hexagons of the module or there is no module that can be placed, go to the next step, otherwise, remove the module from the set of modules that can be placed, repeat this step;
[0037] S3-2-3: Remove all hexagons covered by the module in step S3-2-2 from S, and perform step S1-3-2 on S, and remove all hexagons with a D value greater than or equal to 1 from F that are covered by the module in step S3-2-2;
[0038] S3-2-4: Repeat steps S3-2-1 to S3-2-3 until there is no module that can be placed;
[0039] In some embodiments, the placing of the mountain modules to fill the mountain area in step S3 further comprises the following steps:
[0040] S3-3: The second round of placing, S is equal to F, and F is the set of all hexagons in the mountain area, and the modules that can be placed in the second round need to satisfy: the Dmax of the module is less than or equal to the Dmax of the mountain area, and the arrangement order of the module follows the sorting rule of step S1-3-6;
[0041] S3-3-1: Assign the D value in F to the corresponding hexagon in S;
[0042] S3-3-2: Find the hexagon H with the largest D value in S;
[0043] S3-3-3: Align the hexagon with the largest D value of the module at the top of the sorting with the hexagon H, if F contains all the covered hexagons of the module, go to the next step, otherwise, remove the module from the set of modules that can be placed, repeat this step;
[0044] S3-3-4: Remove all hexagons covered by the module in step S3-3-3 from S and F. Repeat step S1-3-2 on F, and then repeat step S3-3-1;
[0045] S3-3-5: Repeat steps S3-3-2 to S3-3-4 until all hexagons are covered by at least one module.
[0046] In some embodiments, if the obtained mountain body has a joint that affects the visual effect, a suitable joint elimination fusion scheme can be selected according to the project requirements, including: using a virtual texture technology to fuse the two placed mountain bodies; using a depth recession technology to fuse the two placed mountain bodies.
[0047] In some embodiments, between step S1-2 and step S1-3, an expansion base model is set, including the following steps:
[0048] S4: Align the base model with the area covered by it;
[0049] S5: Rotate all base models by 60 degrees, 120 degrees, 180 degrees, 240 degrees, and 300 degrees around the center point, and if any of the rotated base models is not completely the same as any existing base model, it is recorded as a new base model;
[0050] S6: Mirror all base models along the X axis, and if the obtained base model is not completely the same as any existing base model, it is recorded as a new base model.
[0051] The beneficial effects of the present application include: the mountain base module manufacturing, the map mountain area demarcation, and the generation of mountains in the corresponding area are independent of each other, so that the work of artists, map designers, and algorithms are decoupled, improving the efficiency of the work process;
[0052] The method of the present application makes the artist only responsible for the manufacturing and iteration of a small number of base modules, without worrying about the shape of thousands of mountains in the entire map, which can further improve the detail effect;
[0053] Using the work process of the present application, the map designer can quickly preview the generation effect in the demarcated mountain area, facilitating the work and reducing the adjustment cost;
[0054] Since only the data of dozens of modules need to be stored, the memory / graphics memory occupation and storage space consumption are reduced, so that mobile terminals with limited performance can also use hexagonal close-packed maps with excellent performance. BRIEF DESCRIPTION OF DRAWINGS
[0055] The drawings described herein are used to provide further understanding of the present application, and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation on the present application. In the drawings:
[0056] Figure 1 is a schematic diagram of the repeated effect of the square close-packed map used in the existing mobile terminal strategy game product;
[0057] Figure 2is a schematic diagram of a simple, linearly connected mountain range generated by using a hexagonal close-packed map in a PC game;
[0058] Figure 3 is a flowchart of a mountain generation step in a hexagonal close-packed map according to an embodiment of the present application;
[0059] Figure 4 is a schematic diagram of a hexagonal grid region covered by a module used in an embodiment of the present application;
[0060] Figure 5a is a schematic diagram of a subdivision of a coverage range of each module according to an embodiment of the present application;
[0061] Figure 5b is a schematic diagram of a calculation of a distance from each vertex to an outline of a module according to an embodiment of the present application;
[0062] Figure 5c is a schematic diagram of a setting of a vertical coordinate of each vertex to a distance from the vertex to an outline according to an embodiment of the present application;
[0063] Figure 5d is a schematic diagram of a vertical overall scaling of a mountain module according to an embodiment of the present application;
[0064] Figure 5e is a schematic diagram of a conversion of each module to a height map according to an embodiment of the present application;
[0065] Figure 6 is a schematic diagram of a generation of a mountain region according to an embodiment of the present application;
[0066] Figure 7a is a schematic diagram of a mountain module that has been placed in a first round of placement according to an embodiment of the present application;
[0067] Figure 7b is a hexagon included in S in a first round of placement according to an embodiment of the present application;
[0068] Figure 7c is a hexagon H having a largest D value in S in a first round of placement according to an embodiment of the present application (aligning the hexagon having the largest D value of the top-ranked placeable module with the hexagon H);
[0069] Figure 7d is a removal of all covered hexagons from S in a first round of placement according to an embodiment of the present application;
[0070] Figure 7e is a schematic diagram of a repetition of the effects of Figure 7c , Figure 7d in a first round of placement according to an embodiment of the present application;
[0071] Figure 7f is a schematic diagram of an effect after a first round of placement according to an embodiment of the present application;
[0072] Figure 8a is a mountain module that has been placed when the second round of placement of the embodiment of the present application is performed;
[0073] Figure 8b is a hexagon contained in F when the second round of placement of the embodiment of the present application is performed;
[0074] Figure 8c is a hexagon H with the largest D value in S when the second round of placement of the embodiment of the present application is performed, and the hexagon with the largest D value of the top-ranked placeable module is aligned with the hexagon H;
[0075] Figure 8d is all hexagons covered by a F when the second round of placement of the embodiment of the present application is performed;
[0076] Figure 8e is a schematic diagram of the effect after the second round of placement of the embodiment of the present application is performed;
[0077] Figure 9 is a schematic diagram of the effect preview of the embodiment of the present application. DETAILED DESCRIPTION
[0078] The present application will be further described below with reference to the accompanying drawings and in conjunction with the preferred embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0079] It should be noted that the left, right, up, down, top, bottom, and the like in the present embodiment are only relative concepts, or are referenced to the normal use state of the product, and should not be considered as limiting.
[0080] For the interactive media of the above-mentioned type, it is unrealistic for the mountains in the large map to be completely manually produced by 3D artists and scene artists, and program assistance is needed. However, if the artists need to frequently change the style of the scene and iterate the visual performance of the mountains, and at the same time, the designers also need to frequently adjust which areas in the map need to generate mountains, if the art style is also affected by the program, there is a serious coupling of work types in the production process, and the art level of the program developers may not meet the requirements of the artists. Therefore, the process in the present application completely decouples the production of art resources from the generation of mountains in the large map, the artists produce basic mountain modules, the designers and scene artists then demarcate the areas in the map that need to generate mountains according to the product interactive experience requirements, and then use the algorithm of the present application to generate mountain effects in the areas, and finally, the generated mountain effects are fused according to the project requirements, and the present application does not limit the final fusion step.
[0081] According to the embodiment of the present application, a method for mountain generation in hexagonally packed map is provided, and the specific generation method mainly comprises the following steps: firstly, setting a mountain base module for receiving input; secondly, demarcating a mountain area in the map for receiving input, and the mountain area needs to generate a mountain range; and finally, placing the mountain base module to fill the mountain area, and generating a mountain effect in the map.
[0082] I. Mountain module production process
[0083] In the embodiment, an artist needs to produce a basic mountain module according to the project requirements and the artistic requirements. Each module covers a hexagonal grid area arranged in a specific manner. The hexagonal grid area covered by the module used in the present application is shown in the darkest area in the first two rows of Figure 4 The remaining modules can be defined according to the project requirements and the area of the mountain.
[0084] In the embodiment, after the area covered by each module is determined, a simple base shape is needed for the mountain generation, and then a height map is obtained, as shown in Figures 5a to 5e In step S1-1-1,
[0085] (1) As shown in Figure 5a , the area covered by each mountain module is subdivided, the number of vertices is increased, and at least one vertex is set;
[0086] (2) As shown in Figure 5b , the distance from each vertex to the outer contour of the mountain module is calculated;
[0087] (3) As shown in Figure 5c , the vertical coordinate of each vertex is set as the distance from the vertex to the outer contour;
[0088] (4) As shown in Figure 5d , the vertical scaling is performed;
[0089] (5) Then, it is converted into a height map, as shown in Figure 5e
[0090] After obtaining the base height map of each module, it can be handed over to a 3D artist for detailed model making, and the model, texture, and material of each module are obtained. Since one of the focuses of the present application is to support the iteration of artistic assets, the production mode and process of a single model are not specified.
[0091] As shown above, after the art department completes the module model, the following operations are performed on each module: align the base model with the area it covers; rotate all base models by 60 degrees, 120 degrees, 180 degrees, 240 degrees, and 300 degrees around the center point; if the base model obtained by any one of the rotations is not completely the same as any of the original modules, it is recorded as a new base model; mirror all base models along the X axis, and if the base model obtained is not completely the same as any of the existing base models, it is recorded as a new base model.
[0092] In this embodiment, the following operations are performed on each module after amplification (in the following discussion, the length of each hexagon is considered to be 1):
[0093] 1. Extract the edge lines of the module. It is required that each point on the line and its two adjacent points cannot all be on the same straight line, otherwise delete the point and connect the two adjacent points of the point, and repeat this step until all points meet the requirements.
[0094] 2. For each hexagon of the area, calculate the distance from each vertex to the nearest point on the module edge line obtained in step 2, and take the average value as D.
[0095] 3. For each hexagon of the area, calculate the vector distance from the center point to the center point of the hexagon with the highest D value, and record it as P.
[0096] 4. Record the highest D value among all hexagons as Dmax.
[0097] 5. Record the number of hexagons covered by this module as A.
[0098] After completing the above steps, all modules are first arranged in descending order of A value, and then arranged in descending order of D max value. This arrangement is an empirical rule summarized in practice, serving the visual effect: in order to generate mountains that are not too fragmented and have a main peak, it is preferred to try to generate mountains with larger radii first; if the radii are the same, it is preferred to try to generate mountains with larger coverage. Since the final sequence is sorted using Dmax, the priority is higher for Dmax, and the priority is higher for A when Dmax is the same.
[0099] II. Defining the map area where mountains need to be generated
[0100] In this embodiment, the area where mountains need to be generated is defined by the designer responsible for map design and play experience, scene artist on the large map Figure 6The middle white part represents). The hexagons that do not need to generate mountains are deleted temporarily, and each connected region is a mountain region. For the map that needs to be generated randomly, this step is completed by the random generation algorithm of the map.
[0101] In this embodiment, for each mountain region, the above steps (*) and (**) are repeated.
[0102] III. Algorithm for placing mountain modules to fill the mountain region
[0103] For each mountain region, the following operations are performed:
[0104] 1. Preprocessing
[0105] Let S, F be the set of all hexagons in the mountain region. Figure 7b ).
[0106] 2. First round of placement
[0107] The modules that can be placed in the first round need to meet the following conditions:
[0108] • The Dmax of the module is greater than 1.
[0109] • The Dmax of the module is less than or equal to the Dmax of the mountain region.
[0110] The arrangement order of the modules follows the sorting rules of the modules in the first section (mountain module production process). For example, Figures 7a to 7f , the following operations are performed:
[0111] (1) Find the hexagon H with the largest D value in S. Figure 7c ).
[0112] (2) Align the largest hexagon with the largest D value of the module at the top of the sorting with the hexagon H. If S contains all the hexagons covered by the module or there is no module that can be placed, go to the next step. Otherwise, remove the module from the set of modules that can be placed ( Figure 7d ), and repeat this step.
[0113] (3) Remove all hexagons covered by the module in step 2 from S. Repeat the above (*) step for S. Remove all hexagons with a D value greater than or equal to 1 from F that are covered by the module in step 2. Figure 7e ).
[0114] (4) Repeat steps (1) to (3) until there is no module that can be placed, as shown in Figure 7f .
[0115] 3. Second round of placement
[0116] Let S be equal to F, and let F be the set of all hexagons in the mountain region.
[0117] The modules to be placed in the second round need to meet the following conditions:
[0118] • The D value of the module is less than or equal to the D value of the mountain area. max • The D value of the module is less than or equal to the D value of the mountain area. max .
[0119] • The arrangement order of the module follows the sorting rules of the modules in the first section (mountain module production process).
[0120] As Figures 8a to 8e , the following operations are performed:
[0121] (1) The D value in F is passed to the corresponding hexagon (H) in S. Figure 8c ) in S.
[0122] (2) Find the hexagon H with the largest D value in S.
[0123] (3) Align the hexagon with the largest D value of the module with the highest sorting priority with hexagon H. If F contains all the hexagons covered by the module, go to the next step. Otherwise, remove the module from the set of placeable modules and repeat this step ( Figure 8d ).
[0124] (4) Remove all hexagons covered by the module in step 3 from S and F. Repeat step (*) for F. Then repeat step 1.
[0125] (5) Repeat steps (1) to (4) until all hexagons are covered by at least one module, as shown in Figure 8e .
[0126] Four, according to the project requirements to integrate the mountain (optional)
[0127] In this embodiment, if the mountain obtained in the mountain area filled by the mountain module placed in the third section (algorithm for placing mountain modules to fill mountain areas) has a joint that affects the visual effect, a suitable joint elimination integration scheme needs to be selected according to the project requirements, including but not limited to:
[0128] • Use Virtual Texture (virtual texture) technology to integrate the two rounds of placed mountains.
[0129] • Use Depth FaDe (depth fade) to integrate the two rounds of placed mountains.
[0130] Interactive media, such as strategy games, have high demand for both quality and quantity of mountain representation. However, there is currently a lack of production processes and technical solutions that can generate high-performance, high-expression, large-area mountains in richly expressive hexagon-tiled maps. Existing products either generate linearly connected small-scale, simple mountains in hexagon maps, or use square-tiled maps that are less expressive but easier to develop.
[0131] For interactive media such as strategy games, it is unrealistic for mountain generation on large maps to be entirely manually created by 3D artists and scene artists, and program assistance is needed. However, if artists frequently need to change the style of the scene and iterate on the visual representation of the mountains, and designers also need to frequently adjust which areas of the map need to generate mountains, there is a serious job coupling in the production process, and the level of artistic skills possessed by program developers may not meet the requirements of artists. Therefore, the process in the present invention completely decouples artistic resource production from the generation of large map mountains, and artists produce basic mountain modules, designers and scene artists then delineate areas on the map that need to generate mountains according to the needs of product interactive experience, and then use the algorithm in the present invention to generate mountain effects in the areas, and finally the generated mountain effects are fused according to project requirements. The present invention does not limit the final fusion step.
[0132] The method proposed in the present embodiment completely decouples the algorithm part from the production of artistic resources in the production process, making it easier for 3D artists to quickly iterate and more finely control artistic assets. In terms of algorithms, the method achieves a continuous mountain effect by reasonably placing and fusing modules produced by 3D artists, while ensuring runtime performance.
[0133] In the present embodiment, HouDini (a three-dimensional computer graphics software) is used to achieve modular generation of mountains, in which HouDini PDG (Process Dependency Graph) technology is used in combination with QuaDspinner Gaea (a natural terrain modeling software) to quickly generate basic modules. Finally, VirtualTexture is used in Unreal Engine 4 (Unreal 4 Engine) to achieve the final visual representation and mountain fusion. The effect preview is shown in Figure 9
[0134] The above is a further detailed description of the present invention in combination with a specific preferred embodiment, and the specific implementation of the present invention should not be limited to these descriptions. For those skilled in the art to which the present invention belongs, without departing from the concept of the present invention, a number of equivalent alternatives or obvious modifications can be made, and the performance or use is the same, which should be considered as falling within the scope of protection of the present invention.
Claims
1. A method for mountain generation in a hexagonal tiling map, characterized in that, The method comprises the following steps: S1: receiving inputted mountain base modules; S2: receiving inputted demarcation of mountain areas in a map where mountains are to be generated; S3: placing mountain base modules to fill the mountain areas and generating mountain effects in the map; The method for manufacturing mountain base modules in step S1 comprises the following steps: S1-1: producing mountain modules according to project requirements, each of the mountain modules covering a hexagonal grid area arranged in a specific manner, determining the area covered by each of the mountain modules, and generating a simple base shape for each of the mountain modules to obtain a height map; S1-2: refining the height map to obtain a base model; S1-3: calculating base model parameters to obtain mountain base modules; The method for calculating base model parameters to obtain mountain base modules in step S1-3 comprises the following steps: S1-3-1: extracting edge lines of the modules, requiring that each point on the line and its two adjacent points cannot all be on the same straight line, otherwise, the point is deleted and the two adjacent points of the point are connected, and the step is repeated until all points meet the requirements; S1-3-2: for each hexagon of the area, the distance from each vertex to the nearest point of the module edge line obtained in step S1-3-1 is calculated, and the average value is taken as D; S1-3-3: for each hexagon of the area, the vector distance from the center point of the hexagon to the center point of the hexagon with the highest D value is calculated, and is recorded as P; S1-3-4: the highest D value among all hexagons is recorded as Dmax; S1-3-5: the number of hexagons covered by the module is recorded as A; S1-3-6: all modules are first arranged in descending order of A value, and then arranged in descending order of Dmax value; The method for placing mountain base modules to fill the mountain areas in step S3 comprises the following steps: S3-1: preprocessing, letting S and F be the set of all hexagons of the mountain area; S3-2: first round of placement, the modules that can be placed in the first round need to meet the following conditions: the Dmax of the module is greater than 1, the Dmax of the module is less than or equal to the Dmax of the mountain area, and the arrangement order of the module follows the sorting rule of step S1-3-6.
2. The method of claim 1, wherein, The method for generating a simple base shape and then obtaining a height map in step S1-1 comprises the following steps: S1-1-1: subdividing the area covered by each of the mountain modules and setting at least one vertex; S1-1-2: calculating the shortest distance from each vertex to the outer contour of the mountain module; S1-1-3: setting the vertical coordinate of each vertex as the shortest distance from the vertex to the outer contour; S1-1-4: vertically scaling the vertical coordinates of each vertex as a whole; S1-1-5: converting the outer contour and the scaled vertex into a height map.
3. The method of claim 1, wherein, The method for demarcating mountain areas in a map where mountains are to be generated in step S2 comprises the following steps: S2-1: demarcating the areas where mountains are to be generated on a large map, temporarily deleting the hexagons where mountains are not to be generated, and each connected area being a mountain area; S2-2: for each mountain area obtained in step S2-1, steps S1-3-2 and S1-3-4 are performed.
4. The method of claim 3, wherein, The delineation of the mountain region in the map in step S2 can be manually delineated or generated by a random algorithm.
5. The method of claim 3, wherein, With the length of each hexagon being 1, step S3-2 includes the following steps: S3-2-1: find the hexagon H with the largest D value in S; S3-2-2: align the hexagon with the largest D value of the top-ranked placeable module with hexagon H, if S contains all the covered hexagons of the module, proceed to the next step, otherwise, remove the module from the set of placeable modules and repeat this step; S3-2-3: delete all hexagons covered by the module in step S3-2-2 from S, and perform step S1-3-2 on S, and delete all hexagons with a D value greater than or equal to 1 covered by the module in step S3-2-2 from F; S3-2-4: repeat steps S3-2-1 to S3-2-3 until there are no placeable modules.
6. The method of claim 5, wherein, Step S3 includes the following steps for placing mountain modules to fill the mountain region: S3-3: the second round of placement, set S equal to F, and let F be the set of all hexagons in the mountain region, the modules that can be placed in the second round must satisfy: the Dmax of the module is less than or equal to the Dmax of the mountain region, and the arrangement order of the module follows the sorting rules in step S1-3-6; S3-3-1: assign the D value in F to the corresponding hexagon in S; S3-3-2: find the hexagon H with the largest D value in S; S3-3-3: align the hexagon with the largest D value of the top-ranked placeable module with hexagon H, if F contains all the covered hexagons of the module or there are no placeable modules, proceed to the next step, otherwise, remove the module from the set of placeable modules and repeat this step; S3-3-4: delete all hexagons covered by the module in step S3-3-3 from S and F, and repeat step S1-3-2 on F, and then repeat step S3-3-1; S3-3-5: repeat steps S3-3-2 to S3-3-4 until all hexagons are covered by at least one module.
7. The method of claim 6, wherein, If the placed mountain has seams that affect the visual effect, appropriate seam elimination and fusion solutions can be selected according to project requirements, including: Using virtual texture technology to fuse the two rounds of placed mountains; Using depth fading technology to fuse the two rounds of placed mountains.
8. The method of claim 1, wherein, Between steps S1-2 and S1-3, an expansion of the base model step can also be set, including: S4: align the base model with its covered region; S5: rotate all base models by 60 degrees, 120 degrees, 180 degrees, 240 degrees, and 300 degrees around their center points, If any of the rotated base models is not completely the same as any existing base model, it is recorded as a new base model; S6: mirror all base models along the X-axis, if the obtained base model is not completely the same as any existing base model, it is recorded as a new base model.
Citation Information
Patent Citations
Method and device for generating mountain in sand table map, storage medium and processor
CN110288690A
Method for calculating global terrain correction based on multi-resolution polyhedron under hexagonal grid index
CN114529688A