A method for procedural strongly connected graph generation for game levels

By initializing the growth kernel on an N-dimensional regular grid and using exploration, regression, and convergence strategies to generate strongly connected graphs, the randomness and scalability issues of level topology in existing technologies are solved, and efficient generation of level topology with high strategy depth is achieved.

CN122199751APending Publication Date: 2026-06-12GUILIN UNIVERSITY OF TECHNOLOGY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUILIN UNIVERSITY OF TECHNOLOGY
Filing Date
2026-04-08
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

The level topology generated by existing PCG technology relies on a stochastic process, lacks strict mathematical guarantees and active control, makes it difficult to guarantee global properties such as strong connectivity, and is difficult to extend to three-dimensional or higher-dimensional virtual spaces.

Method used

The growth kernel is initialized on a pre-defined N-dimensional regular grid. The growth direction is adaptively selected through three strategies: exploration, regression, and convergence, to generate a strongly connected directed graph, ensuring the optimization of the strict connectivity and looseness of the topology.

🎯Benefits of technology

The generated level topology strictly guarantees strong connectivity, optimizes topology looseness, provides levels with high strategy depth, is suitable for generating virtual scenes in two dimensions, three dimensions and higher dimensions, and has real-time generation capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122199751A_ABST
    Figure CN122199751A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of game development, in particular to a programmed strongly connected graph generation method for a game level, taking an N-dimensional regular grid as a space basis, first initializing a strongly connected subgraph as a growth core, and then entering an iterative growth process: selecting a vertex with the largest number of adjacent idle grid units in the growth core as a current growth point, adaptively switching three strategies of exploration, regression and convergence according to a current growth state and a preset integrity target, determining a target growth direction and executing a new vertex or a directed edge adding operation, and synchronously updating a growth path and the growth core to continuously maintain the strongly connected characteristics of the growth core; when the number of generated vertices reaches a preset scale, the convergence strategy is started, directed edges are completed, all vertices are integrated into the growth core, and finally a directed graph meeting the strongly connected constraint is output as a level topological structure. The application can strictly guarantee the strongly connected characteristic while actively optimizing the topological looseness of the graph, and generates a level structure with high strategy depth.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game development technology, and specifically to a method for generating procedural strongly connected graphs for game levels. Background Technology

[0002] Procedural Content Generation (PCG) technology is widely used in the video game industry to automatically generate game scene elements, such as terrain, buildings, and level layouts. To construct game levels with non-linear exploration experiences and strategic depth, their topological structure is often abstracted into a graph model, where vertices represent key game units (such as rooms and event points), and edges represent the connectivity between them.

[0003] Existing level PCG technologies are mainly divided into two categories: one is learning and generation methods based on aesthetic constraints or samples, which focuses on the imitation and innovation of visual effects or layout styles; the other is maze / map generation methods based on geometric segmentation or space filling, which focus on creating explorable geometric spaces.

[0004] However, the aforementioned methods generally suffer from the following drawbacks: First, they lack rigorous mathematical guarantees. The connectivity of the level topology generated by existing methods largely depends on stochastic processes or local constraints, making it difficult to mathematically guarantee global properties (such as strong connectivity). This can lead to players getting stuck in dead ends or unable to return, thus ruining the game experience. Second, they lack proactive control over topological properties. Existing methods focus on generating spatial forms while neglecting the fine-grained control of key graph theory properties (such as edge density and vertex degree distribution), which directly relates to the nonlinearity of the level and the depth of strategy selection. Finally, they are limited in dimensionality and model. Most methods are fixed on generating two-dimensional planar meshes, making it difficult to extend to three-dimensional or higher-dimensional virtual spaces, and they also lack a universal generation framework independent of the underlying mesh geometry. Summary of the Invention

[0005] The purpose of this invention is to provide a procedural strongly connected graph generation method for game levels, aiming to solve the technical problems of existing level PCG technology generating level topology structures that rely on random processes and lack active control.

[0006] To achieve the above objectives, the present invention provides a method for generating procedural strongly connected graphs for game levels, comprising the following steps:

[0007] Step 1: Initialize a growth kernel on a preset N-dimensional regular grid;

[0008] Step 2: Select the current growth point from the growth kernel, and initiate or continue a growth path based on the current growth point;

[0009] Step 3: Based on the current growth status and the preset integrity target, determine the currently effective growth strategy from the strategy set consisting of multiple growth strategies;

[0010] Step 4: Based on the currently effective growth strategy, determine the target growth direction from multiple adjacent directions of the current growth point on the N-dimensional regular grid;

[0011] Step 5: Based on the target growth direction, perform the operation of creating a new vertex and adding a directed edge, or adding a directed edge, and update the growth path and the growth kernel;

[0012] Step 6: Determine whether the number of generated vertices has reached the preset target: If not, continue to execute steps 2 to 5 for iterative growth; if it has reached the target, output a strongly connected directed graph generated based on the N-dimensional regular grid as the topology of the virtual scene level.

[0013] Optionally, the N-dimensional regular mesh in step 1 is a two-dimensional regular mesh or a three-dimensional regular mesh, where N is an integer not less than 2; the two-dimensional regular mesh is composed of tilable two-dimensional geometric units, and the three-dimensional regular mesh is composed of infillable three-dimensional geometric units; the tilable two-dimensional geometric units are selected from regular polygons, including hexagons, squares, or triangles; the infillable three-dimensional geometric units are selected from regular polyhedra, including cubes.

[0014] Optionally, the growth kernel is a strongly connected subgraph containing at least one vertex. The process of selecting the current growth point from the growth kernel is specifically to select the vertex in the growth kernel that has the largest number of currently adjacent unoccupied grid cells on the N-dimensional regular grid.

[0015] Optionally, the strategy set in step 3 includes an exploration strategy, a regression strategy, and a convergence strategy. The exploration strategy is configured to take priority when it is necessary to add vertices, so as to guide the growth path to extend into unoccupied areas.

[0016] The regression strategy is configured to take priority when the current growth point has no unoccupied adjacent directions, so as to guide the growth path to connect to the existing vertex and return to the growth kernel;

[0017] The convergence strategy is configured to take effect when the number of generated vertices reaches a preset target, so as to incorporate all vertices into the growth kernel by adding directed edges, thereby ensuring the strong connectivity of the graph.

[0018] Optionally, when the exploration strategy takes effect in step 4, it specifically adopts a priority edge-following strategy, and the rules for determining the target growth direction include:

[0019] The direction that points to the least number of unoccupied grid cells that are adjacent to the growth kernel or existing vertices on the growth path is preferred, followed by the direction that is also an unoccupied grid cell.

[0020] Optionally, in step 4, when the regression strategy takes effect, a priority regression strategy is adopted, and the rules for determining the target growth direction include:

[0021] The direction pointing to the vertex with the fewest adjacent vertices in the growth kernel is preferred, followed by the direction of the vertices on the growth path, and finally the direction of the path loop vertex or the direction of the unoccupied grid cell.

[0022] Optionally, in step 4, when the convergence strategy takes effect, a priority backtracking strategy is adopted, and the rules for determining the target growth direction include:

[0023] The direction pointing to the vertex with the fewest adjacent vertices in the growth kernel is preferred, followed by the direction of the non-direct predecessor vertex on the growth path, and finally the direction of the direct predecessor vertex on the growth path.

[0024] Optionally, the strongly connected directed graph generated through the iterative growth process has a topological looseness that satisfies a preset optimization objective, wherein the topological looseness is characterized by the graph’s edge density and the uniformity of vertex degree distribution.

[0025] This invention provides a procedural strongly connected graph generation method for game levels. Based on an N-dimensional regular grid, it first initializes a strongly connected subgraph as a growth kernel, then enters an iterative growth process: The vertex with the most adjacent free grid cells in the growth kernel is selected as the current growth point. Based on the current growth state and a preset integrity target, it adaptively switches between three strategies: exploration, regression, and convergence. The target growth direction is determined according to the strategy, and operations such as creating new vertices or adding directed edges are performed. The growth path and growth kernel are updated synchronously to continuously maintain their strong connectivity characteristics. When the number of generated vertices reaches a preset scale, the convergence strategy is initiated, and directed edges are added to merge all vertices into the growth kernel. Finally, a directed graph satisfying the strong connectivity constraints is output as the level topology. This invention can actively optimize the topological looseness of the graph while strictly ensuring strong connectivity, generating level structures with high strategy depth. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1This is a flowchart illustrating the procedural strongly connected graph generation method for game levels in an embodiment of the present invention.

