Route searching method and device and storage medium

By automatically detecting and correcting the drivable area of ​​the navigation mesh after its generation, the problems of high technical requirements and long cycle time of manual detection are solved, realizing the automation and batch detection of navigation mesh and improving production efficiency.

CN114967675BActive Publication Date: 2025-11-28SHENZHEN YUANXIANG INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210375772.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-11
Publication Date
2025-11-28
Estimated Expiration
2042-04-11

AI Technical Summary

Technical Problem

In existing technologies, the detection of drivable areas of navigation grids relies on manual inspection, which is technically demanding and time-consuming, making batch inspection impossible and resulting in low production efficiency.

Method used

By pre-setting the first preset standard requirements for the traversable area of ​​the navigation grid, the system automatically detects whether the traversable area of ​​the navigation grid meets the standard, and generates a pathfinding route only when the standard is met, including automatically correcting areas that do not meet the standard.

Benefits of technology

It enables automated and batch inspection of the navigable area of ​​the navigation grid, improving production efficiency, reducing manual processing workload, and increasing inspection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114967675B_ABST
    Figure CN114967675B_ABST
Patent Text Reader

Abstract

The application discloses a route searching method and device and a storage medium. The method comprises the following steps: generating a navigation grid for an input scene; detecting whether a feasible area of the navigation grid meets a first preset standard requirement; if the feasible area of the navigation grid meets the first preset standard requirement, searching a route according to the feasible area of the navigation grid, and generating a route searching route. In this way, the application can automatically and batch detect the feasible area of the navigation grid, and improve the production efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a path finding method and device and storage medium. BACKGROUND

[0002] The generation process of the navigation grid is relatively mature, however, the feasible area of the navigation grid generated by the program often has some problems, in the current game production, the test personnel generally detects it. After the detection meets the requirements, the path finding is generated to generate the path finding route.

[0003] However, the artificial detection has high technical requirements for the test personnel, needs a long time period, and cannot be batch detected. SUMMARY

[0004] Based on this, the embodiments of the present application provide a path finding method, device and storage medium, which can automatically and batch detect the feasible area of the navigation grid, and improve the production efficiency.

[0005] In a first aspect, the present application provides a path finding method, which comprises:

[0006] generating a navigation grid for an input scene;

[0007] detecting whether the feasible area of the navigation grid meets a first preset standard requirement;

[0008] if the feasible area of the navigation grid meets the first preset standard requirement, performing path finding according to the feasible area of the navigation grid to generate a path finding route.

[0009] In a second aspect, the present application provides a path finding device, which comprises a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and realize the path finding method as described above when executing the computer program.

[0010] In a third aspect, the present application provides a computer readable storage medium, which stores a computer program; the computer program is executed by a processor to make the processor realize the path finding method as described above.

[0011] The embodiments of the present application provide a path finding method, device and storage medium, because the first preset standard requirement of the feasible area of the navigation grid is set in advance, after the navigation grid is generated, it is automatically detected whether the feasible area of the navigation grid meets the first preset standard requirement, when the first preset standard requirement is met, path finding is performed according to the feasible area of the navigation grid to generate a path finding route; in this way, the feasible area of the generated navigation grid can be automatically and batch detected, and the production efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS

[0012] Figure 1 is a flowchart of an embodiment of the pathfinding method of the present application;

[0013] Figure 2 is a schematic diagram of an embodiment of the pathfinding method of the present application, in which the generated travelable area has a suspension before correction;

[0014] Figure 3 is a schematic diagram of Figure 2 the travelable area after correction, in which there is no suspension;

[0015] Figure 4 is a schematic diagram of an embodiment of the pathfinding method of the present application, in which the generated travelable area has a break before correction;

[0016] Figure 5 is a schematic diagram of Figure 4 the travelable area after correction, in which there is no break;

[0017] Figure 6 is a schematic diagram of an embodiment of the pathfinding method of the present application, in which the generated travelable area has a stair surface unevenness before correction;

[0018] Figure 7 is a schematic diagram of Figure 6 the travelable area after correction, in which there is no stair surface unevenness;

[0019] Figure 8 is a schematic diagram of an embodiment of the pathfinding device of the present application. DETAILED DESCRIPTION

[0020] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0021] The flowcharts shown in the drawings are only illustrative, and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the described order. For example, some operations / steps can be further decomposed, combined or partially merged, so the actual execution order can be changed according to the actual situation.

