CN115920401A - Path finding method and device, electronic equipment and readable storage medium - Google Patents

Path finding method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115920401A
CN115920401A CN202211642990.XA CN202211642990A CN115920401A CN 115920401 A CN115920401 A CN 115920401A CN 202211642990 A CN202211642990 A CN 202211642990A CN 115920401 A CN115920401 A CN 115920401A
Authority
CN
China
Prior art keywords
target
path
area
obstacle
aerial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211642990.XA
Other languages
Chinese (zh)
Inventor
刘伟亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Pixel Software Technology Co Ltd
Original Assignee
Beijing Pixel Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Pixel Software Technology Co Ltd filed Critical Beijing Pixel Software Technology Co Ltd
Priority to CN202211642990.XA priority Critical patent/CN115920401A/en
Publication of CN115920401A publication Critical patent/CN115920401A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Navigation (AREA)

Abstract

The embodiment of the application provides a way finding method and device, electronic equipment and a readable storage medium, and relates to the technical field of computers. The method comprises the following steps: obtaining a path finding task, wherein the path finding task comprises a starting point position and an end point position; judging whether the path searching task is an air path searching task or not; and when the path searching task is an air path searching task, based on a B-satellite algorithm, generating a first target route positioned in the air according to the starting position and the end position. Therefore, the air path finding can be completed quickly, and the path finding performance of the path finding system in the 3D scene is improved.

Description

