A method and system for generating game maps based on artificial intelligence simulation
By introducing ecological simulation of resource agents into game map generation, the problem of insufficient resource distribution logic is solved, and the self-interpretation and scarcity gradient of resource distribution are realized, thereby improving the exploratory nature and strategic depth of the game map.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU XINGHUI ENTERTAINMENT CO LTD
- Filing Date
- 2025-12-17
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies lack systematic logic in resource distribution when generating survival building or open-world game maps, making it difficult to form a stable global scarcity gradient and a self-explanatory resource network. Furthermore, the initial resource distribution is only partially coupled with the dynamic processes of the world, affecting long-term explorability and strategic depth.
Using an AI-based simulation approach, resource agents are initialized within grid cells, vitality values are calculated based on terrain parameters and survival requirement parameters, and resource agents compete, depend on, move, reproduce, or are removed through iterative ecological simulation to generate a resource ecological distribution map. Finally, the map is fused with basic terrain data to generate a game map.
It enhances the inherent logic and interpretability of resource distribution, naturally forming gradients and transition zones in resource carrying capacity, reducing repetitive exploration, and improving the long-term explorability and strategic depth of the game map.
Smart Images

Figure CN121648569B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and system for generating game maps based on artificial intelligence simulation. Background Technology
[0002] In survival-building or open-world games, existing technologies often employ procedural generation methods to construct terrain and ecological parameter fields in order to generate maps suitable for long-term exploration and resource gathering. A typical approach is to generate a continuous terrain height field based on consistent noise and its multi-scale superposition, and further generate environmental parameter fields such as humidity and temperature. In some implementations, domain distortion and other transformations are applied to the noise field to enhance the naturalness of the macroscopic form. Subsequently, the system divides biomes such as forests, grasslands, and mountains according to the combination relationship between height and environmental parameters, and generates corresponding surface materials and vegetation appearances accordingly, thereby obtaining a visually continuous and scalable large-scale map.
[0003] In terms of resource generation, a common approach is to generate resource points in the map space and instantiate corresponding entities (such as trees, rocks, mineral nodes, etc.) based on the biome type and preset density / probability parameters. Some engine frameworks also use a process of generating spatial point sets, filtering, rule modification, and instantiation to achieve batch deployment.
[0004] However, the above methods still have shortcomings in expressing the systematic logic of resource distribution: resource placement is often mainly driven by global parameters and local probability / noise fields, and the interdependence, competition or exclusion relationships between different resource categories are mostly reflected by a few heuristic rules, resulting in insufficient spatial correlation and interpretability across resources, making it difficult to form a stable global scarcity gradient and a self-explanatory resource network; at the same time, the initial distribution of resources and subsequent refresh / evolution mechanisms are only partially coupled with the dynamic process of the world in some implementations, thus affecting long-term explorability and strategy depth.
[0005] To address this issue, some existing solutions introduce local dependency rules (e.g., restricting the generation of advanced resources to the vicinity of basic resources, or increasing vegetation density around water bodies). However, these rules are mostly local constraints, making it difficult to uniformly characterize the combined effects of multiple resources at the spatial level under controllable costs. While simulations based on ecological competition / evolution can enhance the regularity of distribution, they typically present engineering challenges such as high computational costs and limitations in real-time generation and controllability. Other solutions use machine learning and other methods for procedural content generation, but challenges remain in training data dependency, constraint controllability, and unified modeling with resource ecological mechanisms. Summary of the Invention
[0006] In view of the aforementioned existing problems, the present invention is proposed.
[0007] This invention provides a game map generation method based on artificial intelligence simulation, which systematically solves the problems of resource allocation based on probability after noisy grouping, node independence and predictability, and lack of ecological logic and scarce gradient.
[0008] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0009] This invention provides a method for generating game maps based on artificial intelligence simulation, comprising:
[0010] Step S1: Obtain basic terrain data and determine the map range, then discretize the map range into multiple grid cells and establish a set of terrain parameters for each grid cell;
[0011] Step S2: Initialize multiple resource agents within the grid cell. Each resource agent corresponds to at least one type of collectable or usable virtual resource and is associated with survival requirement parameters. The survival requirement parameters include at least the suitable range for terrain parameters and the proximity or distance requirements for other resource agents.
[0012] Step S3, iteratively execute the ecological simulation, in each round:
[0013] Vitality values are calculated based on the terrain parameters and survival requirement parameters of the grid cell where the resource agent is located. Competition or dependency is performed between resource agents according to preset interaction rules to update the vitality values. The resource agents are moved, reproduced, or removed according to preset update rules to update their positions and numbers. When the termination condition is met, a resource ecological distribution map is generated based on the final position and vitality value of the resource agents. The resource ecological distribution map is mapped to a list of resource entities and fused with the basic terrain data to output game map data for loading by the game engine.
[0014] Among them, a monotonically bounded vitality value is generated based on the sub-item suitability score aggregation and is updated smoothly by round, and the renewable target terrain parameter field is maintained and competitive decay is superimposed after natural recovery.
[0015] As a preferred embodiment of the game map generation method based on artificial intelligence simulation described in this invention, the set of terrain parameters includes one or more of the following: height, slope, humidity, temperature, distance to water bodies, and soil type.
[0016] As a preferred embodiment of the game map generation method based on artificial intelligence simulation described in this invention, the calculation of vitality value includes:
[0017] The matching degree between the set of terrain parameters and the survival requirement parameters is evaluated, and the matching degree is converted into a vitality value according to the vitality calculation rules;
[0018] The process of converting matching degree into vitality value includes:
[0019] For each type of terrain parameter in the terrain parameter set, the values of the terrain parameters are truncated by a threshold according to the suitable range in the survival requirement parameters, and a sub-item suitability score is generated. The sub-item suitability scores are normalized and aggregated based on preset weights to obtain the matching degree. The matching degree is restricted to the preset upper and lower bounds of vitality through monotonic mapping to obtain the original vitality value, and the original vitality value is smoothed by round inertia to obtain the environmental vitality value used for determining movement, reproduction or removal.
[0020] As a preferred embodiment of the game map generation method based on artificial intelligence simulation described in this invention, the update rules include: removing resource agents with vitality values below a first threshold; generating derivative resource agents in adjacent grid cells for resource agents with vitality values above a second threshold; and moving resource agents to adjacent grid cells that increase their vitality values.
[0021] As a preferred embodiment of the game map generation method based on artificial intelligence simulation described in this invention, the competition includes: when the distance between the first resource agent and the second resource agent is less than the influence radius, performing attenuation update on the target terrain parameters on which the second resource agent depends, and the result of the attenuation update is used for the calculation of the vitality value in subsequent rounds;
[0022] The decay update of the target terrain parameters on which the second resource agent depends includes:
[0023] At the grid cell level, target terrain parameter fields corresponding to basic terrain data are maintained for terrain parameter types that can be affected by competition. In each iteration, the target terrain parameter fields are first replenished to the basic terrain parameters according to the natural recovery rule. When competition is triggered, an influence kernel that decays with distance is constructed based on the spatial distance between the first resource agent and the grid cell, and the influence radius is limited. The influence kernel is superimposed with a preset decay intensity to obtain the competition decay amount and applied to the target terrain parameter field. A saturation lower limit is applied to the updated target terrain parameter field. In the lifespan value calculation of subsequent rounds, the target terrain parameter field and the basic terrain parameters are switched according to the target type set of the resource agent, so that the result of the competition decay enters the matching degree evaluation and lifespan value calculation link.
[0024] As a preferred embodiment of the game map generation method based on artificial intelligence simulation described in this invention, the dependency includes: when the distance between the third resource agent and the fourth resource agent is greater than the association range, a penalty update is applied to the vitality value of the third resource agent.
[0025] As a preferred embodiment of the game map generation method based on artificial intelligence simulation described in this invention, the generation of the resource ecosystem distribution map includes: marking resource entities at their final locations according to resource agent categories; when multiple candidate resource entities exist in the same grid cell, determining the uniquely marked resource entity based on vitality value and resource priority.
[0026] As a preferred embodiment of the game map generation method based on artificial intelligence simulation described in this invention, the fusion includes: writing a list of resource entities into a map data structure corresponding to the basic terrain data, and recording a random seed and simulation parameters for the map data structure.
[0027] Secondly, the present invention provides a game map generation system based on artificial intelligence simulation, comprising:
[0028] The terrain data module is used to provide basic terrain data and determine the terrain parameter set for map extent and raster cells;
[0029] The agent management module is used to initialize and maintain resource agents and their survival requirement parameters;
[0030] An ecological simulation engine for iteratively calculating vitality values and performing updates such as competition, dependence, movement, reproduction, or removal;
[0031] The distribution map generation module is used to generate resource ecosystem distribution maps and output a list of resource entities;
[0032] The map compositing module is used to merge the list of resource entities with basic terrain data and output game map data.
[0033] As a preferred embodiment of the game map generation system based on artificial intelligence simulation described in this invention, the ecological simulation engine is executed in parallel according to the block division of the map range, and the resource agent state is exchanged at the block boundary through a shared boundary buffer.
[0034] Through the above technical solution, the present invention can achieve at least the following beneficial effects:
[0035] 1) To address the issues of resource placement relying on static probability sampling and different resources being independent of each other, this invention establishes resource agents and survival requirement parameters for each type of resource in step S2, and in step S3, it links suitability assessment, interactive updates, and movement / reproduction / removal in a closed loop through multiple iterations. This makes resource distribution no longer a set of points randomly sampled in a single instance, but a spatial result jointly shaped by competition and interdependence among resources. This enhances the ability to express symbiotic, exclusionary, and substitution relationships among resources from a mechanistic perspective, thereby improving the internal logic and interpretability of resource distribution.
[0036] 2) To address the problem that local rules are difficult to form a global scarce gradient and boundary zone, this invention introduces a regenerable target terrain parameter field in the raster layer, and stipulates that each round first restores naturally and then superimposes competitive attenuation. At the same time, the updated target field is connected back to the matching degree evaluation and vitality calculation link of subsequent rounds, so that the competitive impact is not limited to point-to-point interaction, but can be deposited as changes in the continuous spatial field. As a result, gradients, transition zones and stable boundaries of resource carrying capacity naturally appear on the map scale, promoting the formation of a more self-explanatory resource network structure and regional scarcity pattern.
[0037] 3) To address the issue that players often summarize resources as equivalent to fixed biomes, leading to repetitive exploration and strategy space convergence, this invention allows multiple rounds of evolution to determine the final destination of resources: under the same basic terrain conditions, whether a resource survives, migrates to where, and expands locally depends on the monotonic bounded mapping of vitality values, round-based inertial smoothing, and competition / dependency triggering conditions; therefore, resource distribution is more of a patch and corridor generated by rules and interactions, rather than a simple biome label mapping, reducing the certainty of following a map and enhancing the space for path selection and risk-reward trade-offs during the exploration process.
[0038] 4) To address the problem of resource distribution being out of sync with long-term changes and the difficulty in maintaining long-term explorability, this invention uses a regenerative field mechanism that combines natural recovery with competitive decay to provide a recoverable dynamic balance for the resource-bearing environment. When needed, local areas can be recalculated block by block or iterated incrementally, allowing the resource pattern to be rebalanced according to strategies / disturbances without having to reset the entire map. At the same time, recording random seeds and simulation parameters ensures reproducible generation, and block parallelism and boundary buffer exchange improve the efficiency of large map generation and maintain spatial continuity, thus better adapting to the continuous support requirements of survival building games for long-term resource gathering and base expansion. Attached Figure Description
[0039] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation on the scope of this application.
[0040] Figure 1 This is a flowchart of a game map generation method based on artificial intelligence simulation in an embodiment.
[0041] Figure 2 This is a framework diagram of a game map generation system based on artificial intelligence simulation in one embodiment. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0043] All terms used in this application (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0044] Example 1:
[0045] like Figure 1 As shown, this application proposes a game map generation method based on artificial intelligence simulation, including the following steps:
[0046] Step S1: Acquire basic terrain data and determine the map extent. In this embodiment, the basic terrain data is a set of terrain parameter values aligned with the map coordinate system. It is pre-stored by the electronic device before generation or calculated during the same generation process. It can at least provide parameter values or deducible values for each location for the subsequent establishment of terrain parameter sets. Specifically, the map extent is defined by the minimum and maximum map coordinates and is fixed as a constant at the beginning of generation to ensure that the distance calculation in subsequent rounds is consistent with the grid index. When there are missing measurements or out-of-bounds in the basic terrain data, the corresponding location can be backfilled by taking the average of the same type of terrain parameters from neighboring grids. If there are not enough neighboring grids, the default value is maintained and it does not participate in the competitive decay in subsequent rounds to avoid the propagation of missing measurements causing the life calculation link to become unusable. The map extent is discretized into multiple grid units and a terrain parameter set is established for each grid unit. Further, the grid unit is a discrete calculation unit of the map extent, and its side length can be taken from the commonly used range of 1 to 8 in map coordinate units to achieve a balance between generation accuracy and calculation cost, and remains unchanged after being determined at the beginning of generation. Similarly, the terrain parameter set is stored using raster cells as indexes, and is expressed using the same units or normalized intervals as the base terrain data. The same unit system is maintained for the same terrain parameter type throughout the map. When the base terrain data is a continuous value field, the value of the raster can be sampled at the center of the raster. When the base terrain data is discrete, the type code is used as the value of the raster to ensure that the subsequent threshold truncation and matching degree evaluation have consistent input.
[0047] Step S2 involves initializing multiple resource agents within a grid cell. For example, a resource agent is a discrete object evolving within the grid space, containing at least a resource type identifier, a grid index of its current location, a reference to survival requirement parameters, and state variables used for vitality updates. Specifically, the initial location of a resource agent can be obtained by sampling within the map area using a pseudo-random sequence generated by an electronic device based on a random seed, or determined by an initial distribution density pre-specified by a technician. When multiple similar resource agents are sampled within the same grid cell, they can be merged into one resource agent and its initial vitality value set to a value near the upper bound, or multiple resource agents can be retained and naturally eliminated through a competition mechanism in subsequent rounds to ensure that the initialization does not result in unexplained extreme density due to overlap.
[0048] Each resource agent corresponds to at least one type of collectable or usable virtual resource and is associated with survival requirement parameters. The survival requirement parameters include at least the suitable range for terrain parameters and the proximity or distance requirements of other resource agents.
[0049] In this embodiment, the suitable interval is determined by a suitable lower bound and a suitable upper bound, and a transition zone width can be configured to control the smooth transition at the interval boundary. The suitable lower bound, suitable upper bound, and transition zone width use the same unit or the same normalized interval as the terrain parameter values. Furthermore, the proximity or distance requirement is expressed by a preset distance threshold. The distance is calculated based on the map coordinates of the center point of the grid cell. The distance threshold can be taken from 1 to 20 grid side lengths to cover nearest neighbor dependency and mesoscale separation. When the map area is small or the grid side length is large, the distance threshold can be scaled proportionally to the grid side length to avoid the dependency rules becoming invalid at the spatial scale.
[0050] Step S3, iteratively execute the ecological simulation, in each round:
[0051] Vitality values are calculated based on the terrain parameters and survival requirement parameters of the grid cell where the resource agent is located. Competition or dependency is performed between resource agents according to preset interaction rules to update the vitality values. The resource agents are moved, reproduced, or removed according to preset update rules to update their positions and numbers. When the termination condition is met (a preset number of rounds is reached or the overall change in several consecutive rounds is lower than a threshold), a resource ecological distribution map is generated based on the final position and vitality value of the resource agents. The resource ecological distribution map is mapped to a list of resource entities and merged with the basic terrain data to output game map data for loading by the game engine.
[0052] Specifically, the execution order of each round can be fixed as follows: first calculate the vitality value, then perform competition and dependency updates, and finally perform movement, reproduction, or removal. This ensures that the impact of interaction rules can enter the state update of the same round and continue to accumulate in the next round. Optionally, to ensure the fairness of updates between different resource types, competition and dependency updates within the same round can be accumulated in a buffer variable first, and then written back to the vitality value and target terrain parameter fields all at once. When multiple resource agents simultaneously request to move to the same adjacent grid cell, priority can be given to those with higher environmental vitality values. If the environmental vitality values are the same, the decision is made based on the order number derived from the random seed, so as to avoid nondeterminism leading to reproduction failure.
[0053] Furthermore, the preset number of rounds can be a commonly used range of 30 to 300 to balance convergence and computational cost. For several consecutive rounds, the number can be 3 to 10 to avoid occasional fluctuations being misjudged as convergence. Specifically, the overall change can be characterized by the change ratio of the total number of resource agents and the average change amplitude of the target terrain parameter fields. The change ratio can be calculated as the ratio of the difference in the number of resource agents between two adjacent rounds to the number in the previous round, and the average change amplitude can be calculated by averaging the absolute difference of the target terrain parameter fields between two adjacent rounds across the entire map. The threshold can be in the range of 0.001 to 0.05 and can be set by technical personnel according to the stability requirements of the verification map to avoid setting it to 0, which would make it difficult to trigger termination and cause unnecessary iterations.
[0054] Among them, the ecological simulation engine generates a monotonically bounded vitality value based on the terrain suitability sub-score and updates it smoothly in rounds, and maintains the renewable target terrain parameter field and superimposes competitive decay to form a scarce gradient after natural recovery; the ecological simulation engine represents the program module that is called by the electronic device to execute step S3;
[0055] In this embodiment, monotonically bounded means that the vitality value does not decrease as the matching degree increases, and the vitality value is limited between a preset lower bound and a preset upper bound, thereby avoiding unbounded growth or abnormally negative vitality caused by extreme terrain input. Similarly, the round-based smooth update is controlled by a smoothing coefficient, which can be in the range of 0.05 to 0.6. The default value is 0.2 to strike a balance between response speed and stability, avoiding a value of 0 that would cause vitality to be completely unresponsive to the new environment, or a value of 1 that would cause vitality to completely follow the instantaneous matching degree, resulting in frequent migration and frequent breeding fluctuations.
[0056] In this embodiment, the set of terrain parameters includes one or more of the following: height, slope, humidity, temperature, distance to water body, and soil type.
[0057] Specifically, altitude can be expressed in map coordinate units or as a dimensionless value normalized to 0 to 1. Slope can be calculated from the altitude difference between adjacent grid cells and written into the terrain parameter set during the preprocessing stage. Furthermore, humidity and temperature can be normalized values of 0 to 1 for direct comparison with suitable ranges. Water body distance can be calculated based on the shortest path distance or Euclidean distance from each grid cell to the nearest water body grid cell and expressed in units of grid side length. Soil type can be expressed using integer codes and converted into sub-item scores based on type matching in the suitability assessment.
[0058] In this embodiment, calculating the vitality value includes:
[0059] The matching degree between the set of terrain parameters and survival requirement parameters is evaluated, and the matching degree is converted into a vitality value according to the vitality calculation rules;
[0060] Converting match score to vitality value includes:
[0061] For each type of terrain parameter in the terrain parameter set, the values of the terrain parameters are truncated according to the suitable range in the survival requirement parameters, and sub-item suitability scores are generated. The sub-item suitability scores are normalized and aggregated based on preset weights to obtain the matching degree. The matching degree is restricted to the preset upper and lower bounds of vitality through monotonic mapping to obtain the original vitality value. The original vitality value is then smoothed by round-inertia to obtain the environmental vitality value used for determining movement, reproduction, or removal.
[0062] In this embodiment, threshold truncation is used to limit the impact of extremely unsuitable inputs on sub-item scores, keeping the sub-item scores within the range of 0 to 1. For example, the transition band width is used to control the transition slope from perfectly suitable to completely unsuitable. Its default value can be 0.05 to 0.3, which corresponds to the range of terrain parameters. It can also be adjusted according to the ecological sensitivity of resource types to avoid the transition band being too small, causing abrupt changes in scores at the boundary, or the transition band being too large, resulting in insufficient differentiation between different terrains.
[0063] When the bottleneck effect needs to be reflected, normalized aggregation is replaced with multiplicative aggregation to amplify the inhibitory effect of key terrain parameter deviations on matching degree. When the local terrain change amplitude is small, the preset weights are scaled based on the local change amplitude before participating in aggregation to suppress matching degree fluctuations caused by local noise. Optionally, the bottleneck effect is used to significantly lower the matching degree when the sub-score of any key terrain parameter is too low, thereby more strongly inhibiting survival and expansion in areas where key conditions are not met. Furthermore, to avoid excessive elimination caused by multiplicative aggregation resulting in a constant matching degree of zero when the sub-score is zero, the probability of zero score can be reduced by increasing the transition zone width or raising the low matching degree cutoff threshold, and the reproduction trigger intensity can be reduced by lowering the second threshold, making resource evolution more in line with the intuition of continuous change while still maintaining interpretable bottleneck constraints. Furthermore, the local change amplitude is obtained by the difference between the maximum and minimum values within the neighborhood grid set. The neighborhood grid set can be a square neighborhood with a side length of 3 to 7 grids centered on the current grid, to strike a balance between suppressing local noise and maintaining terrain differences. Specifically, the weighted scaling smoothing constant is used to avoid abnormal weight amplification or suppression when the local change amplitude is close to zero. Its default value can be in the range of 0.01 to 0.5, and it can be adjusted according to whether the terrain parameters have been normalized to avoid being too small and causing numerical sensitivity, or too large and causing the scaling effect to be insignificant.
[0064] Furthermore, the preset weights are positive coefficients used to adjust the contribution ratio of each terrain parameter type to the matching degree. By default, all terrain parameter types participating in the matching evaluation can be assigned the same weight, which is fixed during the resource type configuration stage. Optionally, the preset weights can be selected from 0.1 to 10 to cover both weak and strong correlation requirements, and can be determined by technical personnel through parameter tuning based on the interpretability of resource distribution in historical maps or verification maps. When the total weights involved in the aggregation are too small, resulting in numerical instability, all weights can be rolled back to the same weight to ensure that the normalized aggregation is calculable.
[0065] In this embodiment, the preset lower and upper bounds of vitality are set during the resource type configuration stage. By default, they can be a normalized range of 0 to 1, or an integer range of 0 to 100 to adapt to the game engine's internal numerical system, but they remain consistent throughout the same map generation process. Furthermore, the low matching degree truncation threshold and the high matching degree truncation threshold are threshold pairs within the range of 0 to 1, and the low matching degree truncation threshold is less than the high matching degree truncation threshold. By default, they can be 0.2 and 0.8 to form a clear saturation zone. Thresholds that are not 0 and 1 can avoid almost all matching degrees falling into the linear zone, resulting in a lack of stable state, and can also avoid premature saturation, resulting in insufficient vitality differentiation between different terrains.
[0066] Specifically, the environmental vitality value is a state variable used for threshold determination. By default, it can be initialized to the original vitality value in the first round to avoid incomputability due to missing historical items. Furthermore, the update frequency of round-based inertial smoothing is consistent with the round-based ecological simulation, and the smoothing coefficient is set separately for each type of resource agent to reflect the inertial differences of different resources. When the smoothing coefficient is smaller, the environmental vitality value changes more gently, which is suitable for resource types that want to form coherent patches. When the smoothing coefficient is larger, the environmental vitality value responds faster, which is suitable for resource types that want to more sensitively follow terrain changes.
[0067] The vitality calculation rule, which converts matching degree into vitality value, can be organized in the manner of range constraint, monotonic mapping, and round smoothing, so that the vitality value falls within a controllable range and the vitality value does not decrease when the matching degree increases.
[0068] In one implementation, during the first round of ecological simulation... Inside the wheel, resource intelligent agent Located in grid cell At that time, the matching degree of each terrain parameter to its survival needs can be converted into... The individual scores are then combined to form the matching degree. ;
[0069] Interval suitability can be expressed as linear membership with threshold truncation:
[0070] (1)
[0071] In equation (1), Representing resource intelligent agents In the Wheelset Terrain Parameter Types Suitability score, Indicates the resource agent ID. Indicates the terrain parameter type number, Indicates the iteration round number. Representing resource intelligent agents For terrain parameter types The suitable lower boundary, Representing resource intelligent agents For terrain parameter types The suitable upper limit, Represents grid cells Terrain parameter types The value of , Representing resource intelligent agents In the The grid cell number where the wheel is located. Representing resource intelligent agents For terrain parameter types The width of the transition zone;
[0072] The matching degree can be achieved using weighted normalization aggregation, making the influence of different terrain parameters adjustable according to resource type:
[0073] (2)
[0074] In equation (2), Representing resource intelligent agents In the Wheel matching degree, Representing resource intelligent agents The set of terrain parameter types involved in the matching evaluation Representing resource intelligent agents For terrain parameter types Weighting coefficients;
[0075] When converting the matching degree to a vitality value, threshold truncation and piecewise linear mapping can be used to limit the output range. And maintain monotony:
[0076] (3)
[0077] In equation (3), This represents the raw vitality value directly obtained from the matching degree. Representing resource intelligent agents The lower limit of vitality, Representing resource intelligent agents The upper limit of vitality, Representing resource intelligent agents Low-match truncation threshold, Representing resource intelligent agents High-match cutoff threshold;
[0078] To reduce movement and reproduction fluctuations caused by frequent jumps in vitality due to minor fluctuations in matching degree, round smoothing is introduced into the vitality calculation rules to make vitality exhibit an inertial response to short-term changes:
[0079] (4)
[0080] In equation (4), Representing resource intelligent agents In the The environmental vitality value of the wheel. Representing resource intelligent agents The smoothing coefficient, Representing resource intelligent agents In the The wheel's environmental vitality value;
[0081] For example, the smoothing coefficient can be set according to the resource type's response speed to environmental changes, and saved along with the random seed in the map generation parameter record to ensure reproducibility. Furthermore, when there are cases where the matching degree remains almost unchanged for several consecutive rounds but the environmental vitality value still fluctuates frequently, the smoothing coefficient can be lowered to around 0.05, or the gap between the low matching degree cutoff threshold and the high matching degree cutoff threshold can be appropriately increased to expand the linear region, thereby reducing the probability of threshold determination triggering back and forth near the boundary.
[0082] Within the same framework, if a stronger weak link effect is needed, the aggregation of matching scores can be replaced with a weighted geometric mean instead of a weighted arithmetic mean, making the decrease in matching scores more pronounced when any key terrain parameter deviates:
[0083] (5)
[0084] In equation (5), Representing resource intelligent agents In the Multiplicative aggregation matching degree of the wheel, Indicates the terrain parameter type index during weight normalization;
[0085] If a small, interpretable model is used to directly map the terrain suitability score to a vitality value, the output range can be preserved and the monotonicity can be expressed by constraining the coefficient sign:
[0086] (6)
[0087] In equation (6), Representing resource intelligent agents The intercept coefficient, Representing resource intelligent agents For terrain parameter types The linear contribution coefficient, when for all Pick hour, Increase will drive No decrease;
[0088] When the weighting coefficients are affected by small local topographical fluctuations that amplify noise, the weights can be scaled to reflect the magnitude of local changes before being aggregated for matching degree.
[0089] (7)
[0090] In equation (7), Indicates the type of terrain parameters In grid cells The magnitude of local change within the neighborhood. Indicates the raster cell index within the neighborhood. Represented by grid cells The neighborhood grid set centered on, Represents grid cells Terrain parameter types The value of ;
[0091] (8)
[0092] In equation (8), Representing resource intelligent agents In the Wheelset Terrain Parameter Types Scaling weights Representing resource intelligent agents The weight scaling smoothing constant will be used to calculate the weight scaling smoothing constant in the above equation. replace In At that time, the influence of regions with small local changes on the parameter is compressed, which facilitates the connection with subsequent rounds of competition or dependent updates;
[0093] In each round of ecological simulation, the ecological simulation engine compares the terrain value of the grid cell where the resource agent is located with the suitable range of its survival needs, and constructs a sub-item suitability score for the terrain parameters, as shown in Equation (1). Then, according to the weights preset by the technicians in the resource type configuration stage, the sub-item scores are normalized and aggregated to obtain the matching degree, as shown in Equation (2). Subsequently, according to the upper and lower bounds and truncation thresholds set in the configuration stage, the matching degree is mapped to the original vitality value, as shown in Equation (3) or Equation (6). Then, the vitality is updated in a round-by-round inertia according to the smoothing intensity preset by the resource type, as shown in Equation (4). If it is necessary to strengthen the short board effect, Equation (5) is used instead of the aggregation method of Equation (2). If it is necessary to suppress the noise amplification in the local flat area of the terrain, the scaling weight is obtained based on the change amplitude of the neighboring terrain and the aggregation process is written back, as shown in Equations (7) and (8). The environmental vitality value obtained in this way will be used as the basis for determining the execution of the movement, reproduction or removal update rules in step S3, and as one of the evaluation inputs for generating the resource ecological distribution map.
[0094] Specifically, the implementation scheme here treats the matching degree as a continuous quantity from 0 to 1, and then generates vitality according to the mapping function, so that the vitality varies within the preset upper and lower bounds; weighted normalization and threshold truncation synthesize multiple terrain dimensions into a single evaluation, and form a saturation zone when it is extremely unsuitable or highly suitable, so as to avoid the amplification of single parameter outliers into the vitality, and facilitate the connection with subsequent competition and dependency updates; inertial updates retain historical states between rounds, reduce frequent migration, frequent removal or abnormal reproduction caused by local noise, and make the changes in the number of resource agents more in line with the intuition of continuous evolution, so as to make the spatial patches of the resource ecological distribution map more coherent; fuzzy membership degree and gradient fitness degree provide a smooth transition at the interval boundary, reduce abrupt changes at the grid boundary, and allow the bandwidth to control the transition width to adapt to the ecological sensitivity of different resource types;
[0095] If we further introduce scaling based on local terrain fluctuations into the weights, we can suppress excessive clustering in areas with small terrain changes and retain discriminative power in areas with large changes. Small interpretable models characterize the relationship between matching degree and vitality with monotonic constraint feature contributions, which is easy to calibrate with a small number of samples while maintaining consistency between the output range and reproducible generation.
[0096] In this embodiment, the update rules include: removing resource agents with vitality values below a first threshold; generating derivative resource agents in adjacent grid cells for resource agents with vitality values above a second threshold; and moving resource agents to adjacent grid cells that increase their vitality values.
[0097] In this embodiment, the competition includes: when the distance between the first resource agent and the second resource agent is less than the influence radius, the target terrain parameters on which the second resource agent depends are updated by attenuation, and the result of the attenuation update is used for the calculation of the vitality value in subsequent rounds.
[0098] Performing decay updates on the target terrain parameters on which the second resource agent depends includes:
[0099] At the raster cell level, target terrain parameter fields corresponding to the base terrain data are maintained for terrain parameter types that can be affected by competition. In each iteration, the target terrain parameter fields are first replenished to the base terrain parameters according to the natural recovery rule. When competition is triggered, an influence kernel that decays with distance is constructed based on the spatial distance between the first resource agent and the raster cell, and the influence radius is limited. The influence kernel is superimposed with the preset decay intensity to obtain the competition decay amount and applied to the target terrain parameter field. A saturation lower limit is applied to the updated target terrain parameter field to avoid the continuous decrease of the target terrain parameter due to long-term competition. Furthermore, the saturation lower limit is related to the terrain parameter type. If the terrain parameter has been normalized to 0 to 1, the saturation lower limit can be taken as 0 to 0.2 by default. If the terrain parameter is a physical unit, the saturation lower limit can be taken as 5 to 30 percentage points of the base terrain parameter value to ensure that the distinguishable terrain input is still retained under long-term competition. Optionally, when a milder competitive effect is desired, the lower saturation limit can be raised or the attenuation coefficient can be lowered; when a stronger competitive effect is desired, the lower saturation limit can be lowered or the attenuation coefficient can be raised. However, it is not recommended to take extreme values to avoid the rapid collapse or complete failure of the target terrain parameter field.
[0100] In subsequent rounds of vitality value calculation, the target terrain parameter field and the basic terrain parameter are switched according to the target type set of the resource agent, so that the result of competition decay enters the matching degree evaluation and vitality value calculation link.
[0101] Specifically, the spatial distance can be calculated as the Euclidean distance between the current position of the first resource agent and the center point of the grid cell, and expressed in units of grid side length, so that the influence radius directly corresponds to the grid scale. For example, the influence radius can be in the range of 2 to 15 grid side lengths to cover the local competitive domain, and the attenuation coefficient can be in the range of 0.01 to 0.3 to control the attenuation intensity of a single round; the influence kernel can adopt a form that decreases linearly with distance to ensure a natural transition at the boundary, and when multiple competitors act on the same grid cell at the same time, the attenuation amount is accumulated and a saturation lower limit constraint is applied before writing back to avoid superposition that could cause the target terrain parameters to exceed the limit.
[0102] In this embodiment, the target terrain parameter field corresponds one-to-one with the basic terrain parameter and uses the same unit and value range. During initialization, it is aligned with the basic terrain parameter so that competition attenuation only changes the target field without altering the underlying terrain data itself. Furthermore, the natural recovery rule is controlled by a natural recovery coefficient. The natural recovery coefficient can default to a range of 0.01 to 0.2 to reflect slow replenishment and can be set according to the terrain parameter type. If the natural recovery coefficient is too small, competition attenuation will accumulate over a long period and be difficult to recover; if the natural recovery coefficient is too large, the competition impact will be difficult to retain, making it difficult to form a stable scarcity pattern.
[0103] In the competition rules, the target terrain parameters are updated by decaying through maintaining a set of renewable target terrain parameter fields in the raster layer. These fields are used for calculating the life value in subsequent rounds, thereby forming a scarce gradient and spatial boundary that varies with distance.
[0104] In one implementation: in the... In the ecological simulation, for each grid cell Types of terrain parameters that can be affected by competition Maintain target terrain parameters Its initialization satisfies:
[0105] (9)
[0106] In equation (9), Represents grid cells In the initial round, the terrain parameter type was selected. The target terrain parameters, Represents grid cells Terrain parameter types The basic value, Indicates the grid cell number. Indicates the terrain parameter type number;
[0107] When the first resource intelligent agent With the second resource intelligent agent When the distance is less than the radius of influence, it can be equivalent to the grid where the second resource agent is located. Falling within the influence range of the first resource agent, and calculating the attenuation intensity using a linear influence kernel within a fixed radius:
[0108] (10)
[0109] In equation (10), Represents the first resource intelligent agent In the Wheelset grid unit Terrain parameter types The impact of kernel value, Represents the first resource intelligent agent In the Wheel and grid unit distance, Represents the first resource intelligent agent For terrain parameter types radius of influence Indicates the ID of the first resource agent. Indicates the grid cell number. Indicates the terrain parameter type number, Indicates the iteration round number;
[0110] Within the same round, for each grid cell With parameter type Summarize the decay of all competitors:
[0111] (11)
[0112] In equation (11), Indicates the first Wheel acts on grid cell Terrain parameter types The total attenuation, Indicates the first The first set of resource agents participating in the competitive decay calculation. Represents the first resource intelligent agent For terrain parameter types The attenuation coefficient;
[0113] To prevent the target terrain parameters from decreasing indefinitely and to stably generate scarce gradients, updates can be performed in each round in the order of superimposed competitive decay after natural recovery, and a saturation lower bound can be introduced:
[0114] (12)
[0115] In equation (12), Indicates the first Updated target terrain parameters Represents grid cells Terrain parameter types The lower limit of saturation, Represents grid cells Terrain parameter types The natural recovery coefficient, Indicates the first Target terrain parameters of the wheel, Indicates the values of basic terrain parameters. Indicates the total attenuation;
[0116] In the calculation of vitality value, the second resource intelligent agent The target terrain parameters used can be switched through the target type set, so that competition decay only affects the tagged dependencies:
[0117] (13)
[0118] In equation (13), Representing resource intelligent agents In the The effective terrain parameters used when calculating the vehicle's vitality value. Representing resource intelligent agents The set of terrain parameter types marked as targets by the competing rules. Indicates the target terrain parameters. This represents the values of basic terrain parameters; based on this substitution relationship, the suitability assessment can be performed by substituting the values in the original formula. Replace with This allows the decay update results to be incorporated into the lifespan value calculation chain in subsequent rounds;
[0119] In each round of ecological simulation, the terrain data module maintains a renewable target terrain parameter field for each grid cell and aligns it with the basic terrain parameters during initialization, as shown in Equation (9). During the competition phase, the ecological simulation engine calculates the influence kernel that varies with distance and limits the influence radius based on the spatial distance from the first resource agent to the grid location, as shown in Equation (10). Combined with the attenuation intensity preset in the resource type configuration phase, the influence of multiple competitors in the same round is summarized to obtain the total attenuation amount, as shown in Equation (11). Subsequently, the target terrain parameters are updated in the order of "natural recovery followed by competition attenuation", and a saturation lower limit is introduced to avoid irreversible degradation caused by long-term competition, as shown in Equation (12). When entering the next round of vitality assessment, the ecological simulation engine switches between the target terrain parameters and the basic terrain parameters for the vitality assessment based on the target type set of the resource agent, as shown in Equation (13). This target terrain parameter field will be used as the terrain input for the vitality calculation in subsequent rounds, thereby forming a sustainable scarce gradient and boundary zone in the map space.
[0120] Specifically, the decay update extends the competitive influence from agent interaction to the target terrain parameters of the grid layer, allowing resource scarcity to be expressed by a spatially continuous field; the influence kernel correlates the competition intensity with distance, forming a gradient from strong to weak within the influence radius, with a natural transition zone at the boundary, reducing abrupt breaks in resource distribution; the natural recovery term allows the target terrain parameters to gradually recover when there is no continuous competition, forming a dynamic balance between competition decay and recovery, thereby maintaining a stable scarcity pattern in long-term iterations;
[0121] The saturation lower limit prevents the target terrain parameters from being repeatedly decayed to meaningless intervals, ensuring that subsequent vitality calculations retain their distinguishability and preventing resource agents from undergoing large-scale irreversible degradation due to long-term local competition. By using the target terrain parameters as a renewable carrying capacity field, competition does not require changes to the basic terrain data ontology, and reproducibility and terrain consistency remain unchanged. At the same time, it makes it easier for ecological distribution maps to show interpretable patches, corridors, and boundaries, meeting the spatial structure requirements of map generation.
[0122] In this embodiment, the dependency includes: when the distance between the third resource agent and the fourth resource agent is greater than the association range, a penalty update is applied to the vitality value of the third resource agent;
[0123] In this embodiment, generating a resource ecosystem distribution map includes: marking resource entities at their final locations according to resource agent categories; when multiple candidate resource entities exist in the same grid cell, determining a uniquely marked resource entity based on vitality value and resource priority;
[0124] The integration includes: writing the list of resource entities into the map data structure corresponding to the basic terrain data, and recording random seeds and simulation parameters for the map data structure to ensure reproducible generation;
[0125] In this embodiment, the random seed is an integer value that remains unchanged throughout the map generation process. It is used to initialize the resource agent's position, resolve concurrent movement conflicts, and determine uniqueness when vitality is the same, thereby ensuring consistent output under the same input. Furthermore, the simulation parameters include at least the preset number of rounds, overall change threshold, first and second thresholds, preset weights, low-matching-degree truncation thresholds and high-matching-degree truncation thresholds, smoothing coefficient, transition zone width, influence radius, attenuation coefficient, natural recovery coefficient, and saturation lower limit, as well as other parameter values already used in this embodiment. These values are written into the map data structure in a manner corresponding to the resource type or terrain parameter type, allowing third parties to reproduce the experimental conditions and repeatedly generate the same resource ecological distribution map even with only the map data structure.
[0126] Example 2:
[0127] Based on Example 1, see Figure 2 This application also proposes a game map generation system based on artificial intelligence simulation, the system comprising:
[0128] The terrain data module is used to provide basic terrain data and determine the terrain parameter set for map extent and raster cells;
[0129] The agent management module is used to initialize and maintain resource agents and their survival requirement parameters;
[0130] An ecological simulation engine for iteratively calculating vitality values and performing updates such as competition, dependence, movement, reproduction, or removal;
[0131] The distribution map generation module is used to generate resource ecosystem distribution maps and output a list of resource entities;
[0132] The map compositing module is used to merge the list of resource entities with basic terrain data and output game map data;
[0133] In this embodiment, the ecological simulation engine is executed in parallel according to the block division of the map range, and the resource agent state is exchanged through a shared boundary buffer at the block boundary to maintain spatial continuity.
[0134] Specifically, block-based parallelism uses grid cell indices to delineate block boundaries. Boundary buffers cover at least 1 to 3 grid layers to accommodate the impact range of cross-block competition and dependencies. At the end of each round, the current position of the resource agent, its environmental vitality value, and the boundary values of the target terrain parameter fields are exchanged, enabling the next round's distance calculation and influence kernel calculation to be aware of the states of adjacent blocks. Furthermore, when the same resource agent moves across blocks at a block boundary, its original block is updated to the new block after the move determination is completed. During buffer exchange, the unique original block is used as the basis for writing back. If duplicate write-backs occur, the record with the higher environmental vitality value is used, thereby avoiding state splitting under parallel conditions and ensuring spatial continuity and reproducibility.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0136] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of this application and form different embodiments. For example, all the embodiments above can be used in any combination. The information disclosed in this background section is intended only to enhance the understanding of the general background of this application and should not be construed as an admission or in any way implying that such information constitutes prior art known to those skilled in the art.
Claims
1. A method for generating game maps based on artificial intelligence simulation, characterized in that, include: Step S1: Obtain basic terrain data and determine the map range, then discretize the map range into multiple grid cells and establish a set of terrain parameters for each grid cell; Step S2: Initialize multiple resource agents within the grid cell. Each resource agent corresponds to at least one type of collectable or usable virtual resource and is associated with survival requirement parameters. The survival requirement parameters include at least the suitable range for terrain parameters and the proximity or distance requirements for other resource agents. Step S3, iteratively execute the ecological simulation, in each round: Vitality values are calculated based on the terrain parameters and survival requirement parameters of the grid cell where the resource agent is located. Competition or dependence is performed between resource agents according to preset interaction rules to update the vitality values. The resource agents are moved, reproduced, or removed according to preset update rules to update their positions and numbers. When the termination condition is met, a resource ecological distribution map is generated based on the final position and vitality value of the resource agents. The resource ecosystem distribution map is mapped to a resource entity list and fused with the basic terrain data to output game map data for the game engine to load. Among them, a monotonically bounded vitality value is generated based on the sub-item suitability score aggregation and is updated smoothly by round, and the renewable target terrain parameter field is maintained and competitive decay is superimposed after natural recovery.
2. The game map generation method based on artificial intelligence simulation according to claim 1, characterized in that, The set of terrain parameters includes one or more of the following: altitude, slope, humidity, temperature, distance to water bodies, and soil type.
3. The method for generating game maps based on artificial intelligence simulation according to claim 1, characterized in that, The calculated vitality value includes: The matching degree between the set of terrain parameters and the survival requirement parameters is evaluated, and the matching degree is converted into a vitality value according to the vitality calculation rules; Converting match score to vitality value includes: For each type of terrain parameter in the terrain parameter set, the values of the terrain parameters are truncated by a threshold according to the suitable range in the survival requirement parameters, and a sub-item suitability score is generated. The sub-item suitability scores are normalized and aggregated based on preset weights to obtain the matching degree. The matching degree is restricted to the preset upper and lower bounds of vitality through monotonic mapping to obtain the original vitality value, and the original vitality value is smoothed by round inertia to obtain the environmental vitality value used for determining movement, reproduction or removal.
4. The method for generating game maps based on artificial intelligence simulation according to claim 1, characterized in that, The update rules include: removing resource agents with vitality values below a first threshold; generating derivative resource agents in adjacent grid cells for resource agents with vitality values above a second threshold; and moving resource agents to adjacent grid cells that increase their vitality values.
5. The game map generation method based on artificial intelligence simulation according to claim 1, characterized in that, The competition includes: when the distance between the first resource agent and the second resource agent is less than the influence radius, performing a decay update on the target terrain parameters on which the second resource agent depends, and the result of the decay update is used for the calculation of the vitality value in subsequent rounds; The decay update of the target terrain parameters on which the second resource agent depends includes: At the grid cell level, target terrain parameter fields corresponding to basic terrain data are maintained for terrain parameter types that can be affected by competition. In each iteration, the target terrain parameter fields are first replenished to the basic terrain parameters according to the natural recovery rule. When competition is triggered, an influence kernel that decays with distance is constructed based on the spatial distance between the first resource agent and the grid cell, and the influence radius is limited. The influence kernel is superimposed with a preset decay intensity to obtain the competition decay amount and applied to the target terrain parameter field. A saturation lower limit is applied to the updated target terrain parameter field. In the lifespan value calculation of subsequent rounds, the target terrain parameter field and the basic terrain parameters are switched according to the target type set of the resource agent, so that the result of the competition decay enters the matching degree evaluation and lifespan value calculation link.
6. The game map generation method based on artificial intelligence simulation according to claim 1, characterized in that, The dependency includes: when the distance between the third resource agent and the fourth resource agent is greater than the association range, applying a penalty update to the vitality value of the third resource agent.
7. The game map generation method based on artificial intelligence simulation according to claim 1, characterized in that, The generated resource ecosystem distribution map includes: marking resource entities at their final locations according to resource agent categories; when multiple candidate resource entities exist in the same grid cell, determining a unique marked resource entity based on vitality value and resource priority.
8. The method for generating game maps based on artificial intelligence simulation according to claim 1, characterized in that, The fusion includes: writing a list of resource entities into a map data structure corresponding to the basic terrain data, and recording a random seed and simulation parameters for the map data structure.
9. A game map generation system based on artificial intelligence simulation, based on the game map generation method based on artificial intelligence simulation as described in any one of claims 1 to 8, characterized in that, include: The terrain data module is used to provide basic terrain data and determine the terrain parameter set for map extent and raster cells; The agent management module is used to initialize and maintain resource agents and their survival requirement parameters; An ecological simulation engine for iteratively calculating vitality values and performing updates such as competition, dependence, movement, reproduction, or removal; The distribution map generation module is used to generate resource ecosystem distribution maps and output a list of resource entities; The map compositing module is used to merge the list of resource entities with basic terrain data and output game map data.
10. A game map generation system based on artificial intelligence simulation according to claim 9, characterized in that, The ecological simulation engine executes in parallel according to the map's block size, and exchanges the resource agent states at the block boundaries through a shared boundary buffer.