A method and device for creating a game level, and a storage medium
Patent Information
- Application Number
- CN202611346501.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-01
- Publication Date
- 2026-10-16
AI Technical Summary
随着游戏工业化程度的不断提升,关卡规模日益扩大、复杂度持续增加,传统纯手工搭建关卡的模式在效率和成本方面面临严峻挑战
首先,本申请通过对原始美术曲线进行地形拓扑结构构建与点云属性标记处理,可将人工绘制的抽象曲线自动转化为包含坐标、身份标签、统一法线及层级参数的标准化点云数据。实现了关卡几何拓扑的自动化解析与标准化数据构建。其次,针对关卡中不同地形拓扑结构的差异化几何特征,采用差异化的法线计算策略与点位判定筛选机制,可实现多类型场景组件的自动化精确位姿计算与模型化填充。再者,通过多层墙体高度适配机制以及基于边界感知的大摆件防穿插偏移处理及基于Y轴投射的小摆件重叠筛除机制,实现了墙体高度与摆件布局的自适应自动化生成;最后,通过游戏引擎对目标关卡模型进行渲染处理以生成关卡效果预览图,实现了从数据到预览效果的一键式自动化闭环输出。
Smart Images

Figure CN122912477A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software engineering technology, and in particular to a method, apparatus and storage medium for creating game levels. Background Technology
[0002] Procedural Content Generation (PCG) refers to a methodology for automatically or semi-automatically generating game content through algorithms, rules, parametric models, and other technologies. Procedural Level Generation is a vertical application of PCG in game level design, aiming to automatically generate core elements of levels such as spatial structure, terrain, layout topology, resource distribution, and collision navigation. With the increasing industrialization of the game industry, level sizes are expanding and complexity is continuously increasing, posing serious challenges to the efficiency and cost of traditional manual level construction. PCG technology automatically generates a large amount of differentiated content through algorithms, effectively reducing manual labor, shortening development cycles, and improving level replayability, thus becoming a key technological branch of modern industrial game development. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide a method, device and storage medium for creating game levels, so as to achieve the standardization and automated generation of level elements.
[0004] This application provides a method for creating game levels, the method comprising: The acquired original art curves are processed by terrain topology construction and point cloud attribute labeling to obtain level preprocessing data with unified hierarchy and regular height. For each level point in the level preprocessing data, normal calculation, point determination and filtering are performed to determine the pose information of the prefabricated model corresponding to each target scene component in the game level, and the corresponding prefabricated model is filled according to the determined pose information to obtain the initial game level model. The initial game level model is subjected to multi-layer wall high-end adaptation processing and decoration generation processing that meets collision requirements to obtain the target game level model; The target game level model is rendered using a game engine to generate a level effect preview image.
[0005] Optionally, the step of constructing a terrain topology and marking point cloud attributes on the acquired original art curves to obtain level preprocessing data with uniform hierarchy and height regularity includes: The dimensional accuracy of the original art curves is uniformly constrained to an integer multiple of N meters. All original art curves are limited to be arranged along the X-axis and Z-axis planes of the three-dimensional coordinate system. Based on the grid algorithm, the seamless connection of adjacent curves is automatically completed to obtain standardized level curve grid data. Based on the spatial point density characteristics, all points on the standardized curve grid are automatically classified, and attribute information is labeled for each point in the standardized checkpoint curve grid data. For each checkpoint where attribute information has been labeled, the normals are uniformly calibrated to determine the initial normal direction of each checkpoint in the standardized checkpoint curve mesh data. By constructing a 3D Box detector for hierarchical detection, each level point in the standardized level curve mesh data with attribute information and defined normal directions is subjected to height adaptive adaptation and hierarchical parameter calibration, resulting in level preprocessed data with unified hierarchy and high regularity.
[0006] Optionally, the target scene components include ramps, passages, platforms, and walls. The pose information of the prefabricated model corresponding to the ramp is determined through the following steps: Traverse each checkpoint in each checkpoint in the checkpoint preprocessing data to determine the level difference between the checkpoint and its adjacent checkpoints; Based on the determined level difference, slope points are selected, and the location and path direction of the slope points are determined. Based on the determined level difference, the location of the slope point, and the locations of relevant checkpoints, determine the normal vector of the slope point.
[0007] Optionally, the pose information of the prefabricated model corresponding to the channel can be determined through the following steps: The channel points are selected from the preprocessed data of the checkpoints, and the location of each channel point is determined; Based on the location information of the selected access points, the access points are classified to determine standard access points, turning access points, and T-junction access points. For a standard channel point, the normal vector of the standard channel point is determined based on the initial normal direction of the channel point corresponding to the preprocessed data of the level. For a turning point, the normal vector of the turning point is determined based on its average curvature and unit vector. For a T-shaped intersection point, the normal vector of the T-shaped intersection point is determined based on the direction vector between the T-shaped intersection point and the adjacent intersection points.
[0008] Optionally, the pose information of the prefabricated model corresponding to the platform can be determined through the following steps: Platform points are selected from the preprocessed data of the checkpoints, and patch matching is performed based on the position information of the selected platform points to determine the basic platform and the type of each patch in the basic platform; wherein, the type of patch includes platform outline patch and platform center patch; Based on the platform contour patch, determine the platform contour information, and based on the platform contour information, determine the platform turning point and the normal vector of the platform turning point; The neighboring points of the platform points selected from the preprocessed data of the checkpoint are identified to determine the connection point between the platform and the channel, and the normal vector of the connection point is determined according to the preprocessed data of the checkpoint. Based on the platform's center patch, determine the platform's center point and its location.
[0009] Optionally, the pose information of the prefabricated model corresponding to the wall can be determined through the following steps: Based on the preprocessed data of the checkpoint, the outer boundaries of the channel and platform are identified, and the outer boundary contour line and its position information are determined. Based on the position information of the outer boundary contour line, identify the wall turning point, the center point of the straight wall, and the connection center point between the straight wall and the turning wall, and determine the position and normal vector of the wall turning point, the position of the center point of the straight wall, the corresponding wall specifications, the position and interval of the connection center point.
[0010] Optionally, the step of performing multi-layer wall high-end adaptation processing on the initial game level model includes: Based on the platform and passage outer contour segments of the initial game level model, contour areas with slope attributes are excluded. Based on the remaining outline segments and the wall height calculation rules, determine the wall height points for each level; Based on the determined height points of each wall level, the multi-layer wall model is filled in, following the requirement of consistent height at the bottom layer.
[0011] Optionally, the initial game level model is processed to generate ornaments that meet collision requirements, including: Large ornament locations are randomly generated along the outer contour of the initial game level model, and random outward-facing normals are configured. Based on the maximum spatial distance from the surface of the ornament to its outer contour, the points of the ornament are offset in the opposite direction along the random normal to obtain the final points of the large ornament. The final points of the large ornament are then associated with and bound to the corresponding prefabricated large ornament model. In the remaining space between the final point of the large ornament and the outer contour line, secondary points and corresponding surfaces of the small ornament are generated; Perform projection collision detection and remove surfaces that have spatial overlap or conflict; Prefabricated miniature models will be placed at the secondary locations of the compliant miniature ornaments that have not been removed.
[0012] This application embodiment also provides a device for creating game levels, the device comprising: The preprocessing module is used to construct the terrain topology and mark the point cloud attributes on the acquired original art curves to obtain level preprocessing data with uniform hierarchy and height regularity. The first determining module is used to perform normal calculation and point determination and filtering for each level point in the level preprocessing data, determine the pose information of the prefabricated model corresponding to each target scene component in the game level, and fill the corresponding prefabricated model according to the determined pose information to obtain the initial game level model. The second determining module is used to perform multi-layer wall high-end adaptation processing and collision-compliant ornament generation processing on the initial game level model to obtain the target game level model. The generation module is used to render the target game level model using the game engine and generate a preview image of the level effect.
[0013] This application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the creation method described above are performed.
[0014] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the creation method described above.
[0015] This application provides a method, apparatus, and storage medium for creating game levels. The method includes: constructing terrain topology and marking point cloud attributes on acquired original art curves to obtain level preprocessing data with unified hierarchy and regular height; performing normal calculation, point determination, and filtering on each level point in the level preprocessing data to determine the pose information of the prefabricated model corresponding to each target scene component in the game level, and filling the corresponding prefabricated model according to the determined pose information to obtain an initial game level model; performing multi-layer wall high-end adaptation processing and collision-compliant ornament generation processing on the initial game level model to obtain a target game level model; and rendering the target game level model using a game engine to generate a level effect preview image. In this way, by constructing a closed-loop technical path of standardized data input, topological semantic parsing and pose calculation, adaptive detail generation, and one-click engine rendering, this application has achieved the standardization and automated generation of level elements from abstract input to precise rendering, and has achieved the following significant technical effects: First, this application automatically transforms manually drawn abstract curves into standardized point cloud data containing coordinates, identity labels, unified normals, and hierarchical parameters by constructing terrain topology and marking point cloud attributes on the original art curves. This achieves automated parsing and standardized data construction of level geometry topology. Second, by employing differentiated normal calculation strategies and point location judgment and filtering mechanisms for the differentiated geometric features of different terrain topologies in levels, automated and accurate pose calculation and model filling of various types of scene components can be achieved. Third, through a multi-layer wall height adaptation mechanism, boundary-aware anti-interference offset processing for large ornaments, and a Y-axis projection-based small ornament overlap filtering mechanism, adaptive and automated generation of wall height and ornament layout is achieved. Finally, the game engine renders the target level model to generate a level effect preview image, achieving a one-click automated closed-loop output from data to preview effect.
[0016] In summary, this application achieves full automation and standardization of game level elements from input and generation to verification through systematic standardized data processing, adaptive pose calculation, and automated model filling. It provides a complete and efficient technical solution to solve the industry problems of low efficiency, insufficient accuracy, and difficulty in connecting across terrains in traditional manual level construction.
[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A flowchart illustrating a method for creating a game level as provided in this application embodiment; Figure 2 This application provides one of the schematic diagrams of a level creation process; Figure 3 This application provides a second schematic diagram of a level creation process. Figure 4The third illustration of a level creation process provided in this application; Figure 5 The fourth illustration of a level creation process provided in this application; Figure 6 Fifth of a schematic diagram illustrating the level creation process provided in this application; Figure 7 This application provides a schematic diagram of a level creation process, number six. Figure 8 The seventh illustration of a level creation process provided in this application; Figure 9 Here is an example of a preview image showing the level effects determined by this scheme; Figure 10 A schematic diagram of a device for creating game levels provided in an embodiment of this application; Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0021] Procedural Content Generation (PCG) refers to a methodology for automatically or semi-automatically generating game content through algorithms, rules, parametric models, and other technologies. Procedural Level Generation is a vertical application of PCG in game level design, aiming to automatically generate core elements of levels such as spatial structure, terrain, layout topology, resource distribution, and collision navigation. With the increasing industrialization of the game industry, level sizes are expanding and complexity is continuously increasing, posing serious challenges to the efficiency and cost of traditional manual level construction. PCG technology automatically generates a large amount of differentiated content through algorithms, effectively reducing manual labor, shortening development cycles, and improving level replayability, thus becoming a key technological branch of modern industrial game development.
[0022] Based on this, embodiments of this application provide a method, apparatus, and storage medium for creating game levels, so as to achieve standardized and automated generation of level elements.
[0023] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for creating game levels according to an embodiment of this application. Figure 1 As shown in the embodiments of this application, the creation method includes: S101. Perform terrain topology construction and point cloud attribute marking on the acquired original art curves to obtain level preprocessing data with unified hierarchy and regular height. S102. For each level point in the level preprocessing data, perform normal calculation, point determination and filtering to determine the pose information of the prefabricated model corresponding to each target scene component in the game level, and fill the corresponding prefabricated model according to the determined pose information to obtain the initial game level model. S103. Perform multi-layer wall high-end adaptation processing and collision-compliant ornament generation processing on the initial game level model to obtain the target game level model. S104. The target game level model is rendered using a game engine to generate a level effect preview image.
[0024] The exemplary steps of the embodiments of this application are described below: Regarding step S101, the original art curve can be an abstract path curve hand-drawn or dragged by the level designer in 3D software, used to represent the general direction of the level. This curve only contains general spatial direction information and does not have precise size, mesh, and orientation data. This step transforms the original art curve into structured data that can be accurately recognized and processed by a computer through terrain topology construction and point cloud attribute labeling. This is specifically achieved through the following steps.
[0025] In one embodiment provided in this application, the step of constructing a terrain topology and marking point cloud attributes on the acquired original art curves to obtain level preprocessing data with uniform hierarchy and regular height includes: S1011 unifies the dimensional accuracy of the original art curves to an integer multiple of N meters, limits all original art curves to be arranged along the X-axis and Z-axis planes of the three-dimensional coordinate system, and automatically completes the seamless connection of adjacent curves based on the grid algorithm to obtain standardized level curve grid data. S1012 automatically classifies all points on the standardized curve grid based on spatial point density characteristics, and annotates the attribute information of each point in the standardized checkpoint curve grid data. S1013, Perform normal calibration on each checkpoint after attribute information annotation is completed, and determine the initial normal direction of each checkpoint in the standardized checkpoint curve grid data; S1014. By constructing a 3D Box detector for hierarchical detection, the system performs height adaptive adaptation and hierarchical parameter calibration on each level point in the standardized level curve mesh data that has attribute information and determined normal direction, resulting in level-uniform and highly regular level preprocessed data.
[0026] Regarding step S1011, in one embodiment of this application, the value of N can be 10, i.e., 10 meters. It should be noted that 10 meters is not the only possible value; in practical applications, it can be adaptively adjusted according to level design requirements and the asset specifications of the target engine.
[0027] Here, the standardized level curve grid data can be determined through the following steps: using the Grid preset grid algorithm in the Fuse node of Houdini, the original art curves are uniformly standardized to an integer multiple of 10 meters in precision, constraining the curves to be arranged along the X / Z axes and achieving automatic connection, thus obtaining the standardized level curve grid data. This ensures that the endpoints of adjacent curves can be automatically aligned and merged to form a continuous gridded path network.
[0028] Regarding step S1012, in one embodiment of this application, the `nearpoints` function can be used to calculate the number of neighboring points within a preset radius (e.g., 12.1 meters, slightly larger than the 10-meter diagonal distance to ensure adjacent points are included in the statistics) around each checkpoint. Based on the statistically obtained number of neighboring points, the point is classified and labeled: if the number of neighboring points is greater than a preset threshold (e.g., 3), it indicates that the point is in an open area and is labeled as a platform point (labeled with `platform=1`); if the number of neighboring points is less than or equal to the preset threshold, it indicates that the point is in a narrow linear path area and is labeled as a passage point (`platform=0`). Through this classification process, each point obtains an identity label attribute.
[0029] Regarding step S1013, in one embodiment of this application, for the area marked as a platform point, the connecting point P0 at the edge of the platform and its adjacent point P1 pointing into the platform are selected. The direction vector calculated by the vector subtraction formula, vector = P1 - P0, is used as the normal vector of the connecting point, thus completing the normal direction standardization.
[0030] The initial normal direction of each checkpoint can be determined based on the positional difference between the checkpoint and its adjacent points; the adjacent points selected in this case are generally the next checkpoints.
[0031] For step S1014, a 3D Box detector can be placed as a placeholder model. The name of this Box detector includes hierarchical parameter information (e.g., named "Room0_3"). A string truncation function is used to extract the number at the end of the Box name, and this number is mapped to the corresponding point's height hierarchy attribute slopID. For example, after extracting the "3" from the Box name "Room0_3", the associated point moves 3 hierarchy units in the Y-axis direction. If the extracted value is negative (e.g., -1), the point moves down 1 unit. Through this processing, a mapping relationship is established between the height hierarchy of each point and the parameters in the Box name, completing the standardization of the height and hierarchy of the basic route of the level, forming level preprocessing data with unified hierarchy and regular height.
[0032] For an example, please refer to Figure 2 , Figure 2 This is one of the schematic diagrams illustrating the level creation process provided in this application. For example... Figure 2 As shown, Figure 2 The diagrams show the effects corresponding to the preprocessed data of the levels.
[0033] Regarding step S102, it should be noted that pose information includes position information (i.e., 3D spatial coordinates) and orientation information (i.e., normal orientation and rotation angle). Target scene components include, but are not limited to, level-forming elements such as ramps, passages, platforms, and walls. Different types of scene components have different geometric topological characteristics, requiring differentiated normal calculation strategies. The pose information determination process for different types of components is described below.
[0034] In one embodiment provided in this application, the target scene components include a ramp, a passage, a platform, and a wall. The pose information of the prefabricated model corresponding to the ramp is determined through the following steps: S10211. Traverse each checkpoint in each checkpoint in the checkpoint preprocessing data to determine the level difference between the checkpoint and its adjacent checkpoints. Specifically, iterate through all level points. For the current point P, obtain all its adjacent connected points P' using the neighbors function, read the slopID attribute value of the current point and its adjacent points respectively, and calculate the difference between the two as the level difference.
[0035] S10212. Based on the determined level difference, select the slope points and determine the location of the slope points and the path direction of the slope points. Specifically, slope points are identified by comparing the slopID values of the current point with those of its neighboring points. For example, if the slopID is negative (i.e., the terrain is sinking), the point with the smallest value is selected as the slope point; if the slopID is positive (i.e., the terrain is rising), the point with the largest value is selected as the slope point. The location coordinates of the selected slope points and their directions relative to their neighboring points determine the location of the slope points and the direction of travel.
[0036] S10213. Based on the determined level difference, the location of the slope point, and the location of the relevant checkpoints, determine the normal vector of the slope point.
[0037] Specifically, the slope direction is automatically determined based on the slopID numerical rules: when slopID is less than 0, the coordinates of the point with the larger value are subtracted from the coordinates of the point with the smaller value, and the resulting vector is used as the slope normal, pointing from the smaller value point to the larger value point; when slopID is greater than 0, the coordinates of the point with the smaller value are subtracted from the coordinates of the point with the larger value, and the resulting vector is used as the slope normal, pointing from the larger value point to the smaller value point. Through this process, it is enforced that the slope normal always points from the lower level to the higher level, and the pose information of the prefabricated slope model can be determined based on the determined slope point positions and normal vectors.
[0038] In this way, the model is matched to the corresponding point using the Copy node, and the Z-axis of the model is aligned with the direction of the point's normal, thus achieving correct model placement. For an example, please refer to [link / reference]. Figure 3 , Figure 3 This is the second illustration of a level creation process provided in this application. Figure 3 The image shown depicts the effect of placing the model on a prefabricated ramp.
[0039] In one embodiment provided in this application, the pose information of the prefabricated model corresponding to the channel is determined through the following steps: S10221. Filter out the channel points from the preprocessed checkpoint data and determine the position of each channel point; Specifically, based on the platform attribute marked in S1012, the point with platform=0 is selected as the channel point.
[0040] S10222. Based on the location information of the selected passage points, classify the passage points and determine the standard passage points, turning passage points, and T-shaped passage intersection points. Specifically, further topological identification is performed on the passage points. The average curvature at each passage point is calculated. If the curvature is 0, it is determined to be a straight non-turning point, i.e., a standard passage point; if the curvature is not 0, it is determined to be a turning passage point. At the same time, the number of neighboring points is used to determine whether there is an intersection of three or more roads. If so, it is identified as a T-shaped passage intersection point.
[0041] S10223. For a standard channel point, determine the normal vector of the standard channel point based on the initial normal direction of the channel point corresponding to the preprocessed data of the checkpoint. Specifically, the standard channel points directly use the normal direction that has been uniformly calibrated in S1013 as their normal vector to maintain the continuity of the path.
[0042] S10224. For a turning point, determine the normal vector of the turning point based on its average curvature and unit vector. Specifically, the average curvature is used to determine whether a point is a turning point. A point with a curvature of 0 is a straight line and not a turning point, while a point with a curvature of non-zero is a turning point. The direction of the tangent at the turning point is adjusted according to the positive or negative curvature. Then, the adjusted tangent is cross-multiplied with the preset unit vector (i.e., the world upward vector {0,1,0}) to obtain the normal vector.
[0043] S10225. For a T-shaped intersection point, determine the normal vector of the T-shaped intersection point based on the direction vector between the T-shaped intersection point and the adjacent intersection points.
[0044] Specifically, the center point of the T-shaped intersection is first determined by the number of neighboring points, then the three directional vectors between the center point and each neighboring point are calculated, and finally the convex direction (i.e. the direction of the fork) is determined based on the vector dot product result, and the convex direction is set as the normal vector of the point.
[0045] In this way, based on the determined channel points and their respective normal vectors, the pose information of the corresponding prefabricated channel model can be determined, and the model can be matched and placed accordingly.
[0046] For an example, please refer to Figure 4 , Figure 4 This is the third illustration of a level creation process provided in this application. Figure 4 The image shows the effect of placing a prefabricated tunnel model. The prefabricated tunnel model is matched to the corresponding point using a Copy node, and the Z-axis of the prefabricated tunnel model is aligned with the normal direction of the point, thus achieving correct model placement.
[0047] In another embodiment provided in this application, the pose information of the prefabricated model corresponding to the platform is determined through the following steps: S10231. Platform points are selected from the preprocessed data of the checkpoint, and patch matching is performed based on the position information of the selected platform points to determine the basic platform and the type of each patch in the basic platform; wherein, the type of patch includes platform outline patch and platform center patch. Specifically, based on the platform attribute marked in S1012, the point with platform=1 is selected as the platform point. A square patch of N meters × N meters (e.g., 10 meters × 10 meters) is created using a Grid node. The patch is then matched to the corresponding platform point using a Copy node to generate the basic platform. Subsequently, each platform patch is shrunk inward by a preset threshold (e.g., 0.1 units) using a transform node. The center point of each segment of the platform outline is then calculated using a center node. Next, the intersect function is used to project rays downwards from the center points of each segment of the outline. The patch type is distinguished based on the ray hit result: patches hit by the ray are platform center patches, and patches not hit are platform outline patches. Only the platform outline patches are retained.
[0048] S10232. Based on the platform contour patch, determine the platform contour information, and based on the platform contour information, determine the platform turning point and the normal vector of the platform turning point; Specifically, based on the extracted platform contour patch, the same turning processing method as in S10224 is adopted, that is, the turning point on the contour line is determined by the average curvature, and the tangent direction is adjusted by the positive and negative curvature and then cross-multiplied with the world upward vector {0,1,0} to obtain the normal vector of the platform turning point.
[0049] S10233. Identify the neighboring points of the platform points selected from the preprocessed data of the checkpoint, determine the connection point between the platform and the channel, and determine the normal vector of the connection point according to the preprocessed data of the checkpoint. Specifically, all platform points are traversed, and their neighboring points are obtained using the `neighbours` function. The `platform` attribute value of each neighboring point is then read. If any neighboring point has a `platform` value of 0 (i.e., a passage point), it is determined that there is a connection between the platform point and the passage, corresponding to a T-shaped intersection model. Subsequently, the normal vector of this connection point is determined using the normal calculation method for T-shaped passage intersection points.
[0050] S10234. Determine the platform center point and its location based on the platform center patch.
[0051] Specifically, based on the platform center patch retained in S10231, the geometric center point of the platform center patch is calculated through the Center node, which is the platform center point, and its three-dimensional spatial coordinates are recorded.
[0052] Based on the above information, the pose information of the prefabricated platform model can be determined.
[0053] For an example, please refer to Figure 5 , Figure 5 This is the fourth illustration of a level creation process provided for this application. Figure 5 The image shows the effect of placing the prefabricated platform model. The prefabricated platform model is matched to the corresponding point using the Copy node, and the Z-axis of the prefabricated platform model is aligned with the normal direction of the point, thus achieving correct model placement.
[0054] In another embodiment provided in this application, the pose information of the prefabricated model corresponding to the wall is determined through the following steps: S10241. Based on the preprocessed data of the checkpoint, identify the outer boundaries of the channel and the platform, and determine the outer boundary contour line and the position information of the outer boundary contour line. Specifically, based on the channel and platform patches generated in S10231, the internal vertices are first deleted using the dissolve node; then the internal planes are deleted using the convertline node, leaving only the outermost boundary line segment, which is the outer boundary contour line.
[0055] S10242. Based on the position information of the outer boundary contour line, identify the wall turning point, the center point of the straight wall, and the connection center point between the straight wall and the turning wall, and determine the position and normal vector of the wall turning point, the position of the center point of the straight wall, the corresponding wall specifications, the position and interval of the connection center point.
[0056] Specifically, the contour lines are first marked with turning attributes. The turning points of the contour lines are calculated using the turning recognition method in S10224, the attribute `turn=1` is set, and the normal direction is calculated; non-turning line segments are set to `turn=0`. Then, line segments with different attributes are processed separately: For a turning wall (turn=1), its corresponding length is 5 meters. Traverse all turning points, obtain the neighboring points of each turning point using the `neighbours` function, and perform coordinate offset calculation when the neighboring point's `wall=1`: P'=P+normalize( -P)×7.5, where P is the original coordinate of the turning point. P' represents the new coordinates of the nearest point that meets the conditions, and P' represents the new coordinates after the offset. A new vertex is created at position P' using the addpoint function, serving as the center point of the 5-meter wall. This offset formula causes the center point of the short wall to shrink towards the inside of the curve, preventing the long wall from intersecting or passing through at sharp bends.
[0057] For a standard wall (turn=0), its corresponding length is 10 meters. Select the non-turning line segment with turn=0, and use the center node to calculate the center point of each line segment. This center point is the center point of the 10-meter wall.
[0058] For the junction of a straight line and a curved wall, filter the curved line segments with turn=1, traverse all points on the line segment, use the neighborbours function to find neighboring points with turn≠1 and count the number. If the number of neighboring points is greater than 1, it indicates that there is a gap that needs to be filled at this location. The coordinates of this point are directly reused and defined as a 10-meter wall point to achieve gap filling.
[0059] Through the above processing, the center points of all walls obtain accurate three-dimensional coordinates and normal directions. By using the Copy node, all prefabricated wall models are matched to the corresponding points, and the Z-axis of the model is kept consistent with the normal direction of the point, thus achieving the correct placement of the walls.
[0060] For an example, please refer to Figure 6 , Figure 6 This is the fifth illustration of a level creation process provided for this application. Figure 6 The image shown depicts the effect of placing a prefabricated wall model.
[0061] Regarding step S103, in one embodiment provided in this application, the multi-layer wall high-end adaptation processing of the initial game level model includes: excluding contour areas with slope attributes based on the platform and passage outer contour segments of the initial game level model; determining the wall height points of each level according to the remaining contour segments and wall height calculation rules; and filling the multi-layer wall model according to the determined wall height points of each level, following the requirement of consistent bottom layer height.
[0062] Specifically, firstly, the slopID attribute determined in step S102 is used to remove the slope area, and the center point of the remaining outer contour line segment is extracted as the reference point to obtain its vertical height coordinate Py. Then, based on the preset total number of wall levels and the preset single-layer height H, a loop calculation is performed: Where Py is the height of the current point (the y-axis of the point), H is the level height, and I is the sequence number of the currently created point (the minimum value of i is 1; if the current level is 4, then the maximum value of i is 5). Based on the above formula, multi-layer wall points can be created. Finally, the corresponding prefabricated wall model, including the bottom shape, is instantiated and matched to the center points of each level of wall.
[0063] For an example, please refer to Figure 7 , Figure 7 This is the sixth illustration of a level creation process provided for this application. Figure 7 As shown, the level model renderings are displayed after high-end adaptation of multi-layered walls.
[0064] In another embodiment provided in this application, the initial game level model is processed to generate ornaments that meet collision requirements, including: randomly generating large ornament points along the outer contour of the initial game level model and configuring random outward-facing normals; offsetting the ornament points in the opposite direction along the random normals according to the maximum spatial distance from the ornament facet to the outer contour to obtain the final large ornament point, associating and binding the final large ornament point with the corresponding prefabricated large ornament model; generating secondary small ornament points and corresponding faces in the remaining space area between the final large ornament point and the outer contour line; performing projection collision detection to remove faces with spatial overlap and conflict; and arranging prefabricated small ornament models on the compliant secondary small ornament points that have not been removed.
[0065] Specifically, during the large ornament generation stage, initial points are first randomly generated within the platform's internal area, and each point is assigned a random normal vector pointing outwards from the contour. A unique identifier (ID) is assigned to each initial point, and its circumscribed rectangular facet is calculated, establishing a data association between the point, the model, and the facet. Then, the maximum spatial distance from the circumscribed rectangular facet of the large ornament to the platform's outer contour line is calculated. If this maximum distance is less than a preset safety threshold, it indicates that the ornament is too close to the wall, posing a risk of insertion. In this case, the initial point is shifted in the opposite direction of its normal vector (i.e., inwards) until the maximum distance meets the safety threshold, resulting in the final position of the large ornament, ensuring a safe distance between the large ornament and the wall.
[0066] During the small ornament generation stage, a large number of secondary points and corresponding simplified collision patches are generated in the remaining space between the final point of the large ornament and its outer contour. Then, ray casting is performed from these secondary points along the vertical direction of the world coordinate system (negative Y-axis) to perform spatial overlap and collision detection. If a ray is detected to intersect a patch or outer contour of the large ornament model within a preset distance, the secondary point of the small ornament is determined to have an overlap risk and is filtered out. The remaining points that pass the detection are identified as compliant points, and the preset small ornament model is mapped and bound to these compliant points, completing the instantiation generation.
[0067] For an example, please refer to Figure 8 , Figure 8 This is the seventh illustration of a level creation process provided for this application. Figure 8 As shown, the image displays the effect after the ornament generation and collision detection processing.
[0068] Regarding step S104, in one embodiment of this application, the game engine can be the Unity engine. After completing all data processing and model instantiation in S101 to S103 above, the target game level model has been constructed in the game engine's scene. Based on all 3D model data, material data, lighting data, and camera settings in the scene, the game engine performs rendering calculations through the rendering pipeline, draws the 3D scene as a 2D image, and outputs and saves it as a level effect preview image.
[0069] For an example, please refer to Figure 9 , Figure 9 This is an example of a preview image showing the level effects determined by this scheme.
[0070] Therefore, with this solution, users only need to complete two input operations in the game engine: first, draw one or more art curves to represent the level's direction; second, use a Box detector to select the corresponding area model and name it according to preset naming rules (e.g., "Room0_3"). After completing the above operations, a one-click generation command can be triggered. The game engine automatically calls all steps S101 to S104 above, sequentially completing data preprocessing, normal calculation and pose determination, prefab model filling and detail generation, and rendering output, ultimately obtaining a complete level effect preview image in a very short time. The entire generation process does not require manual intervention in model placement, orientation adjustment, height adaptation, and collision avoidance, significantly reducing the technical threshold and repetitive labor intensity of level creation.
[0071] Based on the same inventive concept, this application also provides a creation device corresponding to the creation method. Since the principle of the device in this application is similar to the creation method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0072] Please see Figure 10 , Figure 10 This is a schematic diagram of a device for creating game levels according to an embodiment of this application. Figure 10 As shown, the creation device 1000 includes: The preprocessing module 1010 is used to construct the terrain topology and mark the point cloud attributes on the acquired original art curves to obtain level preprocessing data with uniform hierarchy and regular height. The first determining module 1020 is used to perform normal calculation and point determination and filtering for each level point in the level preprocessing data, determine the pose information of the prefabricated model corresponding to each target scene component in the game level, and fill the corresponding prefabricated model according to the determined pose information to obtain the initial game level model. The second determining module 1030 is used to perform multi-layer wall high-end adaptation processing and collision-compliant ornament generation processing on the initial game level model to obtain the target game level model. The generation module 1040 is used to render the target game level model through the game engine and generate a level effect preview image.
[0073] Optionally, when the preprocessing module 1010 performs terrain topology construction and point cloud attribute labeling on the acquired original art curves to obtain level preprocessing data with uniform hierarchy and height regularity, the preprocessing module 1010 is used for: The dimensional accuracy of the original art curves is uniformly constrained to an integer multiple of N meters. All original art curves are limited to be arranged along the X-axis and Z-axis planes of the three-dimensional coordinate system. Based on the grid algorithm, the seamless connection of adjacent curves is automatically completed to obtain standardized level curve grid data. Based on the spatial point density characteristics, all points on the standardized curve grid are automatically classified, and attribute information is labeled for each point in the standardized checkpoint curve grid data. For each checkpoint where attribute information has been labeled, the normals are uniformly calibrated to determine the initial normal direction of each checkpoint in the standardized checkpoint curve mesh data. By constructing a 3D Box detector for hierarchical detection, each level point in the standardized level curve mesh data with attribute information and defined normal directions is subjected to height adaptive adaptation and hierarchical parameter calibration, resulting in level preprocessed data with unified hierarchy and high regularity.
[0074] Optionally, the target scene components include a ramp, a passage, a platform, and a wall. The first determining module 1020 is used to determine the pose information of the prefabricated model corresponding to the ramp through the following steps: Traverse each checkpoint in each checkpoint in the checkpoint preprocessing data to determine the level difference between the checkpoint and its adjacent checkpoints; Based on the determined level difference, slope points are selected, and the location and path direction of the slope points are determined. Based on the determined level difference, the location of the slope point, and the locations of relevant checkpoints, determine the normal vector of the slope point.
[0075] Optionally, the first determining module 1020 is used to determine the pose information of the prefabricated model corresponding to the channel through the following steps: The channel points are selected from the preprocessed data of the checkpoints, and the location of each channel point is determined; Based on the location information of the selected access points, the access points are classified to determine standard access points, turning access points, and T-junction access points. For a standard channel point, the normal vector of the standard channel point is determined based on the initial normal direction of the channel point corresponding to the preprocessed data of the level. For a turning point, the normal vector of the turning point is determined based on its average curvature and unit vector. For a T-shaped intersection point, the normal vector of the T-shaped intersection point is determined based on the direction vector between the T-shaped intersection point and the adjacent intersection points.
[0076] Optionally, the first determining module 1020 is used to determine the pose information of the prefabricated model corresponding to the platform through the following steps: Platform points are selected from the preprocessed data of the checkpoints, and patch matching is performed based on the position information of the selected platform points to determine the basic platform and the type of each patch in the basic platform; wherein, the type of patch includes platform outline patch and platform center patch; Based on the platform contour patch, determine the platform contour information, and based on the platform contour information, determine the platform turning point and the normal vector of the platform turning point; The neighboring points of the platform points selected from the preprocessed data of the checkpoint are identified to determine the connection point between the platform and the channel, and the normal vector of the connection point is determined according to the preprocessed data of the checkpoint. Based on the platform's center patch, determine the platform's center point and its location.
[0077] Optionally, the first determining module 1020 is used to determine the pose information of the prefabricated model corresponding to the wall through the following steps: Based on the preprocessed data of the checkpoint, the outer boundaries of the channel and platform are identified, and the outer boundary contour line and its position information are determined. Based on the position information of the outer boundary contour line, identify the wall turning point, the center point of the straight wall, and the connection center point between the straight wall and the turning wall, and determine the position and normal vector of the wall turning point, the position of the center point of the straight wall, the corresponding wall specifications, the position and interval of the connection center point.
[0078] Optionally, when the second determining module 1020 performs multi-layer wall high-end adaptation processing on the initial game level model, the second determining module 1020 is used to: Based on the platform and passage outer contour segments of the initial game level model, contour areas with slope attributes are excluded. Based on the remaining outline segments and the wall height calculation rules, determine the wall height points for each level; Based on the determined height points of each wall level, the multi-layer wall model is filled in, following the requirement of consistent height at the bottom layer.
[0079] Optionally, when the second determining module 1020 performs the process of generating ornaments that meet the collision requirements on the initial game level model, the second determining module 1020 is used to: Large ornament locations are randomly generated along the outer contour of the initial game level model, and random outward-facing normals are configured. Based on the maximum spatial distance from the surface of the ornament to its outer contour, the points of the ornament are offset in the opposite direction along the random normal to obtain the final points of the large ornament. The final points of the large ornament are then associated with and bound to the corresponding prefabricated large ornament model. In the remaining space between the final point of the large ornament and the outer contour line, secondary points and corresponding surfaces of the small ornament are generated; Perform projection collision detection and remove surfaces that have spatial overlap or conflict; Prefabricated miniature models will be placed at the secondary locations of the compliant miniature ornaments that have not been removed.
[0080] Please see Figure 11 , Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 11 As shown, the electronic device 1100 includes a processor 1110, a memory 1120, and a bus 1130.
[0081] The memory 1120 stores machine-readable instructions executable by the processor 1110. When the electronic device 1100 is running, the processor 1110 communicates with the memory 1120 via the bus 1130. When the machine-readable instructions are executed by the processor 1110, they can perform the operations described above. Figures 1 to 9 The steps in the method embodiment shown are specifically implemented in the method embodiment and will not be repeated here.
[0082] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figures 1 to 9 The steps in the method embodiment shown are specifically implemented in the method embodiment and will not be repeated here.
[0083] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0084] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0085] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0086] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0087] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0088] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for creating game levels, characterized in that, The creation method includes: The acquired original art curves are processed by terrain topology construction and point cloud attribute labeling to obtain level preprocessing data with unified hierarchy and regular height. For each level point in the level preprocessing data, normal calculation, point determination and filtering are performed to determine the pose information of the prefabricated model corresponding to each target scene component in the game level, and the corresponding prefabricated model is filled according to the determined pose information to obtain the initial game level model. The initial game level model is subjected to multi-layer wall high-end adaptation processing and decoration generation processing that meets collision requirements to obtain the target game level model; The target game level model is rendered using a game engine to generate a level effect preview image.
2. The creation method according to claim 1, characterized in that, The process involves constructing a terrain topology and labeling point cloud attributes on the acquired original art curves to obtain level preprocessing data that is hierarchically unified and highly regularized, including: The dimensional accuracy of the original art curves is uniformly constrained to an integer multiple of N meters. All original art curves are limited to be arranged along the X-axis and Z-axis planes of the three-dimensional coordinate system. Based on the grid algorithm, the seamless connection of adjacent curves is automatically completed to obtain standardized level curve grid data. Based on the spatial point density characteristics, all points on the standardized curve grid are automatically classified, and attribute information is labeled for each point in the standardized checkpoint curve grid data. For each checkpoint where attribute information has been labeled, the normals are uniformly calibrated to determine the initial normal direction of each checkpoint in the standardized checkpoint curve grid data. By constructing a 3D Box detector for hierarchical detection, each level point in the standardized level curve mesh data with attribute information and defined normal directions is subjected to height adaptive adaptation and hierarchical parameter calibration, resulting in level preprocessed data with unified hierarchy and high regularity.
3. The creation method according to claim 1, characterized in that, The target scene components include ramps, passageways, platforms, and walls. The pose information of the prefabricated model corresponding to the ramp is determined through the following steps: Traverse each checkpoint in each checkpoint in the checkpoint preprocessing data to determine the level difference between the checkpoint and its adjacent checkpoints; Based on the determined level difference, slope points are selected, and the location and path direction of the slope points are determined. Based on the determined level difference, the location of the slope point, and the locations of relevant checkpoints, determine the normal vector of the slope point.
4. The creation method according to claim 3, characterized in that, The pose information of the prefabricated model corresponding to the channel is determined by the following steps: The channel points are selected from the preprocessed data of the checkpoints, and the position of each channel point is determined; Based on the location information of the selected access points, the access points are classified to determine standard access points, turning access points, and T-junction access points. For a standard passage point, the normal vector of the standard passage point is determined based on the initial normal direction of the passage point corresponding to the preprocessed data of the level. For a turning point, the normal vector of the turning point is determined based on its average curvature and unit vector. For a T-shaped intersection point, the normal vector of the T-shaped intersection point is determined based on the direction vector between the T-shaped intersection point and the adjacent intersection points.
5. The creation method according to claim 3, characterized in that, The pose information of the prefabricated model corresponding to the platform is determined by the following steps: Platform points are selected from the preprocessed data of the checkpoints, and patch matching is performed based on the position information of the selected platform points to determine the basic platform and the type of each patch in the basic platform; wherein, the type of patch includes platform outline patch and platform center patch; Based on the platform contour patch, determine the platform contour information, and based on the platform contour information, determine the platform turning point and the normal vector of the platform turning point; The neighboring points of the platform points selected from the preprocessed data of the checkpoint are identified to determine the connection point between the platform and the channel, and the normal vector of the connection point is determined according to the preprocessed data of the checkpoint. Based on the platform's center patch, determine the platform's center point and its location.
6. The creation method according to claim 1, characterized in that, The pose information of the prefabricated model corresponding to the wall is determined by the following steps: Based on the preprocessed data of the checkpoint, the outer boundaries of the channel and platform are identified, and the outer boundary contour line and its position information are determined. Based on the position information of the outer boundary contour line, identify the wall turning point, the center point of the straight wall, and the connection center point between the straight wall and the turning wall, and determine the position and normal vector of the wall turning point, the position of the center point of the straight wall, the corresponding wall specifications, the position and interval of the connection center point.
7. The creation method according to claim 1, characterized in that, The process of performing multi-layer wall high-end adaptation on the initial game level model includes: Based on the platform and passage outer contour segments of the initial game level model, contour areas with slope attributes are excluded. Based on the remaining outline segments and the wall height calculation rules, determine the wall height points for each level; Based on the determined height points of each wall level, the multi-layer wall model is filled in, following the requirement of consistent height at the bottom layer.
8. The creation method according to claim 1, characterized in that, The initial game level model is processed to generate ornaments that meet collision requirements, including: Large ornament locations are randomly generated along the outer contour of the initial game level model, and random outward-facing normals are configured. Based on the maximum spatial distance from the surface of the ornament to its outer contour, the points of the ornament are offset in the opposite direction along the random normal to obtain the final points of the large ornament. The final points of the large ornament are then associated with and bound to the corresponding prefabricated large ornament model. In the remaining space between the final point of the large ornament and the outer contour line, secondary points and corresponding surfaces of the small ornament are generated; Perform projection collision detection and remove surfaces that have spatial overlap or conflict; Prefabricated miniature models will be placed at the secondary locations of the compliant miniature ornaments that have not been removed.
9. A device for creating game levels, characterized in that, The creation apparatus includes: The preprocessing module is used to construct the terrain topology and mark the point cloud attributes on the acquired original art curves to obtain level preprocessing data with uniform hierarchy and height regularity. The first determining module is used to perform normal calculation and point determination and filtering for each level point in the level preprocessing data, determine the pose information of the prefabricated model corresponding to each target scene component in the game level, and fill the corresponding prefabricated model according to the determined pose information to obtain the initial game level model. The second determining module is used to perform multi-layer wall high-end adaptation processing and collision-compliant ornament generation processing on the initial game level model to obtain the target game level model. The generation module is used to render the target game level model using the game engine and generate a preview image of the level effect.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the creation method as described in any one of claims 1 to 8.