Path finding method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a way finding method, an apparatus, an electronic device, and a readable storage medium.
Background
In the network game, the path searching in the map scene is always important, and most playing methods need navigation path searching technology, so that the importance of the navigation path searching technology is self-evident. Compared with the path finding technology in the 2D scene, the complexity of the path finding technology grows exponentially in the 3D scene. How to ensure the accuracy, stability, quick response and efficient utilization of server performance of the path finding in the 3D scene is a very important design content. The current path-finding scheme generally only finds the path for the ground surface, and cannot complete the interactive path-finding of the object in the air.
Disclosure of Invention
The embodiment of the application provides a path searching method, a path searching device, electronic equipment and a readable storage medium, which can quickly complete air path searching and improve the path searching performance of a path searching system in a 3D scene.
The embodiment of the application can be realized as follows:
in a first aspect, the present application provides a way finding method, including:
obtaining a path searching task, wherein the path searching task comprises a starting point position and an end point position;
judging whether the path searching task is an air path searching task or not;
and when the path searching task is an air path searching task, generating a first target route positioned in the air according to the starting position and the end position based on a B-satellite algorithm.
In a second aspect, the present application provides a way finding device, which includes:
the task acquisition module is used for acquiring a path searching task, wherein the path searching task comprises a starting point position and an end point position;
the judging module is used for judging whether the path searching task is an air path searching task;
and the planning module is used for generating a first target route positioned in the air according to the starting point position and the end point position based on a B-satellite algorithm when the path searching task is an air path searching task.
In a third aspect, the present application provides an electronic device, including a processor and a memory, where the memory stores machine executable instructions capable of being executed by the processor, and the processor can execute the machine executable instructions to implement the way-finding method described in any one of the foregoing embodiments.
In a fourth aspect, the present application provides a readable storage medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing the way-finding method according to any one of the foregoing embodiments.
According to the path searching method, the path searching device, the electronic equipment and the readable storage medium, when the obtained path searching task is an air path searching task, a first target route in the air is generated according to a starting point position and an end point position in the path searching task based on a B-satellite algorithm. Therefore, the air path finding can be completed quickly, and the path finding performance of the path finding system in the 3D scene is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic block diagram of an electronic device according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a way-finding method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating the sub-steps included in step S130 of FIG. 2;
fig. 4 is a second schematic flowchart of a way-finding method according to an embodiment of the present application;
fig. 5 is a third schematic flowchart of a way-finding method according to an embodiment of the present application;
fig. 6 is a schematic block diagram of a way-finding device according to an embodiment of the present application;
fig. 7 is a second block diagram of a way-finding device according to an embodiment of the present application.
Icon: 100-an electronic device; 110-a memory; 120-a processor; 130-a communication unit; 200-a way-finding device; 201-a pre-processing module; 210-a task acquisition module; 220-a judgment module; 230-planning module.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The Recast Navigation (hereinafter abbreviated as RNV) is a very powerful solution for a way-finding system, and is widely applied to various large game engines (union, etc.). The RNV scheme further refines on the basis of the concept of voxels, and finally expresses the 3D scene using the concept of NavMesh (navigation grid). RNV schemes use a combination of a-star algorithm and NavMesh to guarantee the reachability in 3D scenes. However, all operations of the RNV scheme are based on the ground surface, and interactive path finding of objects in the air cannot be completed.
The embodiment of the application provides a path finding method, a path finding device, electronic equipment and a readable storage medium, which can quickly complete air path finding to meet the requirement of air interaction and improve the path finding performance of a path finding system in a 3D scene.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a block diagram of an electronic device 100 according to an embodiment of the present disclosure. The electronic device 100 may be, but is not limited to, a server or the like. The electronic device 100 includes a memory 110, a processor 120, and a communication unit 130. The memory 110, the processor 120 and the communication unit 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines.
The memory 110 is used to store programs or data. The Memory 110 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Read Only Memory (EPROM), an electrically Erasable Read Only Memory (EEPROM), and the like.
The processor 120 is used to read/write data or programs stored in the memory 110 and perform corresponding functions. For example, the memory 110 stores therein the way searching device 200, and the way searching device 200 includes at least one software functional module which can be stored in the memory 110 in the form of software or firmware (firmware). The processor 120 executes various functional applications and data processing by running software programs and modules stored in the memory 110, such as the way-finding device 200 in the embodiment of the present application, so as to implement the way-finding method in the embodiment of the present application.
The communication unit 130 is used to establish a communication connection between the electronic apparatus 100 and another communication terminal through a network, and to transceive data through the network.
It should be understood that the structure shown in fig. 1 is only a schematic structural diagram of the electronic device 100, and the electronic device 100 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
Referring to fig. 2, fig. 2 is a schematic flow chart of a way-finding method according to an embodiment of the present disclosure. The method may be applied to the electronic device 100 described above. The specific flow of the way-finding method is explained in detail below. In this embodiment, the method may include steps S110 to S130.
Step 110, obtain the way-finding task.
In this embodiment, the routing task is used for finding a path from one location to another location for a target object in a game. The specific obtaining manner of the routing task is not specifically limited herein, and may be set in combination with an actual situation. The route searching task may include a starting position and an ending position.
Step S120, judging whether the path searching task is an air path searching task.
According to the starting point position and the end point position, whether the path searching task is an air path searching task or a ground path searching task (namely, a ground surface path searching task) can be judged, and the specific judgment mode can be set by combining with actual requirements. For example, when at least one of the start position and the end position is located in the air, the route searching task is determined to be an air route searching task, and otherwise, the route searching task is determined to be a ground route searching task.
And when the route searching task is an air route searching task, executing step S130.
And step S130, based on the B-satellite algorithm, generating a first target route in the air according to the starting point position and the end point position.
The B-star algorithm uses a greedy strategy, and each time searches for a position closest to the end point, so that the first target route can be quickly obtained based on the start point position and the end point position. Therefore, the air path finding can be completed quickly, and the path finding performance of the path finding system in the 3D scene is improved.
As a possible implementation, the first target route may be obtained quickly in the manner shown in fig. 3. Referring to fig. 3, fig. 3 is a flowchart illustrating sub-steps included in step S130 in fig. 2. In the present embodiment, step S130 may include sub-steps S131 to S132.
And a substep S131, determining a target aerial region through which the first target route passes according to the height range, the starting point position and the ending point position corresponding to each aerial region divided in advance.
In this embodiment, the air part of the game scene is divided into a plurality of air areas in advance, and the height ranges corresponding to different air areas are different. For example, 0-9 meters is an aerial region, 9-18 meters is an aerial region, the control region is located above the aerial region with the height range of 0-9 meters, and the like. A waypoint is arranged between the adjacent air areas and used for routing, and the waypoint needs to be passed when the waypoint is moved from one air area to the other air area.
The air area through which the first target route passes can be determined according to the height range corresponding to each air area and the starting point position and the end point position in the routing task, and the determined air area is used as the target air area. For example, if 0 to 9 meters is assumed as the aerial area a and 9 to 18 meters is assumed as the aerial area B, and if the height of the starting point position is 3 meters and the height of the ending point position is 11 meters, it can be determined that the aerial area A, B is the target aerial area through which the first target route passes.
And a substep S132, aiming at each target aerial region, parallelly carrying out route searching according to the starting point and the end point corresponding to the target aerial region based on the B-satellite algorithm, and obtaining a target path section corresponding to the target space region.
Under the condition of determining the target air area, the multiple threads are used for respectively performing path finding on the corresponding target air area in parallel based on a B-satellite algorithm, and the target path segment corresponding to each target air area is obtained. The target paths corresponding to the target aerial areas form the first target route, and the coincidence point of the target path sections corresponding to the adjacent target space areas is a route point arranged between the adjacent target space areas. Therefore, the path searching speed can be increased, so that the first target route can be obtained quickly.
For example, if the target air area A, B is determined, a thread may be used to perform a path finding in the target air area a to obtain a target path segment 1; and simultaneously, carrying out path searching in the target aerial area B by using another thread to obtain a target path section 2. The target path segment 1 and the target path segment 2 have an end point coincidence, the coincidence position is a path point between target air areas A, B, and the target path segment 1 and the target path segment 2 form a first target path. Due to the parallel path finding, the speed of obtaining the first target route can be increased.
It can be understood that, when performing a route finding in any one of the target aerial regions, the starting point and the ending point corresponding to the target aerial region can be determined by combining whether the target aerial region is a region where the starting point position or the ending point position is located and a waypoint between adjacent aerial regions. For example, as described above, for the target air region a, the corresponding start point is the start point position, and the corresponding end point is the waypoint between the target air regions A, B. For another example, for the target air region B, the corresponding start point is a waypoint between the target air regions A, B, and the corresponding end point is the end point position. For another example, for a target aerial region that does not include the start point position and the end point position, the start point and the end point corresponding to the target control region are waypoints between the target aerial region and two adjacent aerial regions.
And the starting point and the end point corresponding to one target air area are used for searching the way for the target air area.
In order to ensure the accessibility of the routing, the obstacle information corresponding to each air area can be determined in advance based on the game scene and the height of each divided air area. The obstacle information corresponding to one air area indicates whether an obstacle exists in the air area, and when the obstacle exists, the obstacle information can also comprise attribute information such as the size and the position of the obstacle, so that the obstacle avoidance information can be used.
When a path is found for any one target aerial area, if it is determined that no obstacle exists between a starting point corresponding to the target aerial area and an end point corresponding to the target aerial area according to obstacle information corresponding to the target aerial area, a target path segment corresponding to the target aerial area can be generated according to the starting point and the end point corresponding to the target aerial area by directly using a B-satellite algorithm.
The specific manner of judging whether an obstacle exists between the starting point and the end point corresponding to a target aerial area can be set by combining actual requirements. For example, taking the starting point as a ray starting point, making a ray towards the end point, and if the ray intersects with the obstacle, determining that the obstacle exists; otherwise, determining that no obstacle exists.
And when the obstacle information corresponding to the target aerial area indicates that an obstacle exists between a starting point and an end point corresponding to the target aerial area, judging whether the position of the existing obstacle is fixed or not and whether a routable area exists in the existing obstacle relative to a target object corresponding to the routing task or not.
The fixed position of the airborne obstacle means that the obstacle floats in the air and remains relatively stationary with respect to the ground surface. And a routable area exists inside the obstacle relative to a target object corresponding to the routing task, and the target object can pass through the obstacle. For example, the obstacle is a space station, the inner space of which allows the target object to pass through.
If the position of the existing obstacle is fixed and the inside of the obstacle has the routing enabled area relative to the target object corresponding to the routing task, the relative ground surface of the obstacle can be determined. In the 3D world, the ground surface means a reference unit in a horizontal direction of the map 3D model, and the relative ground surface means a reference unit in a horizontal direction at a certain height above the ground surface. For example, the upper surface of an island in the air is the opposite ground surface. In the case of a surface existing in the obstacle itself, the surface can be directly used as an opposite ground surface of the obstacle; when the obstacle does not exist, a relative ground surface can be virtualized based on the obstacle, for example, if the space station has no surface, the relative ground surface can be virtualized.
After determining the relative ground surface of the obstacle, a Recast Navigation may be utilized to generate a first target sub-path segment corresponding to the obstacle based on the relative ground surface. And generating a second target sub-path section corresponding to the area of the target air area except the sub-area where the obstacle is located by using a B-satellite algorithm according to the existing obstacle and the starting point and the end point corresponding to the target air area so as to obtain the target path section corresponding to the target air area. Wherein the target path segment comprises the first target sub-path segment and the second target sub-path segment.
It should be noted that the number of the first target sub-path segment and the second target sub-path segment may be different from one another, and the specific generation sequence may be determined by actual situations. For example, the starting point corresponding to the target aerial region is M (a 1, B1, c 1), the end point is N (a 2, B2, c 2), a ray is first calculated with point M as the starting point and point B as one point in the ray, then the ray is moved along the ray direction, and if there is no obstacle in the ray, the end point is reached smoothly; if an obstacle is encountered in the moving process, a first target sub-path segment corresponding to the obstacle is generated, and then the moving is continued towards the B to finish the path searching in the target empty area. The target path segment obtained in the above manner is equivalent to a path segment obtained by replacing a sub-path segment corresponding to the obstacle in an initial path segment by using a first target sub-path segment corresponding to the obstacle, for the initial path segment generated based on the starting point and the ending point by directly using the B-star algorithm.
The following is a brief description of the way finding process using Recast Navigation.
The first part is Recast. First, 3D-based scene assets construct a prime model mathematically, and then crop where some characters cannot move. For example, the clipping is performed for a dead corner area, an area that does not meet the character entry condition, and the like. The area which does not meet the character entering condition means that the entering conditions of all characters in the game scene are not matched with the area, and no character can enter the area. Clipping means discarding the area. After cropping, the walkable behavior described by the voxel model is converted into a simple 2D region. In the generated 2D area, the boundary can be tracked, simplified, stripped from the area, and finally converted into a convex polygon to obtain a mathematical model for facilitating the way finding. The simplification may be to remove the space between the connected regions, for example, one common edge of the square a and the square B is removed, and a new rectangle is formed.
The second part is the Detour part. The Detour part finds the path of two coordinate points by the A-x algorithm. Detour is divided into 3 steps: taking A, B as an example, firstly, a convex polygon closest to a starting point a and an end point B is searched through a BVH tree, then, the convex polygon passing from the point a to the point B is calculated through an a-x algorithm, and finally, a final path is optimized through a funnel algorithm.
If the position of the existing obstacle is not fixed or no trackable area exists in the target object relative to the target object, the target avoidance mode can be determined according to the attribute of the target object and/or the attribute of the obstacle. That is, the avoidance strategy to be used may be determined according to the attribute of the target object and/or the attribute of the obstacle. For example, when the obstacle is static, if the target object has a jump attribute, the current obstacle may be skipped; if the flight attribute is possessed, the current barrier can be jumped; the method of detouring along the edge of an obstacle used in the ground surface route finding using the B-star algorithm may be selected. When the obstacle is moving, a method of waiting for the obstacle to move may be selected. Therefore, the barrier can be avoided through various avoidance strategies, and the accessibility of the path is ensured. Wherein the attributes of the target object and/or the attributes of the obstacle may be obtained from a configuration table.
And under the condition that the target avoiding mode is determined, determining a third target sub-path section corresponding to the barrier according to the target avoiding mode. For example, if the target avoidance mode is to fly over the current obstacle, a third target sub-path segment for indicating to fly over the current obstacle may be generated; if the target avoidance mode is waiting for the movement of the obstacle, a third target sub-path segment indicating the movement of the waiting obstacle may be generated, for example, only one point close to the obstacle in the third target sub-path segment is set, and waiting time is set.
And generating a second target sub-path section corresponding to the region of the target air region except the sub-region where the obstacle is located by using a B-satellite algorithm to obtain the target path section corresponding to the target air region. Wherein the target path segment comprises the second target sub-path segment and the third target sub-path segment.
As another possible implementation manner, a path planning may be performed directly according to the start position and the end position by using a B-star algorithm. Optionally, in the planning process, if an obstacle is encountered, detouring can be performed directly according to a detouring mode adopted by the B-star algorithm to find a path for the ground surface and encounter the obstacle; and determining a target avoidance mode according to the attribute of the target object aimed at by the route searching task and/or the attribute of the encountered obstacle, further determining a detour sub-road section based on the target avoidance mode, and further continuing to use the B-star algorithm to search for the route, thereby obtaining the first target route.
Optionally, in this embodiment, when the route searching task is a ground route searching task, a Recast Navigation may be used to generate a second target route according to the starting position and the ending position.
Referring to fig. 4, fig. 4 is a second schematic flow chart of a way-finding method according to the embodiment of the present application. In this embodiment, the method may further include steps S140 to S160. And executing the step S140 when the route searching task is a ground route searching task.
Step S140, determining the current route searching scale.
Step S150, determine whether the current route searching scale is larger than a preset value.
When the current route searching scale is larger than the preset value, step S160 is executed.
And step S160, generating a second target route according to the starting position and the end position by using a B star algorithm.
The current seek size is used to represent the total number of current seek tasks. If the current path-searching scale is larger than the preset value, the current path-searching task is more, and the pressure ratio of the equipment for searching the path is larger. The B-star algorithm adopts a greedy strategy, the position closest to the end point is searched each time, the weight is not calculated like the A-star algorithm, and therefore the efficiency is 10 times to 100 times higher than that of the A-star. In order to relieve the road searching pressure, when the road searching scale is large, a second target route is generated according to the starting position and the end position by adopting a B star algorithm.
Referring to fig. 4 again, in this embodiment, the method may further include step S170. And executing the step S170 when the current path-searching size is not larger than the preset value.
And step S170, generating a second target route according to the starting point position and the end point position by using Recast Navigation.
The A star algorithm can accurately find out the path between two points. And under the condition that the current path searching pressure is not high, a second target path can be generated according to the starting position and the end position by using Recast Navigation so as to ensure the path searching effect.
Referring to fig. 5, fig. 5 is a third schematic flow chart of a way-finding method according to the embodiment of the present application. In this embodiment, the method may further include step S101 to step S103.
In step S101, a voxel model is generated in advance from a game scene.
And step S102, generating a target two-dimensional map for ground surface route searching according to the voxel model.
Step S101 is the same as step S102 and the processing before routing, and is not described herein again.
Step S103, dividing the air of the game scene into a plurality of air areas in advance, and generating the obstacle information corresponding to each air area according to the voxel model and the height range corresponding to each air area.
The voxel model simultaneously describes the distribution of the obstacles in the air in the game scene. The air of the game scene may be divided into a plurality of air regions. I.e. the physical height field is divided for the aerial part. The height ranges of different aerial regions can be the same or different, and can be specifically set by combining actual requirements, for example, the aerial region is 9m high, the aerial region is 10m high, and all the aerial regions can be 9m high. And generating the obstacle information corresponding to each aerial area according to the obstacle distribution condition represented by the voxel model and the height range corresponding to each aerial area.
In the embodiment, the aerial part is reasonably divided into different physical height fields, so that the path searching is respectively carried out in each physical height field to improve the path searching speed. Meanwhile, the concept of the relative ground surface is put forward, the Recast Navigation is used for carrying out the path searching on the relative ground surface, and the B-satellite algorithm is used for carrying out the fuzzy path searching in the air, so that the defects of the RNV scheme are overcome, the requirement of air interaction is met, and the pressure of the path searching equipment can be reduced. Meanwhile, the accessibility of the routing is ensured by assisting physical behaviors. And when the path searching pressure is high, the path searching is performed by adopting a B-star algorithm aiming at the path searching tasks on the ground and in the air so as to reduce the path searching pressure of the equipment.
In order to execute the corresponding steps in the above embodiments and various possible manners, an implementation manner of the route searching device 200 is given below, and optionally, the route searching device 200 may adopt the device structure of the electronic device 100 shown in fig. 1. Further, referring to fig. 6, fig. 6 is a block diagram of a way finding device 200 according to an embodiment of the present disclosure. It should be noted that the basic principle and the generated technical effect of the route searching device 200 provided in the present embodiment are the same as those of the above embodiments, and for the sake of brief description, no part of the present embodiment is mentioned, and corresponding contents in the above embodiments may be referred to. The route searching device 200 may include: a task obtaining module 210, a judging module 220 and a planning module 230.
The task obtaining module 210 is configured to obtain a way-finding task. The path searching task comprises a starting point position and an end point position.
The determining module 220 is configured to determine whether the path finding task is an air path finding task.
The planning module 230 is configured to generate a first target route located in the air according to the starting point position and the ending point position based on a B-star algorithm when the route searching task is an air route searching task.
Optionally, in this embodiment, the planning module 230 is specifically configured to: determining target aerial areas through which the first target route passes according to the height ranges, the starting point positions and the end point positions corresponding to the pre-divided aerial areas, wherein the height ranges corresponding to different aerial areas are different, and a route point is arranged between adjacent aerial areas; and for each target aerial area, parallelly carrying out route finding according to a starting point and an end point corresponding to the target aerial area based on a B-satellite algorithm to obtain a target path section corresponding to the target space area, wherein the first target route comprises the target path section corresponding to each target space area, and a coincidence point of the target path sections corresponding to adjacent target space areas is a route point arranged between the adjacent target space areas.
Optionally, in this embodiment, the planning module 230 is specifically configured to: under the condition that the obstacle information corresponding to the target aerial area indicates that no obstacle exists between the starting point and the end point corresponding to the target aerial area, generating a target path section corresponding to the target aerial area by using a B-satellite algorithm according to the starting point and the end point corresponding to the target aerial area; when the obstacle information corresponding to the target air area indicates that an obstacle exists between a starting point and an end point corresponding to the target air area, if the position of the existing obstacle is fixed and a routable area exists inside the target object corresponding to the routable task, determining a relative ground surface of the obstacle, generating a first target sub-path segment corresponding to the obstacle based on the relative ground surface by using Recast Navigation, and generating a second target sub-path segment corresponding to an area except for a sub-area where the obstacle is located in the target air area by using a B-satellite algorithm according to the existing obstacle, the starting point and the end point corresponding to the target air area to obtain the target path segment corresponding to the target air area, wherein the target path segment comprises the first target sub-path segment and the second target sub-path segment.
Optionally, in this embodiment, the planning module 230 is specifically configured to: when the obstacle information corresponding to the target aerial area indicates that an obstacle exists between a starting point and an end point corresponding to the target aerial area, if the position of the existing obstacle is not fixed or no routing area exists in the existing obstacle relative to the target object, determining a target avoidance mode according to the attribute of the target object and/or the attribute of the obstacle; and determining a third target sub-path section corresponding to the obstacle according to the target avoidance mode, and generating a second target sub-path section corresponding to a region except for a sub-region where the obstacle is located in the target air region by using a B-satellite algorithm to obtain a target path section corresponding to the target air region, wherein the target path section comprises the second target sub-path section and the third target sub-path section.
Optionally, in this embodiment, when the route searching task is a ground route searching task, the planning module 230 is further configured to determine a current route searching scale, and when the current route searching scale is greater than a preset value, generate a second target route according to the start position and the end position by using a star-B algorithm.
Optionally, in this embodiment, the planning module 230 is further configured to generate a second target route according to the starting position and the ending position by using Recast Navigation when the current route searching scale is not greater than the preset value.
Referring to fig. 7, fig. 7 is a second block diagram of a way-finding device 200 according to an embodiment of the present application. In this embodiment, the way searching device 200 may further include a preprocessing module 201.
The preprocessing module 201 is configured to: generating a voxel model according to a game scene in advance; generating a target two-dimensional map for ground surface path finding according to the voxel model; dividing the air of the game scene into a plurality of air areas in advance, and generating the obstacle information corresponding to each air area according to the voxel model and the height range corresponding to each air area.
Alternatively, the modules may be stored in the memory 110 shown in fig. 1 in the form of software or Firmware (Firmware) or may be fixed in an Operating System (OS) of the electronic device 100, and may be executed by the processor 120 in fig. 1. Meanwhile, data, codes of programs, and the like required to execute the above-described modules may be stored in the memory 110.
The embodiment of the application also provides a readable storage medium, on which a computer program is stored, and the computer program realizes the way-finding method when being executed by a processor.
In summary, the embodiments of the present application provide a way finding method, an apparatus, an electronic device, and a readable storage medium, where when an obtained way finding task is an air way finding task, based on a B-star algorithm, a first target route located in the air is generated according to a starting point position and an ending point position in the way finding task. Therefore, the air path finding can be completed quickly, and the path finding performance of the path finding system in the 3D scene is improved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is intended only as an alternative example of the present application and not as a limitation on the present application, as various modifications and variations of the present application will occur to those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method for routing, the method comprising:
obtaining a path searching task, wherein the path searching task comprises a starting point position and an end point position;
judging whether the path searching task is an air path searching task or not;
and when the path searching task is an air path searching task, based on a B-satellite algorithm, generating a first target route positioned in the air according to the starting position and the end position.
2. The method according to claim 1, wherein when the routing task is an aerial routing task, generating a first target route in the air according to the starting position and the ending position based on a B-star algorithm comprises:
determining target aerial areas through which the first target route passes according to the height ranges, the starting point positions and the end point positions corresponding to the pre-divided aerial areas, wherein the height ranges corresponding to different aerial areas are different, and a route point is arranged between adjacent aerial areas;
and for each target aerial area, parallelly carrying out route finding according to a starting point and an end point corresponding to the target aerial area based on a B-satellite algorithm to obtain a target path section corresponding to the target space area, wherein the first target route comprises the target path section corresponding to each target space area, and a coincidence point of the target path sections corresponding to adjacent target space areas is a route point arranged between the adjacent target space areas.
3. The method according to claim 2, wherein the obtaining the target path segment corresponding to the target spatial zone by performing, for each target aerial zone, a path finding according to a start point and an end point corresponding to the target aerial zone based on a B-satellite algorithm in parallel comprises:
under the condition that the obstacle information corresponding to the target aerial area indicates that no obstacle exists between the starting point and the end point corresponding to the target aerial area, generating a target path section corresponding to the target aerial area by using a B-satellite algorithm according to the starting point and the end point corresponding to the target aerial area;
when the obstacle information corresponding to the target aerial area indicates that an obstacle exists between a starting point and an end point corresponding to the target aerial area, if the position of the existing obstacle is fixed and a routable area exists inside the target object corresponding to the routing task, determining a relative ground surface of the obstacle, generating a first target sub-path segment corresponding to the obstacle based on the relative ground surface by using Recast Navigation, and generating a second target sub-path segment corresponding to an area except for the sub-area where the obstacle is located in the target aerial area by using a B-satellite algorithm according to the existing obstacle, the starting point and the end point corresponding to the target aerial area to obtain the target path segment corresponding to the target aerial area, wherein the target path segment comprises the first target sub-path segment and the second target sub-path segment.
4. The method according to claim 3, wherein for each target aerial region, the path finding is performed in parallel based on the B-star algorithm according to the starting point and the ending point corresponding to the target aerial region to obtain the target path segment corresponding to the target aerial region, further comprising:
when the obstacle information corresponding to the target aerial area indicates that an obstacle exists between a starting point and an end point corresponding to the target aerial area, if the position of the existing obstacle is not fixed or no road-seeking area exists in the interior relative to the target object, determining a target avoidance mode according to the attribute of the target object and/or the attribute of the obstacle;
and determining a third target sub-path section corresponding to the obstacle according to the target avoidance mode, and generating a second target sub-path section corresponding to a region except for a sub-region where the obstacle is located in the target air region by using a B-satellite algorithm to obtain a target path section corresponding to the target air region, wherein the target path section comprises the second target sub-path section and the third target sub-path section.
5. The method according to any one of claims 1-4, further comprising:
when the path searching task is a ground path searching task, determining the current path searching scale;
and when the current route searching scale is larger than a preset value, generating a second target route according to the starting position and the end position by using a B star algorithm.
6. The method of claim 5, further comprising:
and when the current route searching scale is not larger than a preset value, generating a second target route according to the starting position and the end position by using Recast Navigation.
7. The method of claim 6, further comprising:
generating a voxel model according to a game scene in advance;
generating a target two-dimensional map for ground surface path finding according to the voxel model;
dividing the air of the game scene into a plurality of air areas in advance, and generating the obstacle information corresponding to each air area according to the voxel model and the height range corresponding to each air area.
8. A way-finding device, characterized in that the device comprises:
the system comprises a task obtaining module, a route searching module and a route searching module, wherein the route searching module is used for obtaining a route searching task, and the route searching task comprises a starting point position and an end point position;
the judging module is used for judging whether the path searching task is an air path searching task;
and the planning module is used for generating a first target route positioned in the air according to the starting point position and the end point position based on a B-satellite algorithm when the path searching task is an air path searching task.
9. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor to implement the way-finding method of any one of claims 1-7.
10. A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the way-finding method according to any one of claims 1-7.
CN202211642990.XA 2022-12-20 2022-12-20 Path finding method and device, electronic equipment and readable storage medium Pending CN115920401A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211642990.XA CN115920401A (en) 2022-12-20 2022-12-20 Path finding method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211642990.XA CN115920401A (en) 2022-12-20 2022-12-20 Path finding method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115920401A true CN115920401A (en) 2023-04-07

