Path-finding map data generation method, path-finding method, device and terminal device

By dividing the game scene map into multiple grids and determining legal and connected station locations, road search map data is generated, which solves the problem of large-scale road search calculations and long time in large-scene games, and improves the game experience.

CN114404983BActive Publication Date: 2024-11-29BEIJING PIXEL SOFTWARE TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111638627.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2024-11-29
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

In large-scene games, traditional pathfinding algorithms calculate based on data formatted in advance, resulting in too large calculations and too long time, affecting the game experience.

Method used

A method for generating road-finding map data is proposed. By dividing the scene map into multiple grids, the center coordinate of each grid is used as the station site, and the legal station site with accessibility and its connecting station site are determined. , generate road search map data.

Benefits of technology

Through the generated road-finding map data, the calculation amount and time of road-finding are reduced, and the smoothness of the game and the player's experience are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114404983B_ABST
    Figure CN114404983B_ABST
Patent Text Reader

Abstract

The present application discloses a method for generating pathfinding map data, a pathfinding method, an apparatus and a terminal device, the method comprising dividing a scene map into a plurality of grids according to a predetermined segmentation unit, wherein the central coordinates of each grid are used as a post station; determining a legal post station position with accessibility from all post station positions; determining the connected post station position of each legal post station position; and determining pathfinding map data according to all the legal post station positions and all the connected post station positions. The pathfinding map data determined by the method can reduce the amount of pathfinding calculation, shorten the pathfinding time, and enhance the user's gaming experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game pathfinding technology, and in particular to a pathfinding map data generation method, a pathfinding method, an apparatus and a terminal device. Background Art

[0002] Pathfinding is a very important function in many types of games. Usually, methods such as Dijkstra algorithm, A* algorithm, JPS (jump point search) algorithm, etc. are used to calculate the path. These pathfinding methods are often based on a set of pre-formatted data for pathfinding calculations. For example, the A* algorithm will regard the entire scene as multiple grids and perform pathfinding calculations based on these grids. In the pathfinding system of large-scale games, long-distance and ultra-long-distance pathfinding requirements usually arise. At this time, if the inherent pathfinding algorithm is still used to perform pathfinding based on pre-formatted data, it will result in excessive calculations and long calculation time, affecting the game experience of gamers. Summary of the invention

[0003] In view of the above problems, the present application proposes a method for generating path-finding map data, a path-finding method, an apparatus and a terminal device to reduce the amount of path-finding calculation and shorten the path-finding time.

[0004] In a first aspect, an embodiment of the present application provides a method for generating path-finding map data, the method comprising:

[0005] The scene map is divided into multiple grids according to the predetermined division units, wherein the center coordinates of each grid are used as a post station location;

[0006] Determine the legal and reachable post locations from all post locations;

[0007] Determine the connected post locations of each legal post location;

[0008] The route map data is determined based on all the legal post station locations and all the connected post station locations.

[0009] The method for generating route map data described in the embodiment of the present application, wherein determining a legal station location with reachability from all station locations comprises:

[0010] Deleting the station locations that do not meet the screening conditions from all the station locations by using the preset screening conditions to obtain the remaining station locations;

[0011] Determine whether each of the remaining post locations is reachable based on the target post location by using a pathfinding algorithm, so as to determine directly reachable post locations and unreachable post locations from the remaining post locations;

[0012] Calibrate each unreachable post station position, and take the post station position that is reachable after calibration as the calibrated reachable post station position;

[0013] Each of the directly reachable post station positions and the calibrated reachable post station positions is regarded as the legal post station position.

[0014] The method for generating route map data according to the embodiment of the present application, wherein the route map data is determined according to all the legal post stations and all the connected post stations, comprises:

[0015] The path-finding map data is determined according to the uncalibrated post station positions, the calibrated reachable post station positions and all the connected post station positions corresponding to all the legal post station positions.

[0016] The method for generating route map data according to the embodiment of the present application, wherein the method uses a preset screening condition to delete the station locations that do not meet the screening condition from all station locations, comprises:

[0017] Deleting the station positions whose coordinate values ​​in the height direction are not within the predetermined height range from all the station positions;