[0022] The generation process of the navigation grid is relatively mature, however, the travelable area of the navigation grid generated by the program often has some problems. In the current game production, the detection is generally performed by the test personnel. After the detection meets the requirements, the pathfinding is generated to generate the pathfinding route. However, the artificial detection has high technical requirements for the test personnel, requires a long time period, cannot be batch detected, and has low production efficiency.

[0023] The embodiment of the present application can automatically detect whether the passable area of the generated navigation grid meets the first preset standard requirement, and generate a routing route according to the passable area of the navigation grid only when the first preset standard requirement is met, so that the passable area of the generated navigation grid can be automatically and batch detected, and the production efficiency is improved.

[0024] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The following embodiments and features in the embodiments can be combined with each other without conflict.

[0025] Referring to Figure 1 , Figure 1 is a flowchart of an embodiment of a routing method of the present application, and the method comprises steps S101, S102 and S103.

[0026] Step S101: generating a navigation grid for an input scene.

[0027] Step S102: detecting whether the passable area of the navigation grid meets a first preset standard requirement.

[0028] Step S103: if the passable area of the navigation grid meets the first preset standard requirement, performing routing according to the passable area of the navigation grid to generate a routing route.

[0029] Navigation Mesh, also known as walkable surface, is a kind of polygon mesh data structure used for navigation in complex space, marking which places are walkable. Many times, it will be used to carry more functions, such as identifying the terrain of the location, the action (walking, swimming, climbing) that the character should take in the location. A navigation mesh is composed of multiple convex polygons (Poly Mesh). Poly Mesh is sometimes also referred to as Poly, which is the unit of navigation mesh. The generation process of navigation mesh is relatively mature, and the generation of navigation mesh depends on the design of the scene model. After inputting the scene, a logical surface model can be made, and then the navigation mesh can be automatically generated according to the model. For example, the Recast library is specially used for automatic generation of navigation mesh. The generation of navigation mesh can be divided into the following steps: scene model voxelization, or called "rasterization", filtering out walkable surface, generating Region, generating Contour (edge), generating Poly Mesh, and generating Detailed Mesh.

[0030] The first preset standard requirement is a requirement that the walkable area of the navigation mesh needs to meet before being set in advance and automatically detected. The first preset standard requirement includes but is not limited to: the walkable area cannot exist in suspension, the walkable area cannot exist in fracture (or the walkable area is continuous), the walkable area cannot exist in intersection, etc. Since the first preset standard requirement is set in advance, these requirements can be automatically detected, so after the navigation mesh is generated, it is detected whether the walkable area of the navigation mesh meets the first preset standard requirement, and if it meets the first preset standard requirement, the navigation is performed according to the walkable area of the navigation mesh to generate a navigation route. When navigating, a navigation algorithm can be used to calculate the convex polygon Poly that needs to be passed through, and then calculate the specific path. The navigation algorithm includes but is not limited to: A* algorithm, light ray method, corner point method, etc.

[0031] The embodiment of the present application sets the first preset standard requirement of the walkable area of the navigation mesh in advance, automatically detects whether the walkable area of the navigation mesh meets the first preset standard requirement after the navigation mesh is generated, and performs navigation according to the walkable area of the navigation mesh to generate a navigation route when the first preset standard requirement is met; in this way, the walkable area of the generated navigation mesh can be automatically and batch detected, and the production efficiency is improved.

[0032] In an embodiment, the step S102 of detecting whether the navigable area of the navigation mesh meets the first preset criterion requirement can include: detecting whether the navigable area of the navigation mesh has a suspension; and / or, detecting whether the navigable area of the navigation mesh has a break; and / or, detecting whether the navigable area of the navigation mesh has a crossing.

[0033] The generated correct navigable area should be a solid area and cannot be hollow. If the navigable area has a suspension, it means that the position of the suspension is not a solid area. The generated correct navigable area should be continuous and cannot have a break. If the navigable area has a break, it means that the position of the break is discontinuous and there is a dead angle. The generated correct navigable area should not have a crossing.

[0034] In an embodiment, the step S102 of detecting whether the navigable area of the navigation mesh has a suspension can include: a sub-step S102A1, a sub-step S102A2, a sub-step S102A3, and a sub-step S102A4.

[0035] The sub-step S102A1: randomly collecting a plurality of points in each convex polygon in the navigable area of the navigation mesh.

[0036] The sub-step S102A2: using a ray detection function of a virtual engine to emit a ray downward along a Z axis with each point of each convex polygon as a launching point.