Family

ID=86652580

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211642990.XA Pending CN115920401A (en) 2022-12-20 2022-12-20 Path finding method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115920401A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117589172A (en) * 2023-11-21 2024-02-23 国广顺能(上海)能源科技有限公司 Path planning method and device for mobile robot, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117589172A (en) * 2023-11-21 2024-02-23 国广顺能(上海)能源科技有限公司 Path planning method and device for mobile robot, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
JP6828044B2 (en) Route deviation recognition method, terminal, and storage medium
CN111968229B (en) High-precision map making method and device
US10467914B2 (en) Methods and systems for autonomous generation of shortest lateral paths for unmanned aerial systems
US6725152B2 (en) Real-time route and sensor planning system with variable mission objectives
CN106092102A (en) A kind of unmanned plane paths planning method and device
US20140334713A1 (en) Method and apparatus for constructing map for mobile robot
CN112444263B (en) Global path planning method and device
US6718261B2 (en) Architecture for real-time maintenance of distributed mission plans
CN112904369B (en) Robot repositioning method, apparatus, robot, and computer-readable storage medium
CN115920401A (en) Path finding method and device, electronic equipment and readable storage medium
CN114625162A (en) Hybrid algorithm-based optimal path planning method, system and medium for unmanned aerial vehicle
CN114187357A (en) High-precision map production method and device, electronic equipment and storage medium
US20230182743A1 (en) Method and system for extracting road data and method and system for controlling self-driving car
US7647232B2 (en) Real-time team coordination system for reconnaissance and surveillance missions
CN113448340B (en) Unmanned aerial vehicle path planning method and device, unmanned aerial vehicle and storage medium
Zimmermann et al. Integration of a visibility graph based path planning method in the ACT/FHS rotorcraft
CN112597946A (en) Obstacle representation method and device, electronic equipment and readable storage medium
CN116823942A (en) Target labeling method of three-dimensional point cloud and target tracking method in continuous frames of point cloud
US11294384B2 (en) Vehicle navigation using point cloud decimation
CN114407919A (en) Collision detection method and system based on automatic driving
CN113867371A (en) Path planning method and electronic equipment
KR20180050074A (en) Method for processing road information and method for simulating virtual combat simulation
CN114791936A (en) Storage, efficient editing and calling method for passable area of unmanned vehicle
Gedicke et al. Selecting Landmarks for Wayfinding Assistance Based on Advance Visibility
JP2013196648A (en) Information processing device, information processing method, program and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination