Data processing method and device
Through automated data processing methods, map generation instructions are obtained, noise algorithms are selected to generate terrain data, and map data is updated, which solves the problems of high labor costs and hardware limitations of mobile platforms in the map generation process, and realizes efficient and automated map generation.
Patent Information
- Application Number
- CN202111523558.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-12-14
AI Technical Summary
The prior art requires a lot of manpower and expensive production costs when generating maps, and due to hardware limitations, problems such as large storage and IO occupancy are prominent on mobile platforms.
By obtaining map generation instructions, selecting the basic noise algorithm to create basic terrain data, and obtaining the initial map data through iterative calculations. Finally, update the initial map data based on the preset auxiliary data to achieve automatic map generation throughout the process.
It realizes full automation of map generation, reduces manual intervention costs, and reduces hardware restrictions on mobile platforms, improving storage and IO occupancy issues.
Smart Images

Figure CN114201569B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a data processing method. The present application also relates to a data processing device, a computing device, and a computer-readable storage medium. Background Art
[0002] With the development of Internet technology, map generation has become increasingly difficult. Not only has the map area increased, but the map models have also become more delicate. The map model data that needs to be processed in the map generation process has become more and more. In the existing technology, the basic landforms are usually generated based on the terrain editor, and then various details are processed manually, and various adjustments are made, and finally exported and stored as terrain height data. However, in the map rendering process, it is necessary to stream load terrain data for rendering to show the world. Due to the large amount of content, the manpower in the production process is quite expensive and the production cost is high. On mobile platforms, due to the limitations of the platform hardware itself, problems such as large storage and IO usage have become more prominent. Therefore, an effective solution is urgently needed to solve the above problems. Summary of the invention
[0003] In view of this, the embodiment of the present application provides a data processing method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a data processing device, a computing device, and a computer-readable storage medium.
[0004] According to a first aspect of an embodiment of the present application, a data processing method is provided, including:
[0005] Get map generation instructions;
[0006] Selecting a basic noise algorithm and creating basic terrain data according to the map generation instructions;
[0007] Obtaining initial map data by iteratively calculating the basic terrain data;
[0008] The initial map data is updated based on preset auxiliary data to obtain target map data in response to the map generation instruction.
[0009] Optionally, before obtaining the map generation instruction, the method further includes:
[0010] Get global map parameters;
[0011] Creating a global map area based on the global map parameters, and dividing the global map area to obtain at least one local map area;
[0012] A priority is configured for each local map area, and a map generation instruction corresponding to each local map area is created based on the priority configuration result.
[0013] Optionally, after obtaining the target map data in response to the map generation instruction, the method further includes:
[0014] Render the corresponding local map area according to the i-th target map data, where i is a positive integer;
[0015] Splicing the rendered local map area at the position corresponding to the global map area;
[0016] Determine whether the stitched map area is the same size as the global map area;
[0017] If so, a global map is obtained based on the stitching results;
[0018] If not, i is incremented by 1, and the step of rendering the corresponding local map area according to the i-th target map data is executed.
[0019] Optionally, selecting a basic noise algorithm and creating basic terrain data according to the map generation instruction includes:
[0020] Parsing the map generation instruction to obtain at least one plane position data, and selecting a basic noise algorithm corresponding to the map generation instruction according to the parsing result;
[0021] Calculate the height value corresponding to each plane position data according to the basic noise algorithm;
[0022] The various plane position data and their corresponding height values are fused, and basic terrain data is obtained according to the fusion result.
[0023] Optionally, the obtaining of initial map data by iteratively calculating the basic terrain data includes:
[0024] selecting target plane position data from at least one plane position data;
[0025] Calculating ecological type data based on the target plane position data and the basic terrain data;
[0026] Initial map data is obtained by iteratively calculating the basic terrain data and the ecological type data.
[0027] Optionally, the calculating ecological type data based on the target plane position data and the basic terrain data includes:
[0028] Determine the target plane position corresponding to the target plane position data, and the plane position corresponding to each plane position data;
[0029] Calculating reference distances between the target plane position and each plane position;
[0030] Selecting an ecological noise algorithm according to the basic terrain data,
[0031] The reference distance and the height value corresponding to each plane position data are input into the ecological noise algorithm, and the output results are fused to obtain ecological type data.
[0032] Optionally, the obtaining of initial map data by iteratively calculating the basic terrain data and the ecological type data comprises:
[0033] selecting a geomorphic noise algorithm based on the ecological type data;
[0034] The various plane position data are input into the terrain noise algorithm, and the output results are fused to obtain the terrain height value.
[0035] Superimposing the height values corresponding to the various plane position data with the topographic height values, and fusing the various plane position data into the superimposed result to obtain topographic data;
[0036] Initial map data is created based on the ecological type data and the landform data.
[0037] Optionally, the updating the initial map data based on preset auxiliary data to obtain target map data in response to the map generation instruction includes:
[0038] Selecting auxiliary data corresponding to the initial map data in the auxiliary database;
[0039] Calculating the initial map data and the auxiliary data using the corresponding operation rules of the auxiliary data to obtain detail data;
[0040] Based on the detailed data, the initial map data is updated to obtain target map data in response to the map generation instruction.
[0041] According to a second aspect of an embodiment of the present application, there is provided a data processing device, including:
[0042] An acquisition module, configured to acquire a map generation instruction;
[0043] A creation module, configured to select a basic noise algorithm and create basic terrain data according to the map generation instruction;
[0044] A calculation module, configured to obtain initial map data by iteratively calculating the basic terrain data;
[0045] The updating module is configured to update the initial map data based on preset auxiliary data to obtain target map data in response to the map generation instruction.
[0046] According to a third aspect of an embodiment of the present application, a computing device is provided, including:
[0047] Memory and processor;
[0048] The memory is used to store computer-executable instructions, and the processor implements the steps of the data processing method when executing the computer-executable instructions.
[0049] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the data processing method are implemented.
[0050] According to a fifth aspect of an embodiment of the present application, a chip is provided, which stores a computer program, and the computer program implements the steps of the data processing method when executed by the chip.
[0051] The data processing method provided by the present application obtains a map generation instruction, selects a type of noise algorithm according to the map generation instruction, creates basic terrain data based on the noise algorithm, iteratively calculates the basic terrain data to obtain initial map data, and calculates the initial map data in combination with auxiliary data based on a preset algorithm to obtain target map data. This enables full automation in the map generation process, eliminating all manual intervention costs, and on a mobile platform, is only limited by the actual hardware capacity during operation, alleviating the limitations of the platform hardware itself, and improving problems such as large storage and IO usage. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 is a flow chart of a data processing method provided by an embodiment of the present application;
[0053] Figure 2 It is an ecological type data comparison diagram of a data processing method provided in an embodiment of the present application;
[0054] Figure 3 It is a processing flow chart of a data processing method for generating a game map provided in an embodiment of the present application;
[0055] Figure 4 is a structural schematic diagram of a data processing device provided by an embodiment of the present application;
[0056] Figure 5 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0057] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0058] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0059] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0060] First, the terms involved in one or more embodiments of the present invention are explained.
[0061] PerlinNoise: Use many smooth functions, each with a variety of frequencies and amplitudes, and superimpose them together to create a noise function, which is the PerlinNoise function. The idea of generating PerlinNoise is to divide the entire space into small grids, randomly select values at each grid vertex, and obtain value-based noise in the area outside the grid vertex by mixing the values of the surrounding vertices.
[0062] Lattice: The atoms inside the crystal are arranged according to certain geometric rules. The spatial grid that represents the arrangement rules of atoms in the crystal is called a lattice. This application draws on the geometric concept of the lattice to represent the planar shape of the local map areas that are equal to each other after dividing the global map area.
[0063] Gradient: The original meaning is a vector (vector), which means that the directional derivative of a function at this point reaches the maximum value along this direction, that is, the function changes the fastest along this direction (the direction of this gradient) at this point, and the rate of change is the largest (the modulus of the gradient).
[0064] Interpolation: interpolating a continuous function based on discrete data so that the continuous curve passes through all given discrete data points. Interpolation is an important method for approximating discrete functions. It can be used to estimate the approximate value of the function at other points based on the value of the function at a finite number of points. It is used to fill the gaps between pixels when the image is transformed.
[0065] Frequency doubling: In electronic circuits, the frequency of the output signal generated is an integer multiple of the input signal frequency. Assuming the input signal frequency is n, the first frequency doubling 2n, and correspondingly 3n, 4n, etc. are all called frequency doubling. This application draws on this concept and changes the frequency of the noise waveform in the noise algorithm by integer multiples.
[0066] In the present application, a data processing method is provided. The present application also relates to a data processing device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0067] Figure 1 A flowchart of a data processing method provided according to an embodiment of the present application is shown, which specifically includes the following steps:
[0068] Step S102: Obtain map generation instructions.
[0069] Applied to data processing program, the data processing program executes the map generation task and obtains the target map through calculation and processing.
[0070] The map generation instruction instructs the data processing program to process the map area to be processed.
[0071] Based on this, the data processing program obtains a map generation instruction carrying the map area to be processed, and executes subsequent map generation tasks based on the data information carried in the map generation instruction.
[0072] Furthermore, due to the development of the information age, the target maps that need to be processed today have become extremely large, so the amount of calculation of the target map data has also become huge. Without changing the hardware configuration, the time spent on processing and rendering the entire target map is huge, which makes the system execute tasks slowly and the user's waiting time becomes longer. Therefore, it is necessary to divide the target maps to be processed and give priority to the partial maps currently needed. In this embodiment, the specific implementation method is as follows:
[0073] Acquire global map parameters; create a global map area based on the global map parameters, divide the global map area to obtain at least one local map area; configure a priority for each local map area, and create a map generation instruction corresponding to each local map area based on the priority configuration result.
[0074] The global map parameters include the size information of the global map, and the global map area is a plane area established according to the size information of the global map.
[0075] Based on this, the data processing program obtains the global map parameters of the global map to be processed, and divides the global map according to the size information of the global map carried in the global map parameters. It should be noted that the size of the division depends entirely on the size of the global map. When the size of the global map is relatively large, a larger number of blocks can be divided. Conversely, a smaller number of blocks can be divided. This application has no restrictions on the size of the local map area obtained by the division, and it can be set according to the actual application scenario. After the data processing program completes the division of the global map area, at least one local map area is obtained. After that, it is necessary to set a priority for the obtained local map area to ensure that some local map areas with higher current demand can be given priority. Finally, the data processing program sets the corresponding map generation instructions for the local map areas for which priorities have been configured.
[0076] Specifically, when the data processing program divides the global map area to obtain the local map area, preferably, the size and shape of the local map area are kept consistent during the division.
[0077] For example, during the filming of some science fiction movies, it is necessary to generate a map of the movie scene. The data processing program obtains the map parameters of the movie map. According to the indication of the map parameters, the size of the movie map is an area of 1,000 kilometers long and 8,000 kilometers wide. The data processing program divides the movie map into 100*80 local map areas. The local map area obtained is a square area of 10 kilometers long and 10 kilometers wide. Then, according to the local map area where the movie characters are located indicated in the map parameters, its priority is set to the highest, and then the priority of the local map area that may be needed around the movie characters is also increased. Finally, the data processing program sets the map generation instructions of each local map area in sequence according to the priority of the local map area that has been configured.
[0078] In summary, the data processing program divides the global map area, so that the oversized global map area is turned into multiple smaller local map areas. This reduces the amount of computation required for processing and rendering map data, reduces the time spent, and enables the system to execute tasks quickly. By configuring the priority of the local map areas, some urgently needed local map areas can be processed first, without the need for users to wait, thus speeding up the response and improving efficiency.
[0079] Step S104: selecting a basic noise algorithm and creating basic terrain data according to the map generation instruction.
[0080] Specifically, based on the data processing program receiving the map generation instruction, in order to generate a random map, the terrain of the map needs to be generated first. The terrain generation can select a noise algorithm according to the map generation instruction and create basic terrain data according to the noise algorithm.
[0081] The basic noise algorithm is a noise algorithm adapted to generate terrain data according to the current map generation instruction, and the basic terrain data is terrain data of the target map area corresponding to the map generation instruction.
[0082] Based on this, the data processing program selects a noise algorithm suitable for generating the target terrain area corresponding to the map generation instruction based on the map generation instruction received, and calculates the terrain data of the target map area corresponding to the map generation instruction based on this noise algorithm.
[0083] Furthermore, in the process of creating basic terrain data, the definition of terrain can be the height value of each point in the target map area, that is, a world coordinate system is established in the target map area, and the three-dimensional data of each point in the target map area can be known according to the height value corresponding to each point, and a terrain model in the target map area is established according to the three-dimensional data. In this embodiment, the specific implementation method is as follows:
[0084] The map generation instruction is parsed to obtain at least one plane position data, and a basic noise algorithm corresponding to the map generation instruction is selected according to the parsing result; a height value corresponding to each plane position data is calculated according to the basic noise algorithm; each plane position data and its corresponding height value are fused, and basic terrain data is obtained according to the fusion result.
[0085] The plane position data is the plane coordinates of each point in the target map area. For example, if the coordinates of each point in the three-dimensional model can be expressed as (xi, yi, zi), then the plane position data is (xi, yi).
[0086] Based on this, the data processing program parses the map generation instruction, obtains the plane position data of the target map area corresponding to the map generation instruction, that is, the plane coordinates (x, y) of each point in the target map area, and selects a basic noise algorithm suitable for establishing the basic terrain data of the current target map area according to the parsing result of the map generation instruction, takes the obtained plane position data as input, obtains the height value corresponding to each plane position data, and combines this height value with the corresponding plane position data to obtain the three-dimensional data (xi, yi, zi) of a point in the target map area, and finally puts all the three-dimensional data into the same set to obtain the basic terrain data of this target map area. Among them, the basic noise algorithm includes but is not limited to Value noise, Perlin noise, and Simplex noise.
[0087] For example, in the process of generating a map in a movie scene, the data processing program obtains a map generation instruction of the movie map, and the data processing program parses the obtained map generation instruction to obtain a movie map area of 10 kilometers square, thereby obtaining the plane position Bi(xi, yi) of the movie map area, and selects a noise algorithm according to the map generation instruction. The selected noise algorithm is PerlinNoise. Based on PerlinNoise, the plane position Bi(xi, yi) of this movie map area is used as input to obtain the corresponding height value zi of each plane position Bi(xi, yi), and the height value zi is integrated with the plane position (xi, yi) to obtain the three-dimensional coordinates Ci(xi, yi, zi) of each point in the movie map area, and all the three-dimensional coordinates Ci(xi, yi, zi) are put into the same set to obtain the basic terrain data of the movie map area.
[0088] In summary, the height values of each plane position data in the target map area are calculated based on the noise algorithm, so that each point in the target map area has corresponding three-dimensional data information, and the basic terrain data of the target map area is obtained.
[0089] Step S106: Obtaining initial map data by iteratively calculating the basic terrain data.
[0090] Specifically, after obtaining the basic terrain data corresponding to the target map area, the terrain data in the target map area needs to be further refined on this basis to ensure that the map generated in the target map area has enough details and is more realistic.
[0091] Among them, the iterative calculation process of the basic terrain data, that is, the calculation of the basic terrain data, and the calculation results are used as the conditions for the next calculation, and the calculation process is carried out step by step. The initial map data is more refined than the basic terrain data, and the data content of the map details is richer.
[0092] Based on this, after the data processing program processes the target map area corresponding to the map generation instruction and obtains the basic terrain data in the target map area, the data processing program performs further calculations based on the obtained basic terrain data. Through iterative calculations, it can eventually obtain an initial map data with richer details based on the originally relatively smooth basic terrain data.
[0093] Furthermore, in the process of calculating the initial map data based on the basic terrain data by the data processing program, the basic terrain data is the three-dimensional coordinate information of each point in the target map area corresponding to the map generation instruction. At this time, the basic terrain data lacks richness compared to the initial map data. The ecological type data in the target map area can be calculated to solve this problem. In this embodiment, the specific implementation method is as follows:
[0094] Select target plane position data from at least one plane position data; calculate ecological type data based on the target plane position data and the basic terrain data; and obtain initial map data by iteratively calculating the basic terrain data and the ecological type data.
[0095] Among them, the ecological type data is the ecological type of the map model generated in the target map area corresponding to the map generation instruction. The ecological type data of each point is determined by the environmental data such as temperature, humidity, light, precipitation, etc. at this point, and the environmental data is calculated by a noise algorithm. It should be noted that the environmental data selected in this embodiment are temperature and humidity. This application is not limited to the described environmental data, because according to this application, environmental data such as light and precipitation can also be used as reference elements for ecological type data.
[0096] Specifically, the data processing program selects a plane position data in the target map area to be processed as the target plane position data. It should be noted that the selection of the target plane position data is not fixed, and the specific plane position data can be determined according to the actual application scenario. The data processing program calculates the ecological type data based on the selected target plane position data and the basic terrain data, and then iterates the ecological type data to obtain the initial terrain data.
[0097] For example, in the process of generating a map in a movie scene, the data processing program calculates the basic terrain data for the movie map area, and then the data processing program selects the data A(xa, xb) of the center point of the movie map area as the target plane position data, and selects an algorithm based on the center point data A(xa, xb) and the basic terrain data to calculate the ecological type data, and then calculates the initial map data based on the basic terrain data and the ecological type data.
[0098] In summary, by calculating the ecological type data, the details of each map point in the target map area described by the basic terrain data are enriched, and the generated map is more realistic.
[0099] Furthermore, when calculating the ecological type data, the data processing program needs to ensure that the generated ecological type data is reasonable and further enhance the randomness. At this time, the rationality can be ensured based on a certain point in the target map area and the height value in the basic terrain data, and the noise algorithm can be used to ensure randomness. In this embodiment, the specific implementation method is as follows:
[0100] Determine the target plane position corresponding to the target plane position data, and the plane position corresponding to each plane position data; calculate the reference distance between the target plane position and each plane position; select an ecological noise algorithm according to the basic terrain data, input the reference distance and the height value corresponding to each plane position data into the ecological noise algorithm, and fuse the output results to obtain ecological type data.
[0101] The ecological noise algorithm is any noise algorithm. It should be noted that those skilled in the art can select the type of noise algorithm according to the actual application scenario, and this embodiment does not limit this.
[0102] Based on this, the data processing program determines the corresponding target plane position in the target map area based on the selected target plane position data, and then determines all plane positions in the target map area based on the plane position data, and calculates the distance between each plane position and the target plane position as the reference distance, and then determines the type of noise algorithm selected according to the application scenario of the basic terrain data. The selected noise algorithm is recorded as the ecological noise algorithm. Finally, the obtained reference distance and the height value corresponding to each plane position data described in the basic terrain data are input into the ecological noise algorithm, and the obtained results are fused to obtain ecological type data.
[0103] Using the above example, the data processing program selects the center point of the movie map area as the target plane position A (xa, xb), determines all plane positions Bi (xi, yi) in the movie map area based on the plane position data, calculates the distance between all plane positions Bi (xi, yi) and the target position A (xa, xb), and records it as the reference distance Di. According to the actual application scenario of the map, the PerlinNoise noise algorithm is selected as the ecological noise algorithm. Finally, the obtained reference distance Di and the basic terrain data are used as the input of the ecological noise algorithm, and the output results are the temperature value (expressed in temperature) and the humidity value (expressed in humidity). Based on the temperature value and the humidity value, the ecological type data comparison chart is searched to obtain the corresponding ecological type data.
[0104] Among them, see Figure 2 In the ecological type data comparison chart shown, if the temperature value is between 0.2-0.3 and the humidity value is between 0.2-0.4, the selected ecological type is swamp, and the ecological type data corresponding to the selected swamp is output as the result. It should be noted that the ecological type data comparison chart is set according to the actual application scenario. Figure 2 The ecological type data comparison chart depicted in the figure is for reference only. The technical personnel in this field may make specific settings for the ecological type data comparison chart based on their needs, and this embodiment does not limit this.
[0105] In summary, based on the target plane position data and the distance between the plane position data, as well as the height values corresponding to each plane position data in the basic terrain data as calculation elements, it is ensured that the ecological type above each position is more reasonable, and there will be no map errors that violate common sense, such as rainforests appearing on high peaks. The ecological noise algorithm ensures that the generated map is more random while rationality is met.
[0106] Furthermore, after the data processing program calculates the ecological type data for the target map area, it is necessary to further calculate the basic terrain data. The height value obtained by the basic terrain data based on the basic noise algorithm is relatively flat and lacks details. In the case of actual maps, there are very few maps that are too flat, which is unreasonable. Therefore, it is necessary to perform detailed processing based on the basic terrain data. In this embodiment, the specific implementation method is as follows:
[0107] Select a geomorphic noise algorithm according to the ecological type data; input each plane position data into the geomorphic noise algorithm, and fuse the output results to obtain a geomorphic height value. Superimpose the height value corresponding to each plane position data with the geomorphic height value, and fuse each plane position data in the superposition result to obtain geomorphic data; create initial map data based on the ecological type data and the geomorphic data.
[0108] Among them, the terrain noise algorithm is any noise algorithm. It should be noted that those skilled in the art can select the type of noise algorithm according to the actual application scenario, and this embodiment does not limit it. The terrain height value is a supplement to the height value corresponding to each plane position data in the basic terrain data. The height value contained in the basic terrain data is the basis, and the terrain height value is the detail, which together constitutes the initial map data.
[0109] Based on this, the data processing program selects a type of noise algorithm based on the ecological type data, recorded as a topographic noise algorithm, and inputs each plane position data into the topographic noise algorithm to obtain a topographic height value. The height value corresponding to each plane position data is superimposed with the topographic height value to obtain a new height value, and then the new height value is merged with the corresponding plane position data to obtain topographic data. Finally, the initial map data is created based on the ecological type data and the topographic data.
[0110] Following the above example, the data processing program selects the PerlinNoise noise algorithm based on the ecological type data, and then adds fractals to the PerlinNoise noise. The geomorphic noise algorithm is obtained by superimposing multiple groups of different frequency multiples, and the plane position Bi(xi, yi) corresponding to each plane position data is input into the geomorphic noise algorithm to obtain the geomorphic height value hi. After that, the height value zi corresponding to each plane position data is superimposed with the geomorphic height value hi to obtain a new height value Hi, and then the new height value is fused with each corresponding plane position data to obtain the geomorphic data Fi(xi, yi, Hi), and all the geomorphic data Fi(xi, yi, Hi) are put into the same set, and then this set is combined with the ecological type data to obtain the initial map data.
[0111] In summary, the technical means of selecting noise algorithms based on ecological types improves the rationality of map generation. For example, in grassland terrain, the terrain fluctuation is not too large, so a noise algorithm with smoother output results should be selected. In mountain terrain, the terrain fluctuation is often large, so a noise algorithm with smoother output results should not be selected.
[0112] Step S108: updating the initial map data based on the preset auxiliary data to obtain target map data in response to the map generation instruction.
[0113] Specifically, after the above data processing program calculates the initial map data, it is necessary to further increase the map details, and at this time, auxiliary data is introduced.
[0114] Among them, the auxiliary data is detailed data such as rivers and roads. It should be noted that the types of auxiliary data that can be selected are not limited to rivers and roads. In different actual application scenarios, technical personnel in this field can select auxiliary data according to needs, and this embodiment does not limit this.
[0115] Based on this, after obtaining the initial map data, the data processing program selects the auxiliary data, and updates the initial map data based on the auxiliary data to obtain the target map data in response to the map generation instruction.
[0116] Furthermore, when the initial map data is updated, auxiliary data is selected to further increase the details of the initial map data. In this embodiment, the specific implementation is as follows:
[0117] The method comprises selecting auxiliary data corresponding to the initial map data in an auxiliary database; calculating the initial map data and the auxiliary data using a corresponding operation rule of the auxiliary data to obtain detail data; and updating the initial map data based on the detail data to obtain target map data in response to the map generation instruction.
[0118] The auxiliary database is a preset database used to store auxiliary data and its corresponding operation rules.
[0119] Based on this, the data processing program obtains the auxiliary data corresponding to the initial map data and the operation rules corresponding to the auxiliary data from the auxiliary database, uses the corresponding operation rules to calculate the auxiliary data and the initial map data to obtain the detailed data, and updates the initial map data based on the detailed data to obtain the target map data in response to the map generation instruction.
[0120] For example, the data processing program processes the initial map data corresponding to the movie map area, selects the auxiliary data in the auxiliary database, and calculates the initial map data and the auxiliary data based on the operation rules corresponding to the auxiliary data to obtain detailed data, wherein the detailed data marks the location information of rivers, roads, and villages in the movie map area corresponding to the initial map data; based on the detailed data, the initial map data corresponding to the movie map area is updated to obtain the movie map data.
[0121] In summary, based on the auxiliary data in the auxiliary database and the operation rules corresponding to the auxiliary data, the initial map data can be further refined to obtain the final target map data.
[0122] Further, after the target map data is calculated, the map can be rendered and displayed based on the target map data. In the above steps, there is a step of dividing the global map area to obtain multiple local map areas. When rendering each local map area, the rendered local map areas need to be spliced to obtain a complete global map. In this embodiment, the specific implementation method is as follows:
[0123] Render the corresponding local map area according to the i-th target map data, where i is a positive integer; splice the rendered local map area at the position corresponding to the global map area; determine whether the spliced map area is the same size as the global map area; if so, obtain the global map according to the splicing result; if not, i is incremented by 1, and execute the step of rendering the corresponding local map area according to the i-th target map data.
[0124] Wherein, i starts from 1 and is a positive integer; the i-th target map data is the target map data corresponding to any divided local map area, wherein the order between the target map data is determined by the priority.
[0125] Based on this, starting from the first target map data, the data processing program renders the corresponding local map area based on the target map data to obtain the map within the local map area, and splices the rendered map within the first local map area to the corresponding position of the global map area. Then, it is determined whether the spliced map is the same size as the global map area. If not, the second target map data is selected for rendering, and the rendered target map data is spliced to the corresponding position of the global map area. Then, it is determined whether the spliced map is the same size as the global map area, and so on, until it is determined that the spliced map is the same size as the global map area. At this time, the spliced map is the global map.
[0126] For example, in the movie map, the data processing program renders the target map data corresponding to the local map area divided by the movie map to obtain the local map. According to the priority of each target map data, the first target map data is rendered first, and the rendered local map is spliced to the corresponding position of the movie map. It is determined whether the size of the spliced map is equal to the movie map. If it is smaller, the second target map data is rendered, and the second rendered local map is spliced to the corresponding position of the movie map. It is determined whether the size of the spliced map is equal to the movie map. At this time, the size of the spliced map is equal to the movie map, and then the movie map is obtained.
[0127] In summary, by rendering and then splicing each local map, the amount of computational time required for processing and rendering single map data is reduced, the time spent is reduced, and the system executes tasks quickly. Rendering based on priority of local map areas can allow some urgently needed local map areas to be processed first, without the user having to wait, which speeds up the response and improves efficiency.
[0128] The data processing method provided by the present application obtains a map generation instruction, selects a type of noise algorithm according to the map generation instruction, creates basic terrain data based on the noise algorithm, iteratively calculates the basic terrain data to obtain initial map data, and calculates the initial map data in combination with auxiliary data based on a preset algorithm to obtain target map data. This enables full automation in the map generation process, eliminating all manual intervention costs, and on a mobile platform, is only limited by the actual hardware capacity during operation, alleviating the limitations of the platform hardware itself, and improving problems such as large storage and IO usage.
[0129] The following combination Figure 3 , taking the application of the data processing method provided in this application to the generation of a game map as an example, the data processing method is further described. Figure 3 A processing flow chart of a data processing method for generating a game map provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0130] Step S302: Obtain global map parameters.
[0131] Specifically, in the task of generating a game map, the data processing program receives global map parameters of the global map to be generated.
[0132] Step S304: creating a global map area based on the global map parameters, and dividing the global map area to obtain at least one local map area.
[0133] Specifically, the data processing program creates a global map area based on the global map parameters to obtain a game map area of 80 kilometers * 80 kilometers, and divides the game map area into 80 * 80 local map areas, where the length and width of the local map areas are both 1 kilometer.
[0134] Step S306: configuring a priority for each local map area, and creating a map generation instruction corresponding to each local map area based on the priority configuration result.
[0135] Specifically, the data processing program sets the priority based on the local map area where the game character is located, and sets the priority of the local map area where the game character is located to the highest, and the local map area farther away from the local map area where the game character is located has a lower priority. Based on the local map areas with configured priorities, a map generation instruction corresponding to each local map area is created, and the map generation instruction is saved to the storage space for use in subsequent steps.
[0136] Step S308: obtaining a map generation instruction, parsing the map generation instruction, obtaining at least one plane position data, and selecting a basic noise algorithm corresponding to the map generation instruction according to the parsing result.
[0137] Specifically, the data processing program selects the first map generation instruction based on the configured priority, and then parses the map generation instruction to obtain the plane position data (xi, yi) of the local map area corresponding to the map generation instruction. Then, the type of the basic noise algorithm is selected as the PerlinNoise algorithm.
[0138] Step S310: Calculate the height value corresponding to each plane position data according to the basic noise algorithm.
[0139] Specifically, the local map area is divided into a lattice of 1000*1000 squares. Any point p(x, y) in the map is in the square lattice. Point p(x, y) is rounded down to obtain point A1(xa, ya). The four vertices of the square are: A1(xa, ya), B1(xa, ya+1), C1(xa+1, ya), and D1(xa+1, ya+1).
[0140] Generate pseudo-random gradients for points AD, which are two-dimensional vectors, so that the gradient value calculated for the same point is always the same result. In the generation of random gradients, since the game map requires more diverse effects and more optional random vectors, we use the shader's two-dimensional random vector generation function. For any point (i, j), the random vector generation process is as follows:
[0141] Two pseudo-random parameters x1 and y1 are set about the horizontal coordinate i and the vertical coordinate j, where the expression of x1 is shown in Formula 1.
[0142] x1=i×g+j×h+e Formula 1
[0143] Among them, g, h and e are fixed values, which can be set according to the actual application scenario. This embodiment does not limit them. The expression of y1 is similar to the expression of x1. The fixed values are set according to the actual application and may not be the same as the fixed values in the expression of x1. In this embodiment, x1 and y1 can be set as x1=i×127.1+j×311.7 and y1=i×269.5+j×183.3;
[0144] A pseudo-random generation function is set up to obtain a pseudo-random result f(p) based on the input value p, as shown in Formula 2, where:
[0145] f(p)=sin(p)×k Formula 2
[0146] Regarding the k in the formula f(p), it is a fixed value and can be set according to the actual application scenario. It is not limited in this embodiment. In this embodiment, the fixed value k can be set to 43758.5453123.
[0147] Substitute the pseudo-random parameters x1 and y1 into the pseudo-random generator function f(p) of formula 2 to obtain f(x1) and f(y1). Then, remove the decimals from f(x1) and f(y1) and round them down to obtain fx and fy respectively.
[0148] Another pseudo-random generation function is set to obtain a pseudo-random result g(m, n) based on the input values m and n, as shown in Formula 3, where r, s, and t are fixed values and can be set according to the actual application scenario. This is not limited in this embodiment. For example, in this embodiment, g(m, n)=2×(mn)-1 can be set.
[0149] g(m,n)=r×m+s×nt; Formula 3
[0150] Substituting the obtained f(x1) and f(y1) into Formula 3, we can get two random parameters x2 and y2, where x2 = g(f(x1), fx), y2 = g(f(y1), fy);
[0151] The random vector expression of point (i, j) is constructed based on two random parameters x2 and y2, where the constructed expression is
[0152] According to the above method, generate random vectors for AD points is the lattice vertex gradient;
[0153] Next, calculate the vector from point AD to point p:
[0154] Multiply the vertex gradient by the vector point to get the gradient contribution value of point AD (denoted by ad);
[0155]
[0156] The point noise can be obtained by interpolating the gradient contribution value of each vertex three times with a smooth curve. u and w are the decimal parts of the horizontal coordinate x and the vertical coordinate y respectively. The calculation is as follows:
[0157] Interpolate in the x direction and get the interpolation function as shown in Formula 4:
[0158] s1=a+W n (ba) Formula 4
[0159] Among them, W n is a smooth interpolation curve, as shown in Formula 5,
[0160] W n =w(q)=6q 5 +15q 4 +10q 3 Formula 5
[0161] Here, the smooth difference curve uses the existing interpolation curve function, or you can choose your own preferred interpolation curve function, as long as w(0)=0, w(0.5)=0.5, w(1)=1; Substituting u into the interpolation function of formula 3, we can get: s1=a+(6u 5 +15u 4 +10u 3 )(ba), similarly, we can get: s2=c+(6u 5 +15u 4 +10u 3 )(dc);
[0162] Finally, after interpolation calculation in the y direction, we can get: the PerlinNoise noise value of point p(x, y), where the PerlinNoise noise value is shown in formula 6.
[0163] PerlinNoise(x,y)=s1+(6w 5 +15w 4 +10w 3 )(s2-s1) Formula 6
[0164] The above algorithm can be used to obtain the height values PerlinNoise(xi,yi) of all points in the local map area.
[0165] Step S312: Fusing the various plane position data and their corresponding height values, and obtaining basic terrain data according to the fusion result.
[0166] Specifically, the data processing program fuses the plane position data (xi, yi) of each point in the local map area and its corresponding height value with PerlinNoise(xi, yi) to obtain the three-dimensional coordinate data of each point (xi, yi, PerlinNoise(xi, yi)). The three-dimensional coordinate data of each point is placed in the same set to obtain the basic terrain data.
[0167] Step S314: Select target plane position data from at least one plane position data, and determine the target plane position corresponding to the target plane position data, and the plane positions corresponding to each plane position data.
[0168] Specifically, the data processing program selects the center point O (Ox, Oy) in the local map area and determines each plane position data (xi, yi).
[0169] Step S316: Calculate the reference distance between the target plane position and each plane position, and select an ecological noise algorithm according to the basic terrain data.
[0170] Specifically, the data processing program processes each plane position data (xi, yi), firstly selects an arbitrary point p (x, y), and determines that the point p (x, y) is at the four vertices of the square lattice, calculates the distance between the four vertices and the center point O (Ox, Oy) as four offsets offset1-offset4, and the map width is mapwidth. The data processing program selects the PerlinNoise noise algorithm as the ecological noise algorithm.
[0171] Step S318: input the reference distance and the height value corresponding to each plane position data into the ecological noise algorithm, and fuse the output results to obtain ecological type data.
[0172] Specifically, for point p(x, y), calculate its temperature and humidity.
[0173] The temperature and humidity are obtained by the following formulas 7 and 8:
[0174]
[0175]
[0176] When generating an ecosystem, first specify a base height value baseheight as the sea level. If the baseheight value of any point is lower than the sea level, all oceans will be generated. For baseheight values higher than the sea level, based on the attached figure of the specification Figure 2 In the table, select the corresponding ecological type to obtain ecological type data.
[0177] Step S320: Select a topographic noise algorithm according to the ecological type data, input the various plane position data into the topographic noise algorithm, and fuse the output results to obtain a topographic height value.
[0178] Specifically, the data processing program selects the PerlinNoise noise algorithm as the topographic noise algorithm. Compared with the basic noise algorithm, the topographic noise algorithm uses conventional methods to add fractals to the noise. By superimposing multiple sets of noise data with different octaves, the PerlinNoise corresponding to the topographic noise algorithm is obtained. As the octave increases, the code execution time increases linearly. Usually, the more reasonable number of iterations is 2-8 times. Here, the data processing program chooses to iterate 3 times for calculation. After determining the number of iterations, the fbm fractal is selected, that is, different octave frequencies are multiplied by multiples of 2, and the amplitudes are divided by multiples of 2 and then superimposed. Finally, for point p(x, y), the topographic height value is obtained by the following formula 9:
[0179]
[0180] Step S322: superimposing the height values corresponding to the various plane position data with the topographic height values, and fusing the various plane position data in the superimposed result to obtain topographic data.
[0181] Specifically, the data processing program adds the height value corresponding to any point in the game map area to the landform height value, and obtains the landform data through the following formula 10:
[0182]
[0183] Step S324: creating initial map data based on the ecological type data and the landform data.
[0184] Specifically, the data processing program stores the ecological type data and landform data corresponding to each point in the game map area into a set to obtain initial map data.
[0185] Step S326: selecting auxiliary data corresponding to the initial map data in the auxiliary database, and calculating the initial map data and the auxiliary data using the corresponding operation rules of the auxiliary data to obtain detailed data.
[0186] Specifically, the data processing program selects auxiliary data corresponding to the initial map data in the auxiliary database and uses the corresponding operation rules of the auxiliary data to calculate the initial map data and the auxiliary data to obtain the detailed data.
[0187] Step S328: Based on the detailed data, the initial map data is updated to obtain target map data in response to the map generation instruction.
[0188] Specifically, the data processing program updates the initial map data based on the detailed data, adds river and road data to the basic map data, and obtains target map data in response to the map generation instruction.
[0189] Step S330: Rendering a corresponding local map area according to the target map data.
[0190] Specifically, the data processing program renders the corresponding local map area based on the target map data.
[0191] Step S332: splicing the rendered local map area at the position corresponding to the global map area.
[0192] Specifically, the data processing program splices the rendered local map area at the corresponding position of the game map.
[0193] Step S334: Determine whether the stitched map area is the same size as the global map area. If yes, proceed to step S336; otherwise, proceed to step S338.
[0194] Specifically, the data processing program determines whether the stitched map area is the same size as the global map area, that is, determines whether there is still a map area whose map generation instruction has not been executed.
[0195] Step S336: Obtain a global map based on the stitching results.
[0196] Specifically, when all map generation instructions in all map areas are executed, that is, when all game maps have been rendered, the task is completed.
[0197] Step S338: Obtain the next map generation instruction arranged according to the priority, and execute the process between step S308 - step S334.
[0198] Specifically, if the map generation instructions in all map areas have not been fully executed, that is, the entire game map has not been rendered, the next map generation instruction is extracted to process the next local map area.
[0199] The data processing method provided by the present application obtains a map generation instruction, selects a type of noise algorithm according to the map generation instruction, creates basic terrain data based on the noise algorithm, iteratively calculates the basic terrain data to obtain initial map data, and calculates the initial map data in combination with auxiliary data based on a preset algorithm to obtain target map data. This enables full automation in the map generation process, eliminating all manual intervention costs, and on a mobile platform, is only limited by the actual hardware capacity during operation, alleviating the limitations of the platform hardware itself, and improving problems such as large storage and IO usage.
[0200] Corresponding to the above method embodiment, the present application also provides a data processing device embodiment, wherein the data processing program of the data processing method that executes steps S102-S108 can be run by the data processing device provided by the present application. Figure 4 FIG. 1 is a schematic diagram showing the structure of a data processing device provided by an embodiment of the present application. Figure 4 As shown, the device comprises:
[0201] An acquisition module 402 is configured to acquire a map generation instruction;
[0202] A creation module 404, configured to select a basic noise algorithm and create basic terrain data according to the map generation instruction;
[0203] The calculation module 406 is configured to obtain initial map data by iteratively calculating the basic terrain data;
[0204] The updating module 408 is configured to update the initial map data based on preset auxiliary data to obtain target map data in response to the map generation instruction.
[0205] In an optional embodiment, the data processing device further includes:
[0206] The partitioning module is configured to obtain global map parameters; create a global map area based on the global map parameters, divide the global map area to obtain at least one local map area; configure a priority for each local map area, and create a map generation instruction corresponding to each local map area based on the priority configuration result.
[0207] In an optional embodiment, the data processing device further includes:
[0208] The splicing module is configured to render a corresponding local map area according to the i-th target map data, where i is a positive integer; splice the rendered local map area at a position corresponding to the global map area; determine whether the spliced map area is the same size as the global map area; if so, obtain a global map according to the splicing result; if not, i is incremented by 1, and the step of rendering the corresponding local map area according to the i-th target map data is executed.
[0209] In an optional embodiment, the creation module 404 is further configured to:
[0210] The map generation instruction is parsed to obtain at least one plane position data, and a basic noise algorithm corresponding to the map generation instruction is selected according to the parsing result; a height value corresponding to each plane position data is calculated according to the basic noise algorithm; each plane position data and its corresponding height value are fused, and basic terrain data is obtained according to the fusion result.
[0211] In an optional embodiment, the calculation module 406 is further configured to:
[0212] Select target plane position data from at least one plane position data; calculate ecological type data based on the target plane position data and the basic terrain data; and obtain initial map data by iteratively calculating the basic terrain data and the ecological type data.
[0213] In an optional embodiment, the calculation module 406 is further configured to:
[0214] Determine the target plane position corresponding to the target plane position data, and the plane position corresponding to each plane position data; calculate the reference distance between the target plane position and each plane position; select an ecological noise algorithm according to the basic terrain data, input the reference distance and the height value corresponding to each plane position data into the ecological noise algorithm, and fuse the output results to obtain ecological type data.
[0215] In an optional embodiment, the calculation module 406 is further configured to:
[0216] Select a geomorphic noise algorithm according to the ecological type data; input each plane position data into the geomorphic noise algorithm, and fuse the output results to obtain a geomorphic height value. Superimpose the height value corresponding to each plane position data with the geomorphic height value, and fuse each plane position data in the superposition result to obtain geomorphic data; create initial map data based on the ecological type data and the geomorphic data.
[0217] In an optional embodiment, the updating module 408 is further configured to:
[0218] The method comprises selecting auxiliary data corresponding to the initial map data in an auxiliary database; calculating the initial map data and the auxiliary data using a corresponding operation rule of the auxiliary data to obtain detail data; and updating the initial map data based on the detail data to obtain target map data in response to the map generation instruction.
[0219] The data processing device provided in this application enables full automation in the map generation process, eliminating all manual intervention costs. On the mobile platform, the operation is only limited by the actual hardware capacity, alleviating the limitations of the platform hardware itself, and improving problems such as large storage and IO usage.
[0220] The above is a schematic scheme of a data processing device of the present embodiment. It should be noted that the technical scheme of the data processing device and the technical scheme of the above-mentioned data processing method belong to the same concept. For the details not described in detail in the technical scheme of the data processing device, please refer to the description of the technical scheme of the above-mentioned data processing method. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0221] Figure 5The block diagram of a computing device 500 provided according to an embodiment of the present application is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.
[0222] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0223] In one embodiment of the present application, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0224] The computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 500 may also be a mobile or stationary server.
[0225] The processor 520 is used to execute the following computer executable instructions:
[0226] Get map generation instructions;
[0227] Selecting a basic noise algorithm and creating basic terrain data according to the map generation instructions;
[0228] Obtaining initial map data by iteratively calculating the basic terrain data;
[0229] The initial map data is updated based on preset auxiliary data to obtain target map data in response to the map generation instruction.
[0230] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above data processing method.
[0231] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which are used when executed by a processor to:
[0232] Get map generation instructions;
[0233] Selecting a basic noise algorithm and creating basic terrain data according to the map generation instructions;
[0234] Obtaining initial map data by iteratively calculating the basic terrain data;
[0235] The initial map data is updated based on preset auxiliary data to obtain target map data in response to the map generation instruction.
[0236] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above data processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above data processing method.
[0237] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the data processing method when executed by the chip.
[0238] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0239] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0240] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0241] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0242] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A data processing method, characterized in that: include: Get map generation instructions; Selecting a basic noise algorithm and creating basic terrain data according to the map generation instructions; The initial map data is obtained by iteratively calculating the basic terrain data, wherein the initial map data is obtained by iteratively calculating the basic terrain data, including: selecting target plane position data from at least one plane position data, the plane position data being obtained by parsing the map generation instruction; calculating ecological type data based on the target plane position data and the basic terrain data, the ecological type data being the ecological type of the map model generated in the target map area corresponding to the map generation instruction; and obtaining the initial map data by iteratively calculating the basic terrain data and the ecological type data; The initial map data is updated based on preset auxiliary data to obtain target map data in response to the map generation instruction.
2. The method according to claim 1, characterized in that Before obtaining the map generation instruction, the method further includes: Get global map parameters; Creating a global map area based on the global map parameters, and dividing the global map area to obtain at least one local map area; A priority is configured for each local map area, and a map generation instruction corresponding to each local map area is created based on the priority configuration result.
3. The method according to claim 2, characterized in that After obtaining the target map data in response to the map generation instruction, the method further includes: Render the corresponding local map area according to the i-th target map data, where i is a positive integer; Splicing the rendered local map area at the position corresponding to the global map area; Determine whether the stitched map area is the same size as the global map area; If so, a global map is obtained based on the stitching results; If not, i is incremented by 1, and the step of rendering the corresponding local map area according to the i-th target map data is executed.
4. The method according to claim 1, characterized in that: The step of selecting a basic noise algorithm and creating basic terrain data according to the map generation instruction includes: Parsing the map generation instruction to obtain at least one plane position data, and selecting a basic noise algorithm corresponding to the map generation instruction according to the parsing result; Calculate the height value corresponding to each plane position data according to the basic noise algorithm; The various plane position data and their corresponding height values are fused, and basic terrain data is obtained according to the fusion result.
5. The method according to claim 1, characterized in that The calculating of ecological type data based on the target plane position data and the basic terrain data includes: Determine the target plane position corresponding to the target plane position data, and the plane position corresponding to each plane position data; Calculating reference distances between the target plane position and each plane position; selecting an ecological noise algorithm based on the basic terrain data; The reference distance and the height value corresponding to each plane position data are input into the ecological noise algorithm, and the output results are fused to obtain ecological type data.
6. The method according to claim 1, characterized in that The obtaining of the initial map data by iteratively calculating the basic terrain data and the ecological type data comprises: selecting a geomorphic noise algorithm based on the ecological type data; Inputting the respective plane position data into the topographic noise algorithm, and fusing the output results to obtain a topographic height value; Superimposing the height values corresponding to the various plane position data with the topographic height values, and fusing the various plane position data into the superimposed result to obtain topographic data; Initial map data is created based on the ecological type data and the landform data.
7. The method according to claim 1, characterized in that The updating of the initial map data based on the preset auxiliary data to obtain the target map data in response to the map generation instruction includes: Selecting auxiliary data corresponding to the initial map data in the auxiliary database; Calculating the initial map data and the auxiliary data using the corresponding operation rules of the auxiliary data to obtain detail data; Based on the detailed data, the initial map data is updated to obtain target map data in response to the map generation instruction.
8. A data processing device, characterized in that: include: An acquisition module, configured to acquire a map generation instruction; A creation module, configured to select a basic noise algorithm and create basic terrain data according to the map generation instruction; A calculation module is configured to obtain initial map data by iteratively calculating the basic terrain data, wherein the calculation module is further configured to: select target plane position data from at least one plane position data, the plane position data being obtained by parsing the map generation instruction; calculate ecological type data based on the target plane position data and the basic terrain data, the ecological type data being the ecological type of the map model generated in the target map area corresponding to the map generation instruction; obtain initial map data by iteratively calculating the basic terrain data and the ecological type data; The updating module is configured to update the initial map data based on preset auxiliary data to obtain target map data in response to the map generation instruction.
9. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by the processor, the steps of the data processing method described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for simulation of real celestial body ecological distribution
CN107945280A
Method for representing terrain, method for creating terrain primitives, and apparatus using the methods
US20140333616A1