[0028] Figure 2 This is a schematic diagram of the two-dimensional hexagonal regular grid used in the embodiments of the present invention.

[0029] Figure 3 This is a schematic diagram illustrating the concepts of growth nucleus, growth path, and spatial domain in an embodiment of the present invention.

[0030] Figure 4 This is a schematic diagram illustrating the decision-making process of the exploration strategy in an embodiment of the present invention.

[0031] Figure 5 This is a schematic diagram of the decision-making process of the regression strategy in an embodiment of the present invention. Detailed Implementation

[0032] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0033] This invention provides a procedural strongly connected graph generation method for game levels, comprising the following steps:

[0034] Step 1: Initialize a growth kernel on a preset N-dimensional regular grid;

[0035] Step 2: Select the current growth point from the growth kernel, and initiate or continue a growth path based on the current growth point;

[0036] Step 3: Based on the current growth status and the preset integrity target, determine the currently effective growth strategy from the strategy set consisting of multiple growth strategies;

[0037] Step 4: Based on the currently effective growth strategy, determine the target growth direction from multiple adjacent directions of the current growth point on the N-dimensional regular grid;

[0038] Step 5: Based on the target growth direction, perform the operation of creating a new vertex and adding a directed edge, or adding a directed edge, and update the growth path and the growth kernel;

[0039] Step 6: Determine whether the number of generated vertices has reached the preset target: If not, continue to execute steps 2 to 5 for iterative growth; if it has reached the target, output a strongly connected directed graph generated based on the N-dimensional regular grid as the topology of the virtual scene level.

[0040] The following description, in conjunction with specific embodiments, provides further details. Please refer to the provided text. Figures 1 to 5 This embodiment describes the execution process of the procedural strongly connected graph generation method for game levels described in this invention on an electronic device, which can be a server, personal computer, game console, or mobile device. The specific execution steps are as follows:

[0041] Step S101: Initialize a growth kernel K on a preset N-dimensional regular grid. For example... Figure 2 As shown, this embodiment uses a two-dimensional hexagonal mesh as an example. The hexagonal mesh adopts a normalized hexagonal coordinate system (x, y, z), satisfying the constraint that the minimum coordinate value is 0. The node identifier is generated using the positional weight encoding function ID=x·B²+y·B+z, where B is the coordinate range base (e.g., when the normalized hexagonal coordinate range is [0, 98], B=100). The hexagonal mesh has 6 adjacent directions, namely (+1, 0, 0), (0, +1, 0), (0, 0, +1) and their reverse directions (0, +1, +1), (+1, 0, +1), (+1, +1, 0). The first three directions are opposite to the last three directions. To facilitate direction selection, the above 6 directions are stored in a preset order as an adjacent direction array, with array indices 0 to 5 corresponding to the above 6 directions respectively. The mesh center point V0 is selected as the initial vertex, and the growth kernel K={V0} is initialized. This single-point graph itself constitutes a trivial strongly connected subgraph.

[0042] Step S102: Select a vertex from the growth kernel K as the current growth point Vs. In this embodiment, a heuristic rule is adopted: select the vertex with the most adjacent unoccupied grid cells (i.e., spatial domains) in the growth kernel. Initially, V0 has 6 spatial domain adjacency directions, so Vs = V0. Initiate a new growth path P based on Vs, initially P = [Vs].

[0043] Step S103: Based on the current growth state and the preset integrity target η, determine the currently effective growth strategy. Define three strategies to form a strategy set:

[0044] Exploration strategy (prioritize edge-to-edge): This strategy takes precedence when new vertices need to be added to meet the vertex count target.

[0045] Regression strategy (priority regression): Takes effect when there is no space in any of the adjacent directions of the current growth point Vs;

[0046] Convergence strategy (priority backtracking): Takes effect when the target number of generated vertices is reached.

[0047] This step constitutes a state machine, whose transitions are driven by the availability of space and whether the number of vertices meets the requirements.

[0048] Step S104: Based on the currently effective strategy determined in step S103, select the target growth direction D from multiple adjacent directions of Vs. The multiple adjacent directions are preset as an adjacent direction array, with array indices 0 to 5 corresponding to 6 directions respectively (e.g., index 0 corresponds to (+1, 0, 0), index 1 corresponds to (0, +1, 0), and so on):

[0049] If it is an exploration strategy ( Figure 3 ( ), preferentially selecting directions pointing to the airspace adjacent to existing vertices. For example... Figure 3 As shown, the current point Vs has multiple spatial adjacency directions, among which U1 is adjacent to the existing vertex V0, so the direction pointing to U1 is selected first.

[0050] If it is a regression strategy ( Figure 4 ), preferentially choosing the direction pointing to the vertex in the growth kernel K. For example... Figure 4 As shown, direction D points to vertex Vk within the kernel.

[0051] If it is a convergent strategy ( Figure 5 ), preferentially select the direction pointing to the vertex in the growth kernel or the non-direct predecessor vertex on the growth path P.

[0052] Step S105: Perform the operation according to the selected direction D and update the structure.

[0053] If the target is a spatial region U, create a new vertex Vnew and add a directed edge Vs→Vnew. Add Vnew to the end of the growth path P, where P=[...,Vs,Vnew]. Let Vs=Vnew to prepare for the next round of growth.

[0054] If D points to the existing vertex Vexist, add a directed edge Vs→Vexist. At this point, if Vexist is the kernel vertex, the current growth path P ends, and step S106 is ready to be executed; otherwise, a path cycle may be formed, which needs to be handled according to step S106.

[0055] Step S106: When the growth path returns to the growth kernel via the added edge Vs→Vk, the current growth ends. All vertices on the current growth path P are merged into the growth kernel K. Simultaneously, it is checked whether a path cycle was formed in step S105. If so, all vertices within that cycle are also added to the growth kernel K. After the update, K remains a strongly connected subgraph.

[0056] Step S107: Determine whether the total number of generated vertices has reached the preset target. If not, return to step S102, reselect growth points from the updated growth kernel K, and initiate a new round of growth. If the target has been reached, proceed to step S108.

[0057] Step S108: Output the final generated directed graph G=(V,E). This graph G uses a subset of the N-dimensional regular grid as its vertex set V, and the directed edges added during the generation process as its edge set E. Guaranteed by the growth kernel mechanism and convergence strategy, graph G is strongly connected.

[0058] In another embodiment, the regular mesh is a three-dimensional cubic mesh. The execution process of this embodiment is basically the same as the aforementioned steps S101 to S108, the difference being the specific implementation of the coordinate system and adjacency relationship, which is detailed below:

[0059] The coordinate system adopts an (x,y,z) integer coordinate system, and the range of coordinate values ​​is preset according to the level size. The node identifier is generated using the positional weight encoding function ID=x·B²+y·B+z, where B is the base of the coordinate range (e.g., when the coordinate range is [-49,49], B=100).

[0060] In the adjacency relationship, each grid cell has 6 adjacency directions, namely East (+1,0,0), West (-1,0,0), North (0,+1,0), South (0,-1,0), Up (0,0,+1), and Down (0,0,-1).

[0061] In step S104, the target growth direction D is selected from the above six adjacent directions. In step S105, the neighbor coordinates are calculated based on the selected direction (e.g., if the east direction is selected, the neighbor coordinates are (x+1, y, z), and so on for other directions). The remaining steps are completely consistent with the aforementioned embodiment and will not be repeated here.

[0062] With the above configuration, this embodiment only requires replacing the coordinate system, adjacency direction array, and encoding function; the core algorithm logic remains unchanged to generate strongly connected directed graphs on 3D cubic meshes. Similarly, this algorithm can be extended to other tiling geometric networks such as 2D square meshes and high-dimensional hypercube meshes.

[0063] In summary, the procedural generation method for strongly connected graphs in virtual scene levels provided in this application introduces a growth kernel as the mathematical basis for strong connectivity and designs a multi-strategy controller that is linked to the growth stage, thereby achieving active control over the topological properties of the graph during the procedural generation process. Compared with the prior art, this method has the following beneficial effects:

[0064] 1. Strictly guarantee the strong connectivity of the generated graph to provide a reliable basic structure for levels;

[0065] 2. Actively optimize the topological looseness of the graph (low edge density and uniformity distribution) to generate levels with high strategy depth;

[0066] 3. It has dimensional scalability. Its core algorithm is decoupled from the specific geometry of the mesh, and it can be applied to regular meshes in two dimensions, three dimensions and even higher dimensions, providing a general framework for the generation of complex virtual worlds.

[0067] 4. Excellent efficiency, with near-linear algorithm time complexity, capable of meeting the real-time or near-real-time generation requirements of large-scale scenarios.

[0068] The above description discloses only one or more preferred embodiments of the present invention, and should not be construed as limiting the scope of the present invention. Those skilled in the art will understand that all or part of the processes of the above embodiments can be implemented, and equivalent changes made in accordance with the claims of the present invention are still within the scope of the invention.

Claims

1. A method for generating procedurally strongly connected graphs for game levels, characterized in that, Includes the following steps: Step 1: Initialize a growth kernel on a preset N-dimensional regular grid; Step 2: Select the current growth point from the growth kernel, and initiate or continue a growth path based on the current growth point; Step 3: Based on the current growth status and the preset integrity target, determine the currently effective growth strategy from the strategy set consisting of multiple growth strategies; Step 4: Based on the currently effective growth strategy, determine the target growth direction from multiple adjacent directions of the current growth point on the N-dimensional regular grid; Step 5: Based on the target growth direction, perform the operation of creating a new vertex and adding a directed edge, or adding a directed edge, and update the growth path and the growth kernel; Step 6: Determine whether the number of generated vertices has reached the preset target: If not, continue to execute steps 2 to 5 for iterative growth; if it has reached the target, output a strongly connected directed graph generated based on the N-dimensional regular grid as the topology of the virtual scene level.

2. The method for generating procedural strongly connected graphs for game levels as described in claim 1, characterized in that, The N-dimensional regular mesh mentioned in step 1 is a two-dimensional regular mesh or a three-dimensional regular mesh, where N is an integer not less than 2; the two-dimensional regular mesh is composed of tiling two-dimensional geometric units, and the three-dimensional regular mesh is composed of infillable three-dimensional geometric units; the tiling two-dimensional geometric units are selected from regular polygons, including hexagons, squares, or triangles; the infillable three-dimensional geometric units are selected from regular polyhedra, including cubes.

3. The method for generating procedural strongly connected graphs for game levels as described in claim 2, characterized in that, The growth kernel is a strongly connected subgraph containing at least one vertex. The process of selecting the current growth point from the growth kernel is specifically to select the vertex in the growth kernel that has the largest number of currently adjacent unoccupied grid cells on the N-dimensional regular grid.

4. The method for generating procedural strongly connected graphs for game levels as described in claim 3, characterized in that, The strategy set in step 3 includes an exploration strategy, a regression strategy, and a convergence strategy. The exploration strategy is configured to take priority when it is necessary to add vertices, so as to guide the growth path to extend into unoccupied areas. The regression strategy is configured to take priority when the current growth point has no unoccupied adjacent directions, so as to guide the growth path to connect to the existing vertex and return to the growth kernel; The convergence strategy is configured to take effect when the number of generated vertices reaches a preset target, so as to incorporate all vertices into the growth kernel by adding directed edges, thereby ensuring the strong connectivity of the graph.

5. The method for generating procedural strongly connected graphs for game levels as described in claim 4, characterized in that, In step 4, when the exploration strategy takes effect, it specifically prioritizes the edge-following strategy. The rules for determining the target growth direction include: The direction that points to the least number of unoccupied grid cells that are adjacent to the growth kernel or existing vertices on the growth path is preferred, followed by the direction that is also an unoccupied grid cell.

6. The method for generating procedural strongly connected graphs for game levels as described in claim 4, characterized in that, In step 4, when the regression strategy takes effect, it is specifically a priority regression strategy. The rules for determining the target growth direction include: The direction pointing to the vertex with the fewest adjacent vertices in the growth kernel is preferred, followed by the direction of the vertices on the growth path, and finally the direction of the path loop vertex or the direction of the unoccupied grid cell.

7. The method for generating procedural strongly connected graphs for game levels as described in claim 4, characterized in that, In step 4, when the convergence strategy takes effect, it specifically adopts a priority backtracking strategy. The rules for determining the target growth direction include: The direction pointing to the vertex with the fewest adjacent vertices in the growth kernel is preferred, followed by the direction of the non-direct predecessor vertex on the growth path, and finally the direction of the direct predecessor vertex on the growth path.

8. The method for generating procedural strongly connected graphs for game levels as described in claim 1, characterized in that, The strongly connected directed graph generated through the iterative growth process has a topological looseness that satisfies a preset optimization objective, wherein the topological looseness is characterized by the graph’s edge density and the uniformity of vertex degree distribution.