[0018] And / or, the post station positions whose distances to the predetermined edge post station positions are less than a predetermined edge distance threshold are deleted from all the post station positions.

[0019] The method for generating path-finding map data according to the embodiment of the present application, wherein each inaccessible post station position is calibrated, and the post station position with accessibility after calibration is used as the calibrated reachable post station position, comprises:

[0020] Move the i-th unreachable post station position multiple times according to the preset multiple calibration directions and calibration moving distances, and after each movement, determine whether the i-th unreachable post station position has the reachability based on the target post station position using the path finding algorithm, 1≤i≤I, I is the total number of the unreachable post station positions;

[0021] If it is determined that the i-th inaccessible post station position has the reachability within the preset moving distance limit or moving number limit, the i-th inaccessible post station position is used as the calibrated reachable post station position;

[0022] If it is determined that the i-th unreachable post station location does not have the reachability within the preset moving distance limit and the moving number limit, the i-th unreachable post station location is abandoned.

[0023] The method for generating route map data described in the embodiment of the present application, wherein determining the connected post station locations of each legal post station location comprises:

[0024] Determine whether there are edge-adjacent station positions above, below, to the left, and to the right of the j-th legal station position, 1≤j≤J, where J is the total number of legal station positions;

[0025] If the edge-adjacent post stations all exist, a path-finding algorithm is used to determine the connection distance between the j-th legal post station and each edge-adjacent post station;

[0026] The edge adjacent post station position whose connection distance is less than a predetermined connection distance threshold is used as the connection post station position.

[0027] The method for generating path-finding map data according to the embodiment of the present application further includes:

[0028] If there is no edge-adjacent station position above, below, to the left or to the right of the j-th legal station position, determine whether there is a point-adjacent station position on the two vertices corresponding to the grid edge where there is no edge-adjacent station position;

[0029] If there are adjacent post stations of the point, the path finding algorithm is used to determine the connection distance between the j-th legal post station and the adjacent post stations of each point;

[0030] The point adjacent post station positions whose connection distance is less than a predetermined connection distance threshold are taken as the connection post station positions.

[0031] In a second aspect, an embodiment of the present application further provides a pathfinding method, the method comprising:

[0032] When the distance between the acquired path starting point and the path ending point is greater than a preset path finding distance threshold, a path finding algorithm is used to determine the path between the path starting point and the path ending point based on the path starting point, the path ending point and the path finding map data, and the path finding map data is generated using the path finding map data generation method described in the embodiment of the present application.

[0033] In a third aspect, the present application also provides a device for generating route map data, the device comprising:

[0034] A map segmentation module is used to segment the scene map into multiple grids according to a predetermined segmentation unit, wherein the center coordinates of each grid are used as a station location;

[0035] A legal determination module, used for determining legal and reachable post locations from all post locations;

[0036] A connectivity determination module, used to determine the connectivity station location of each legal station location;

[0037] A map determination module is used to determine the route map data according to all the legal post station locations and all the connected post station locations.

[0038] In a fourth aspect, an embodiment of the present application further proposes a terminal device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the method for generating routing map data and / or the routing method described in the embodiment of the present application are executed.

[0039] In a fifth aspect, an embodiment of the present application further proposes a readable storage medium storing a computer program, which, when running on a processor, executes the path-finding map data generation method described in the embodiment of the present application and / or the path-finding method described in the embodiment of the present application.

[0040] The present application proposes a method for generating pathfinding map data, which divides a scene map into multiple grids according to a predetermined segmentation unit, wherein the center coordinates of each grid are used as a post station; a legal post station position with accessibility is determined from all post station positions; a connected post station position of each legal post station position is determined; and pathfinding map data is determined based on all the legal post station positions and all the connected post station positions. The pathfinding map data determined by this method can reduce the amount of pathfinding calculations, shorten the pathfinding time, and enhance the user's gaming experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope of protection of the present invention. In each of the drawings, similar components are numbered similarly.

[0042] Figure 1 A schematic diagram showing a flow chart of a method for generating path-finding map data proposed in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of multiple grids after segmentation proposed in an embodiment of the present application is shown;