[0037] The sub-step S102A3: obtaining a distance between an obstacle and a corresponding launching point when each ray of each convex polygon hits the obstacle.

[0038] The sub-step S102A4: determining whether the navigable area of the navigation mesh has a suspension according to a plurality of distances of each convex polygon.

[0039] In an embodiment, the step S102 of detecting whether the navigable area of the navigation mesh has a break can include: a sub-step S102B1 and a sub-step S102B2.

[0040] The sub-step S102B1: calculating a maximum connectable area of the navigable area of the navigation mesh according to adjacent edges between convex polygons in the navigable area of the navigation mesh.

[0041] The sub-step S102B2: determining whether the navigable area of the navigation mesh has a break according to a number of the maximum connectable areas and a preset number threshold.

[0042] The adjacent edges between the convex polygons are merged into a set to form a maximum connected region. In theory, the requirement that a scene can be walked around without dead angles is that there is only one maximum connected region, and the preset number threshold is 1. If there are multiple island transfers, the number of the preset number threshold is related to the number of isolated islands. Determine whether the number of the maximum connected region is consistent with the preset number threshold. If not, it can be determined that the navigable area of the navigation grid has a fracture. If consistent, it can be determined that the navigable area of the navigation grid has no fracture.

[0043] In an embodiment, the step S102 of detecting whether the navigable area of the navigation grid has a crossing can include a sub-step S102C1 and a sub-step S102C2.

[0044] Sub-step S102C1: Traverse all the faces of the convex polygons in the navigable area of the navigation grid.

[0045] Sub-step S102C2: Determine whether the navigable area of the navigation grid has a crossing according to whether there is a line of intersection between the faces of all the convex polygons.

[0046] In an embodiment, if the navigable area does not meet the first preset standard requirement, automatic correction can be performed, that is, the method further includes a step S104.

[0047] Step S104: If the navigable area of the navigation grid does not meet the first preset standard requirement, correct the navigable area of the navigation grid.

[0048] Generally, when the navigable area does not meet the first preset standard requirement, it is usually caused by insufficient standardization of the navigable area, and the navigable area can be automatically regularized. That is, in an embodiment, the step S104 of correcting the navigable area of the navigation grid can include re-regularizing the navigable area of the navigation grid.

[0049] The regularized processing of the navigable area can regenerate complex collisions. After generating the collisions, all actors are converted into staticmesh actors, and then the collision complexity is set to complex collision in batches.

[0050] As shown in Figure 2 and Figure 3 , the Figure 2 is the generated suspended navigable area before correction (represented by gray in the figure), Figure 3 is the obtained navigable area without suspension after correction (represented by gray in the figure). As shown in Figure 4 and Figure 5 , the Figure 4To correct the generated pre-broken passable region (represented in gray in the figure), both the table and the chair can pass through, Figure 5 To correct the generated post-broken passable region (represented in gray in the figure).

[0051] In some cases, such as the case of a multi-floor staircase, if the staircase surface is detected to be uneven (calculate whether the marked staircase mesh is on the same plane), the region generation method can be adjusted from the default watershed to chunkymonotone. Figure 6 To correct the pre-broken staircase surface (represented in white in the figure). Figure 7 To correct the post-broken staircase surface (represented in white in the figure).

[0052] If the passable region of the navigation grid is still not up to the first preset standard requirement after correction, a log can be recorded and the passable region that does not meet the first preset standard requirement can be marked for manual processing. In this way, manual processing can be more targeted and the workload of manual processing can be reduced.

[0053] In an embodiment, the generated routing path can also be automatically detected to detect whether the generated routing path meets the expectation, evaluate the quality of the generated routing path, and automatically adjust the routing path when it does not meet the expectation, thereby improving production efficiency. That is, the method can also include steps S105 and S106.

[0054] Step S105: Detect whether the routing path meets the second preset standard requirement.

[0055] Step S106: If the routing path does not meet the second preset standard requirement, adjust the routing path.

[0056] The second preset standard requirement is a requirement that the routing path needs to meet, which is pre-set and can be automatically detected. The second preset standard requirement includes but is not limited to: routing path detour requirement (for example: the routing path cannot have an obvious detour that does not conform to general human cognition, other acceptable detour situations, etc.), routing path loop walking requirement (for example: the routing path cannot have a loop walking path, other acceptable loop walking requirements, etc.), etc.

[0057] The main process of automatically adjusting the routing path is to combine the parameters of the generated passable region in multiple groups and then perform detection. For example, voxel cell size, agent radius, agent maxstep, agent maxslope, etc. can be used. Adjust within a certain range to see if it meets the second preset standard requirement.

[0058] If the route still does not meet the second preset standard requirement after automatic adjustment, the problem location can be automatically located for manual adjustment by the tester.

[0059] In an embodiment, the step S105 of detecting whether the route meets the second preset standard requirement can include: detecting whether a detour condition of the route meets a preset detour requirement; and / or, detecting whether a backtracking condition of the route meets a preset backtracking requirement.

[0060] In an embodiment, the step S105 of detecting whether the detour condition of the route meets the preset detour requirement can include: a sub-step S105A1 and a sub-step S105A2.

[0061] The sub-step S105A1: dividing a distance of the route between any two points by a straight-line distance between the two points to obtain a detour proportion of the route between the two points.

[0062] The sub-step S105A2: determining whether the detour condition of the route meets the preset detour requirement according to the detour proportion of the route between the two points.

[0063] For example, the preset detour requirement can be set in advance as: less than or equal to a preset detour proportion threshold value, if the detour proportion of the route is greater than the preset detour proportion threshold value, it is determined that the detour condition of the route does not meet the preset detour requirement, and the greater the detour proportion of the route, the more serious the detour condition of the route, which is inconsistent with the expectation.

[0064] For example: the distance of the route between AB is divided by the straight-line distance between AB to obtain a detour proportion of 1.5, the distance of the route between CD is divided by the straight-line distance between CD to obtain a detour proportion of 1.8, and the distance of the route between EF is divided by the straight-line distance between EF to obtain a detour proportion of 1.6, if the preset detour proportion threshold value is 2, it can be determined that the detour condition of the route meets the preset detour requirement; if the preset detour proportion threshold value is 1.6, it can be determined that the detour condition of the route does not meet the preset detour requirement.

[0065] In an embodiment, the step S105 of detecting whether the backtracking condition of the route meets the preset backtracking requirement can include: a sub-step S105B1 and a sub-step S105B2.

[0066] The sub-step S105B1: obtaining an included angle of two line segments composed of any two secondary connection points.

[0067] The secondary connection point only passes through one intermediate point, for example, A-B-C, the angle between line segment AB and line segment BC.

[0068] Sub-step S105B2: determining whether the walking loop condition of the routing path meets the preset walking loop requirement according to the angle between the two line segments composed of the arbitrary secondary connection points.

[0069] The angle is an acute angle, and the smaller the acute angle, the less smooth the routing path is, and it can be considered that the routing path has a walking loop. For example, the preset walking loop requirement can be that the walking loop condition with an angle less than a preset angle is not allowed.

[0070] For example: the angles between the two line segments composed of the arbitrary secondary connection points are 60°, 45° and 30°, respectively. If the preset walking loop requirement is that the walking loop condition with an angle less than 30° is not allowed, it can be determined that the walking loop condition of the routing path meets the preset walking loop requirement. If the preset walking loop requirement is that the walking loop condition with an angle less than 45° is not allowed, it can be determined that the walking loop condition of the routing path does not meet the preset walking loop requirement.

[0071] It should be noted that the method of the embodiment of the present application can be in the form of a virtual engine plug-in, which can be packaged in the environment through window or linux, and the detection and correction of batch scenes can be completed in a multi-process manner, and the detection index and the log corresponding to the problem can be output for manual review and adjustment. On windows, a function of visually detecting the problem area can be provided.

[0072] Referring to Figure 8 , Figure 8 is a structural schematic diagram of an embodiment of the routing device of the present application. It should be noted that the routing device of the embodiment can implement the routing method described above. For detailed description of related contents, please refer to the method part described above, which will not be repeated here.

[0073] The device 100 includes a memory 1 and a processor 2. The memory 1 is used to store a computer program. The processor 2 is used to execute the computer program and implement the routing method of any of the above when executing the computer program.

[0074] The processor 2 can be a micro control unit, a central processing unit or a digital signal processor, etc. The memory 1 can be a flash chip, a read-only memory, a magnetic disk, an optical disk, a U disk or a mobile hard disk, etc.

[0075] The present application also provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to make the processor implement the routing method of any of the above.

[0076] The computer readable storage medium can be an internal storage unit of the apparatus, such as a hard disk or a memory. The computer readable storage medium can also be an external storage device of the apparatus, such as a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, and the like.

[0077] It should be understood that the terms used in the present application specification are for the purpose of describing particular embodiments and are not intended to limit the present application.

[0078] It should also be understood that the term "and / or" as used herein refers to any combination of associated terms, including one or more of each associated term, and all possible combinations thereof.

[0079] The above description is merely illustrative of the application, and is not intended to limit the scope of the application. Any modifications or equivalents of the application should be construed as falling within the scope of the application. The scope of the application should be determined by the scope of the claims.

Claims

1. A pathfinding method, characterized in that, The method includes: Generate a navigation grid from the input scene; The system detects whether the traversable area of ​​the navigation grid meets the first preset standard requirements. The first preset standard requirements are pre-set, automatically detectable requirements that the traversable area of ​​the navigation grid must meet. The first preset standard requirements include that the traversable area cannot have any gaps, the traversable area cannot have any breaks, and the traversable area cannot have any intersections. If the traversable area of ​​the navigation grid meets the first preset standard requirements, then pathfinding is performed based on the traversable area of ​​the navigation grid to generate a pathfinding route; The method further includes: Detect whether the pathfinding route meets the second preset standard requirements; If the pathfinding route does not meet the second preset standard requirements, the pathfinding route is adjusted. The second preset standard requirements are pre-set, automatically detectable requirements that the pathfinding route must meet. The second preset standard requirements include the detour requirements of the pathfinding route and the route requirements for looping within the pathfinding route.

2. The method according to claim 1, characterized in that, The detection of whether the traversable area of ​​the navigation grid is suspended includes: Multiple points are randomly collected for each convex polygon within the traversable area of ​​the navigation grid; Using the ray detection function of the virtual engine, each point of each convex polygon is used as an emission point to emit rays downward along the Z-axis; Obtain the distance between the obstacle and the corresponding emission point when each ray of each convex polygon hits an obstacle; Based on the multiple distances of each convex polygon, determine whether the walkable area of ​​the navigation grid is suspended. And / or, detecting whether there are breaks in the traversable area of ​​the navigation mesh includes: Calculate the maximum connectable region of the traversable region of the navigation mesh based on the adjacent edges between convex polygons in the traversable region of the navigation mesh; Based on the number of the maximum connectable regions and a preset threshold number, it is determined whether there are breaks in the traversable region of the navigation grid. And / or, detecting whether the traversable areas of the navigation grid intersect includes: Traverse the faces and surfaces of all convex polygons within the traversable region of the navigation mesh; Based on whether there are intersections between the faces of all the convex polygons, it is determined whether the walkable area of ​​the navigation mesh intersects.

3. The method according to claim 1, characterized in that, The method further includes: If the traversable area of ​​the navigation grid does not meet the first preset standard requirements, the traversable area of ​​the navigation grid is corrected.

4. The method according to claim 3, characterized in that, The correction of the traversable area of ​​the navigation grid includes: The traversable area of ​​the navigation grid is re-normalized; The method further includes: If the corrected traversable area still does not meet the first preset standard requirements, then log the traversable area that does not meet the first preset standard requirements and mark it.

5. The method according to claim 1, characterized in that, The detection of whether the pathfinding route meets the second preset standard requirements includes Detecting whether the detour of the pathfinding route meets a preset detour requirement includes: dividing the distance of the pathfinding route between any two points by the straight-line distance between the two points to obtain the detour ratio of the pathfinding route between any two points; determining whether the detour of the pathfinding route meets the preset detour requirement based on the detour ratio of the pathfinding route between any two points, wherein the preset detour requirement is less than or equal to a preset detour ratio threshold; if the detour ratio of the pathfinding route is greater than the preset detour ratio threshold, then it is determined that the detour of the pathfinding route does not meet the preset detour requirement. And / or, detect whether the loop situation of the pathfinding route meets the preset loop requirement. The detection of whether the loop situation of the pathfinding route meets the preset loop requirement includes: obtaining the included angle of two line segments formed by any two secondary connection points; determining whether the loop situation of the pathfinding route meets the preset loop requirement based on the included angle of the two line segments formed by the two secondary connection points, wherein the preset loop requirement is that there is no loop situation where the included angle is less than a preset angle. If the included angle is an acute angle, the pathfinding route is considered to have a loop. The secondary connection point is a pathfinding route that only passes through one intermediate point. The secondary connection point can form two line segments.

6. A pathfinding device, characterized in that, The device includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the pathfinding method as described in any one of claims 1-5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the pathfinding method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Route generation method and device for three-dimensional game scene, and storage medium

    CN110772791A