[0044] Figure 3 A schematic diagram of a grid corresponding to a pathfinding algorithm proposed in an embodiment of the present application is shown;

[0045] Figure 4 A schematic diagram of a process for determining the location of a legal post station in a method for generating route map data proposed in an embodiment of the present application is shown;

[0046] Figure 5 A schematic diagram of multiple calibration directions proposed in an embodiment of the present application is shown;

[0047] Figure 6 A schematic diagram of the process of a route-finding map data generating device proposed in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0048] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0049] The components of the embodiments of the present invention generally described and shown in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0050] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present invention, are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.

[0051] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0052] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present invention belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present invention.

[0053] Example 1

[0054] See also Figure 1 In one embodiment of the present application, a method for generating path-finding map data is proposed. The method is applied to a game terminal, which can reduce the amount of path-finding calculation and shorten the path-finding time. Exemplarily, the method includes the following steps:

[0055] Step S100, dividing the scene map into a plurality of grids according to a predetermined division unit, wherein the center coordinates of each grid serve as a station location.

[0056] The scene in the scene map can be a large game scene, for example, a game scene with a scene size (length*width*height) greater than 8192M*8192M*8192M. The scene map is a map corresponding to a game scene with a size (length*width*height) greater than 8192M*8192M*8192M.

[0057] The segmentation unit can be 128M or 64M. If the segmentation unit is 128M, a 8192M*8192M*8192M scene map will be segmented into 64*64 grids. The center coordinates of each grid can be used as a post station. Figure 2 shown.

[0058] Step S200: determining a legal and reachable station location from all station locations.

[0059] In this embodiment, one implementation method is to pre-select a target station location, and use the Dijkstra algorithm, A* algorithm, and JPS algorithm to determine whether each station location is reachable from the target station location, and regard the reachable station location as a legal station location, and regard the unreachable station location as an illegal station location.

[0060] For example, see Figure 3 , A is the target station location. If station location B is reachable from target station location A, the path-finding algorithm can search for at least one route from target station location A to station location B. If station location B is not reachable from target station location A, the path-finding algorithm cannot search for a route from target station location A to station location B.

[0061] However, the above-mentioned legal post station location judgment process needs to calculate whether the other post station locations in all the post station locations are reachable from the target post station location. This calculation process is relatively large. In order to reduce the amount of calculation, in another implementation of this embodiment, the post station locations that do not meet the screening conditions are deleted from all the post station locations using preset screening conditions to obtain the remaining post station locations, and then the path finding algorithm is used to determine whether each of the remaining post station locations is reachable based on the target post station location, and the post station locations with reachability are used as legal post station locations.

[0062] It can be understood that, under normal circumstances, a station location with a coordinate value in the height direction that is too high may be a mountain point, and a station location with a coordinate value in the height direction that is too low may be a depression point. Mountain points and depression points can be regarded as illegal station locations. Furthermore, the preset screening condition can be to delete the station locations whose coordinate values ​​in the height direction are not within the predetermined height range from all station locations.

[0063] It can be understood that, generally speaking, when finding a route, edge post locations at the edge of the map are generally considered to be illegal post locations. Therefore, the preset screening condition can also be to delete, from all the post locations, those post locations whose distance to the predetermined edge post location is less than a predetermined edge distance threshold.

[0064] Furthermore, considering that the path-finding algorithm itself has certain errors, the inaccessible station location may become a reachable station location as long as the inaccessible station location is slightly moved. In this embodiment, a process for determining legal points is also provided, that is, after determining the inaccessible station location, each inaccessible station location is calibrated, and the station location that is reachable after calibration is used as a calibrated reachable station location; finally, each of the directly reachable station location and the calibrated reachable station location is used as the legal station location.

[0065] Based on the above implementation mode, preferably, see Figure 4 In this embodiment, the step S200 includes the following steps S210 to S240:

[0066] Step S210, using the preset screening condition to delete the station positions that do not meet the screening condition from all the station positions to obtain the remaining station positions.

[0067] Step S220: Determine whether each of the remaining post locations is reachable based on the target post location by using a pathfinding algorithm, so as to determine directly reachable post locations and unreachable post locations from the remaining post locations.

[0068] Step S230, calibrate each unreachable post station location, and use the post station location that is reachable after calibration as a calibrated reachable post station location.

[0069] The i-th unreachable post station position can be moved multiple times according to preset multiple calibration directions and calibration moving distances. After each move, the path-finding algorithm is used to determine whether the i-th unreachable post station position has the reachability based on the target post station position, 1≤i≤I, I is the total number of the unreachable post station positions; if it is determined that the i-th unreachable post station position has the reachability within a preset moving distance limit or a moving number limit, the i-th unreachable post station position is used as the calibrated reachable post station position; if it is determined that the i-th unreachable post station position does not have the reachability within the preset moving distance limit and the moving number limit, the i-th unreachable post station position is abandoned.

[0070] Among them, Figure 5 As shown, the multiple calibration directions include at least one direction of left 1, upper left 2, upper 3, upper right 4, right 5, lower right 6, lower 7, and lower left 8.

[0071] The calibration moving distance may be 1 / 8, 1 / 10, 1 / 12, etc. of the division unit.

[0072] The moving distance limit may be 1 / 2, 1 / 3, 1 / 4, etc. of the segmentation unit.

[0073] Among them, the limit of the number of moves can be 3 times, 4 times, 5 times, etc.

[0074] Step S240: taking each of the directly reachable station site and the calibrated reachable station site as the legal station site.

[0075] The steps S210 to S240 can improve the efficiency of determining the legal station locations and can effectively reduce the determination error of the legal station locations.

[0076] Step S300, determining the connected post locations of each legal post location.

[0077] In order to ensure that the routing efficiency meets the predetermined requirements, in this embodiment, it can be determined whether there are edge-adjacent station positions above, below, left and right of the j-th legal station position, 1≤j≤J, J is the total number of the legal station positions; if the edge-adjacent station positions exist, the routing algorithm is used to determine the connection distance between the j-th legal station position and each edge-adjacent station position; the edge-adjacent station position whose connection distance is less than the predetermined connection distance threshold is used as the connected station position.

[0078] The legal stations can be located above, below, to the left, and to the right as follows: Figure 5 As shown, the top is 3, the bottom is 7, the left is 1, and the right is 5. The side-adjacent station positions above, below, left, and right of the legal station position are D, E, F, and G respectively.

[0079] It should be noted that if a legal post station location and the surrounding post station locations have a tendency, that is, the surrounding post station locations are not located to the left, upper left, above, upper right, right, lower right, below, and lower left of the legal post station location, then it is necessary to determine the post station locations above, below, left, and right based on the edges of the grid corresponding to the legal post station location, that is, the post station locations corresponding to the grids adjacent to the edges are edge-adjacent post station locations.

[0080] It can be understood that the connection distance threshold can avoid too many connection stations being searched during path finding, thereby improving path finding efficiency.

[0081] It can be understood that if there are edge-adjacent post locations above, below, to the left, and to the right of a legal post location, it means that the above, below, to the left, and to the right of the legal post location are all walkable, and there is no need to determine whether other directions are walkable.

[0082] Furthermore, if there is no edge-adjacent station location above, below, left or right of the j-th legal station location, determine whether there are point-adjacent station locations on the two vertices corresponding to the grid edge where the edge-adjacent station location does not exist; if there are point-adjacent station locations, use the pathfinding algorithm to determine the connectivity distance between the j-th legal station location and each point-adjacent station location; and take the point-adjacent station location whose connectivity distance is less than a predetermined connectivity distance threshold as the connectivity station location.

[0083] Step S400, determining the route map data according to all the legal post locations and all the connected post locations.

[0084] The path-finding map data is determined according to the positions of all the legal post stations before calibration, the positions of the calibrated reachable post stations and the positions of all the connected post stations.

[0085] Exemplarily, a piece of data in the path-finding map data may be {(187,187), (180,180), (62,187), (62,312), (187,312), (312,312), (312,187), (312,62), (187,62)}, wherein (187,187) is a legal station location before calibration, (180,180) is a legal station location that can be reached after calibration, and (62,187), (62,312), (187,312), (312,312), (312,187), (312,62), (187,62) are the station locations to the left, upper left, upper part, upper right, right, lower right, lower part, and lower left of the legal station location, respectively.

[0086] It can be understood that there is no calibrated reachable post station position, which can be recorded as a null value, for example, {(187,187), (62,187), (62,312), (187,312), (312,312), (312,187), (312,62), (187,62)}.

[0087] There is no station position on the left, upper left, upper part, upper right, right, lower right, lower part or lower left, and it can also be recorded as a null value.

[0088] In this embodiment, the scene map is divided into multiple grids according to a predetermined division unit, wherein the center coordinates of each grid are used as a post station; a legal post station with accessibility is determined from all post stations; a connected post station position of each legal post station is determined; and path finding map data is determined based on all the legal post stations and all the connected post stations. The path finding map data determined by this method can reduce the amount of path finding calculations, shorten the path finding time, and enhance the user's gaming experience.

[0089] Example 2

[0090] The second embodiment of the present application proposes a pathfinding method, which includes: when the distance between the acquired path starting point and the path ending point is greater than a preset pathfinding distance threshold, using a pathfinding algorithm to determine the path between the path starting point and the path ending point based on the path starting point, the path ending point and the pathfinding map data, and the pathfinding map data is generated using the pathfinding map data generation method described in the above-mentioned embodiment 1.

[0091] Example 3

[0092] See also Figure 6 The third embodiment of the present application proposes a route-finding map data generating device 10, which includes: a map segmentation module 11, a legality determination module 12, a connectivity determination module 13 and a map determination module 14.

[0093] The map segmentation module 11 is used to segment the scene map into multiple grids according to a predetermined segmentation unit, wherein the central coordinates of each grid are used as a station location; the legal determination module 12 is used to determine the legal station locations with accessibility from all the station locations; the connectivity determination module 13 is used to determine the connectivity station locations of each legal station location; the map determination module 14 is used to determine the path finding map data based on all the legal station locations and all the connectivity station locations.

[0094] In this embodiment, the routing map data generating device 10 is used to execute the routing map data generating method described in the above embodiment through the coordinated use of the map segmentation module 11, the legal determination module 12, the connectivity determination module 13 and the map determination module 14. The implementation scheme and beneficial effects involved in the above embodiment are also applicable in this embodiment and will not be repeated here.

[0095] Example 4

[0096] The fourth embodiment of the present application proposes a terminal device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, it executes the above-mentioned method for generating routing map data and / or the routing method described in the above-mentioned embodiments.

[0097] Example 5

[0098] The fifth embodiment of the present application proposes a readable storage medium storing a computer program, which, when running on a processor, executes the path-finding map data generation method described in the above embodiment and / or the path-finding method described in the above embodiment.

[0099] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow chart, and the combination of boxes in the structure diagram and / or the flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0100] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

[0101] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned readable storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0102] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for generating path-finding map data, characterized in that: The method comprises: The scene map is divided into multiple grids according to the predetermined division units, wherein the center coordinates of each grid are used as a post station location; Determine the legal and reachable post locations from all post locations; Determine the connected post locations of each legal post location; Determine the route map data according to all the legal post locations and all the connected post locations; The step of determining a legal and reachable station location from all station locations includes: Deleting the station locations that do not meet the screening conditions from all the station locations by using the preset screening conditions to obtain the remaining station locations; Determine whether each of the remaining post locations is reachable based on the target post location by using a pathfinding algorithm, so as to determine directly reachable post locations and unreachable post locations from the remaining post locations; Calibrate each unreachable post station position, and take the post station position that is reachable after calibration as the calibrated reachable post station position; Each of the directly reachable post station positions and the calibrated reachable post station positions is regarded as the legal post station position.

2. The method for generating path-finding map data according to claim 1, characterized in that: The determining of the route map data according to all the legal post station locations and all the connected post station locations includes: The path-finding map data is determined according to the uncalibrated post station positions, the calibrated reachable post station positions and all the connected post station positions corresponding to all the legal post station positions.

3. The method for generating path-finding map data according to claim 1, characterized in that: The method of using the preset screening conditions to delete the station locations that do not meet the screening conditions from all the station locations includes: Deleting the station positions whose coordinate values ​​in the height direction are not within the predetermined height range from all the station positions; And / or, the post station positions whose distances to the predetermined edge post station positions are less than a predetermined edge distance threshold are deleted from all the post station positions.

4. The method for generating route map data according to claim 1, characterized in that: The step of calibrating each unreachable post station position and taking the post station position that is reachable after calibration as a calibrated reachable post station position includes: Move the i-th unreachable post station position multiple times according to the preset multiple calibration directions and calibration moving distances, and after each movement, determine whether the i-th unreachable post station position has the reachability based on the target post station position using the path finding algorithm, 1≤i≤I, I is the total number of the unreachable post station positions; If it is determined that the i-th inaccessible post station position has the reachability within the preset moving distance limit or moving number limit, the i-th inaccessible post station position is used as the calibrated reachable post station position; If it is determined that the i-th unreachable post station location does not have the reachability within the preset moving distance limit and the moving number limit, the i-th unreachable post station location is abandoned.

5. The method for generating path-finding map data according to claim 1, characterized in that: Determining the connected post location of each legal post location includes: Determine whether there are edge-adjacent station positions above, below, to the left, and to the right of the j-th legal station position, 1≤j≤J, where J is the total number of legal station positions; If the edge-adjacent post stations all exist, a pathfinding algorithm is used to determine the connection distance between the j-th legal post station and each edge-adjacent post station; The edge adjacent post station position whose connection distance is less than a predetermined connection distance threshold is used as the connection post station position.

6. The method for generating route map data according to claim 5, characterized in that: Also includes: If there is no edge-adjacent station position above, below, to the left or to the right of the j-th legal station position, determine whether there is a point-adjacent station position on the two vertices corresponding to the grid edge where there is no edge-adjacent station position; If there are adjacent post stations of the point, the path finding algorithm is used to determine the connection distance between the j-th legal post station and the adjacent post stations of each point; The point adjacent post station positions whose connection distance is less than a predetermined connection distance threshold are taken as the connection post station positions.

7. A path finding method, characterized in that: The method comprises: When the distance between the acquired path starting point and the path ending point is greater than a preset path finding distance threshold, a path finding algorithm is used to determine the path between the path starting point and the path ending point based on the path starting point, the path ending point and the path finding map data, and the path finding map data is generated using the path finding map data generation method described in any one of claims 1 to 6.

8. A device for generating route map data, characterized in that: The device comprises: A map segmentation module is used to segment the scene map into multiple grids according to a predetermined segmentation unit, wherein the center coordinates of each grid are used as a station location; A legal determination module, used for determining legal and reachable post locations from all post locations; A connectivity determination module, used to determine the connectivity station location of each legal station location; A map determination module, used to determine the route map data according to all the legal post station locations and all the connected post station locations; Wherein, the legal determination module includes: A deleting unit, used to delete the station locations that do not meet the screening conditions from all the station locations by using the preset screening conditions to obtain the remaining station locations; a determining unit, configured to determine whether each of the remaining post locations is reachable based on the target post location by using a pathfinding algorithm, so as to determine directly reachable post locations and unreachable post locations from the remaining post locations; A calibration unit, used for calibrating each unreachable post station position, and taking the post station position that is reachable after calibration as a calibrated reachable post station position; The legal determination unit is used to take each of the directly reachable station site and the calibrated reachable station site as the legal station site.

9. A terminal device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is run on the processor, it executes the path-finding map data generating method according to any one of claims 1 to 6 and / or the path-finding method according to claim 7.

10. A readable storage medium, characterized in that: It stores a computer program, which, when running on a processor, executes the path-finding map data generation method described in any one of claims 1 to 6 and / or the path-finding method described in claim 7.

Citation Information

Patent Citations

  • Path finding method and device based on game scene, equipment and medium

    CN112619150A