WO2009092327A1 - Map path seeking method and system - Google Patents

Map path seeking method and system Download PDF

Info

Publication number
WO2009092327A1
WO2009092327A1 PCT/CN2009/070182 CN2009070182W WO2009092327A1 WO 2009092327 A1 WO2009092327 A1 WO 2009092327A1 CN 2009070182 W CN2009070182 W CN 2009070182W WO 2009092327 A1 WO2009092327 A1 WO 2009092327A1
Authority
WO
WIPO (PCT)
Prior art keywords
path
area
map
finding
path finding
Prior art date
Application number
PCT/CN2009/070182
Other languages
French (fr)
Chinese (zh)
Inventor
Chao Peng
Original Assignee
Tencent Technology (Shenzhen) Company Limited
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 Tencent Technology (Shenzhen) Company Limited filed Critical Tencent Technology (Shenzhen) Company Limited
Publication of WO2009092327A1 publication Critical patent/WO2009092327A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • G06Q10/047Optimisation of routes or paths, e.g. travelling salesman problem

Definitions

  • the present invention relates to network information acquisition technology, and in particular to a map path finding method and system. Background of the invention
  • A* path finding technology is an artificial intelligence technology widely used by people.
  • A* path finding technology implements a heuristic search, which is to evaluate each time using a valuation function for each decision. The value of a program, which in turn determines the solution that needs to be tried first.
  • the so-called heuristic search is to select a heuristic function when the current search node selects the next node downward, and select the node with the least cost, such as the node closest to the current node, and jump to the selected node. On the node, the selected node continues to search as the current search node until it reaches the target node.
  • the commonly used path finding methods in 3D scenes are: A* path finding method based on triangle face and A* two layer path finding method.
  • the triangle-based A* pathfinding method first sets an Open Table that stores all the probed but unsearched nodes, and a Close Table that stores the searched nodes.
  • each node is added to the Open Table as the current node. If the target node is not reached and the Open Table is not empty, each possible node is searched for its possible child node one by one. And calculate the valuation of each child node.
  • the current node is placed in the Close Table, and the new current node is selected from the estimated child nodes, and then the new current node is searched for its possible The child nodes, and calculate the valuation of each child node, and so on, until the path found is output.
  • A* two-layer pathfinding method a low-density diamond mesh is created on the map, and the center point of the diamond mesh is fixedly selected as the waypoint.
  • the macro pathfinding method is first used to determine the rough path, and then in each path.
  • Micro-path finding is used on the path, but the search node used in the path-finding process is the center point of the grid. It has certain limitations in the scope of application. It can only process maps of two-dimensional shape rules, but not for maps. 2D or 3D irregularly shaped maps. Summary of the invention
  • An embodiment of the present invention provides a method for searching for a map, including:
  • path finding is performed based on the area to obtain a regional path
  • a triangle-based path finding is performed to generate a final path.
  • the embodiment of the invention further provides a map path finding system, comprising:
  • a region generating module configured to divide the plane map into at least two equal-sized regions
  • a waypoint generating module configured to determine a waypoint on a boundary of the region
  • the path finding module is configured to perform path finding based on the area, obtain a regional path, and perform a path based on the triangular face according to the regional path to generate a final path.
  • the map finding method and system provided by the embodiment of the present invention divides the planar map to be processed into a plurality of equal-sized regions in advance, and generates a waypoint on the boundary of the region; when searching for a path, first performs path-finding based on the region After obtaining the regional path, the triangle-based pathfinding is further used in the specific scenario according to the determined regional path to generate a final moving path. Therefore, the embodiments of the present invention have the following advantages and features:
  • the path is first searched based on the area, and then the waypoint is performed based on the road points involved in the determined area.
  • the A* path finding algorithm is also used, the first path finding is based on the area.
  • the search node is equivalent to one area.
  • the second path-finding only involves the range covered by the determined area path. There are no more unrelated nodes. Obviously, the path-finding process greatly reduces the storage space required and reduces the storage space. Space overhead.
  • the second-level path-finding method adopted by the present invention the first level first performs rough pathfinding by region, and narrows the search range; the second level performs fine path finding one by one based on the determined regions, according to the triangular face-based
  • the way to find the way, to obtain the final moving path is equivalent to the high-density triangular surface thinning of 4 bar, sharing the time and space overhead, effectively reducing the space-time complexity of the entire path-finding process, and greatly improving the path-finding efficiency. .
  • the location of the road points is related to the shape of the map, so the present invention can be applied to processing maps of various shapes, for example, there is no A map of connected areas, etc., has a wider range of applications and is more practical.
  • the waypoint obtains the focus of the edge of the divided area and the edge of the polygon map, and can dynamically generate the waypoint instead of being fixed, so that the implementation is more flexible, convenient, and the actual path. Closer, the resulting moving path is more accurate.
  • FIG. 1 is a schematic diagram of a general implementation flow of a method for searching for a map in an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a 3D scene map projected onto a plane
  • 3 is a schematic diagram of dividing the map shown in FIG. 2 into a navigation grid
  • Figure 4 is a schematic view of the map shown in Figure 2 after determining the waypoint;
  • FIG. 5 is a schematic diagram of an implementation process of generating a navigation grid according to an embodiment of the present invention
  • FIG. 6a to FIG. 6g are schematic diagrams of implementation processes of an embodiment of the present invention. Mode for carrying out the invention
  • the planar map to be processed is divided into at least two equal-sized regions in advance, and the waypoints of the region are determined on the boundary of each region; when path finding is required, the region is first searched The road obtains the regional path from the starting point to the ending point; after that, based on the obtained regional path, the triangular path based path finding is used to generate the final path.
  • Each area may be referred to as a navigation grid.
  • the road point of the area is the midpoint of the line segment where each side of the navigation grid coincides with the plane map, and all the way points on each side of each navigation grid constitute the navigation grid.
  • the area path is to treat each navigation grid as a point, first determine all the navigation grids from the navigation grid to which the starting point belongs to the navigation grid to which the destination belongs, and then according to the relationship between the navigation grids determined and the navigation grid The entry point, obtain a navigation grid path composed of road points, that is, the area path.
  • the scene corresponding to the planar map to be processed may be a two-dimensional or three-dimensional scene, such as a 3D community map in the game.
  • the map navigation piece of the 3D scene is projected onto the plane, and the obtained polygon plane map is used as the plane map to be processed.
  • the plane map can be directly used as the plane map to be processed.
  • the navigation grid can take different shapes, such as squares, rectangles, hexagons, etc., as long as the regions are equal in size; preferably, the entire planar map is divided into at least two regions of equal size by equally spaced vertical and horizontal lines. Square.
  • FIG. 1 is a schematic diagram showing the overall implementation process of a map path finding method in an embodiment of the present invention.
  • the map path finding method in the embodiment of the present invention includes the following steps. Step 101: Acquire a plane map to be processed in advance, and divide the acquired plane map into at least two navigation grids of equal size.
  • a map corresponding to a 3D scene of a plane map such as a community map in a game
  • Fig. 2 is a multi-plane map obtained by projecting a 3D community map navigation piece onto a plane.
  • the plane map may be divided in different manners, and the divided navigation grids may have different shapes, as long as the area corresponding to each navigation grid is equal.
  • the polygon is divided into a plurality of squares by equally spaced vertical and horizontal lines, as shown in Fig. 3, and Fig. 3 is a plane map of Fig. 2 divided into equal-sized squares.
  • Step 102 Predetermine a sequence of waypoints corresponding to each navigation grid, and establish and save a connection relationship between each waypoint in each route sequence.
  • the midpoint of the line segment that coincides with a plane of the navigation map and the plane map is determined as the waypoint of the navigation grid.
  • Fig. 4 is a map after the map shown in Fig. 2 is determined.
  • the black points in Figure 4 are waypoints, and all waypoints on each side of the navigation grid form a sequence of waypoints for the navigation grid.
  • a structure or a data structure is created for each navigation grid, and the structure includes related information of the navigation grid and its corresponding waypoint sequence.
  • the connectivity relationship between the various waypoints in the sequence of the waypoints can be established based on the pathfinding based on the triangular faces.
  • the preservation of the connected relationship can be realized by using the collected data structure.
  • the so-called parallel check refers to a number of disjoint sets, which can realize the operations of faster merging, judging the set of elements, and the like, mainly involving merging and searching of the set.
  • steps 101 and 102 are performed in advance before the path finding, and only need to be performed once, and need not be performed before each path finding.
  • Step 103 When a pathfinding is required, a navigation grid based A* path finding is used to obtain a navigation path. Specifically, when path finding is needed, the coordinate positions of the start point and the end point are first obtained, and the navigation grid to which the start point and the end point belong respectively can be located according to the coordinate position; after that, the navigation grid is used as the unit point, and the start navigation grid is the starting point. Terminate the navigation grid as the end point and perform A* path finding.
  • the A* pathfinding process based on the navigation grid includes the following steps:
  • A. Construct an Open table, according to the connection relationship between the pre-established waypoints, access the adjacent navigation grid reachable by the starting navigation grid, and put the two-group ⁇ navigation grid, entry point> as an element into the table.
  • the adjacent navigation grids reachable by the starting navigation grid need to call the prior art triangle-based path finding to determine the direction of expansion.
  • step E If the current navigation grid is equal to the destination navigation grid, the pathfinding ends, and step E is performed; otherwise, step D is performed;
  • Step 104 Perform a triangle-based A* path finding according to the obtained navigation grid path to generate a final moving path.
  • the navigation grid path obtained in step 103 is a rough path composed of waypoints and cannot be directly used as a basis for movement.
  • the A* path finding based on the triangular surface is further adopted to obtain a refined moving path.
  • the divided area is referred to as a navigation grid because each navigation grid corresponds to a navigation area, and has a navigation function, that is, adjacent navigation grids have an association relationship.
  • a process of generating a navigation grid in the embodiment of the present invention is as shown in the figure. As shown in 5, the following steps are included:
  • Step 501 Determine coordinates of the upper left corner of the current navigation grid
  • the map has a certain coordinate range, and the size of each navigation grid is known at the time of division, according to the coordinates of the upper left corner of the navigation grid, the position of the navigation grid in the map can be determined, and the boundary of the navigation grid and the map can also be determined. relationship.
  • Step 502 Obtain a right navigation road boundary point and a lower boundary road point of the current navigation grid
  • step 503 it is not necessary to obtain the waypoints of the upper and left boundaries of the current navigation grid.
  • the waypoints on the common edge can be shared by the two navigation grids.
  • step 503 By extracting the waypoint on the right border of the left navigation grid and the waypoint on the lower boundary of the upper navigation grid in step 503, the upper boundary of the current navigation grid and the waypoint on the left boundary can be directly obtained. In this way, the efficiency of obtaining navigational waypoints is improved, and the complexity of the operation is reduced.
  • Step 503 Set the association between the current navigation grid and the navigation bar on the left side and the navigation grid on the left side, and obtain the waypoints on the upper boundary and the left boundary;
  • the waypoints of the upper navigation grid and the left navigation grid have been acquired and acquired.
  • the current navigation grid can be obtained.
  • the waypoints on the boundary and the left border are the waypoints on the boundary and the left border.
  • Step 504 Generate a sequence of waypoints of the current navigation grid, and establish a connection relationship between the road points.
  • the sequence of waypoints is a set of all waypoints on each boundary of the current navigation grid; the establishing the connection relationship between the respective waypoints is implemented by a triangle-based A* pathfinding method.
  • the method for generating the navigation grid shown in Figure 5 is to generate a navigation grid from the upper left corner to the right and down.
  • the navigation grid can also be generated from the upper right corner to the left and down, or from the lower left corner to the right.
  • the processing is similar. Just replace the angular coordinates and boundaries selected in the above steps, for example: Determine the coordinates of the upper right corner, get the left and lower road points, and so on.
  • the polygon map is divided into at least two squares by using equal-space vertical and horizontal lines in advance, and the sequence of road points corresponding to each navigation grid is determined, and each road point sequence in each road point sequence is established and saved. Connectivity.
  • Figures 6a through 6g show the process of implementing map path finding in this embodiment.
  • the starting point for the path finding is S point
  • the ending point is T point.
  • the black points in the figure are waypoints.
  • the S and T points are respectively represented by a five-pointed star, and the gray-filled square is the searched square node.
  • Figure 6a shows the initial state, and the path finding process from point S to point T is as follows.
  • Step 11 Positioning starting point S and ending point T
  • the navigation grid to which T belongs is Gs and Gt, respectively, as shown in Figure 6b.
  • Step 12 Perform A* pathfinding, expand the navigation grid GO according to the waypoint that S point can reach, and put the GO into the priority queue, as shown in Figure 6c.
  • the navigation grid GO is the navigation grid expanded from the first navigation grid Gs. How to determine the extension direction of the initial navigation grid Gs can be determined according to the existing triangle-based A* pathfinding technique. Specifically, in the embodiment, for the navigation grid Gs, according to the A* path finding based on the triangular surface, the starting point S can only move to the left, and the right side is not connected, so the navigation grid GO is extended from the navigation grid Gs to the left. If you can move from the starting point S to the left and right sides, according to the A* path finding technique, you can expand a navigation grid from the navigation grid Gs to the left and right, and then continue to perform A* path finding based on the navigation grid. .
  • Step 13 Based on the A* path finding technique, expand the navigation grids Gl, G2, and G3 from the navigation grid GO, as shown in Figure 6d.
  • Step 14 According to the heuristic search rule, that is, according to the distance to the navigation grid Gt, the navigation grid G1 is preferentially extended, and the navigation grid G4 is obtained, as shown in Fig. 6e.
  • Step 15 According to the same principle as step 14, the navigation grid G4 is extended to obtain the navigation grid G5, and then reaches Gt, as shown in Fig. 6f. At this point, it is determined that Gs, G0, Gl, G4, G5, and Gt are all navigation grids of the navigation path path.
  • Step 16 According to the association relationship between each navigation grid and the entry point, a route sequence is generated, and then the navigation path from S point to T point is obtained.
  • Gs is adjacent to GO, and the entry point of Gs to GO is point 1; GO is adjacent to G1, and the entry point of GO to G1 is point 2; G1 and G4 are adjacent to each other.
  • the entry point of G1 to G4 is point 3; G4 is adjacent to G5, the entry point of G4 to G5 is point 4; G5 is adjacent to Gt, and the entry point of G5 to Gt is point 5, therefore, generated
  • the sequence of waypoints is ⁇ S, 1, 2, 3, 4, 5, T ⁇ , and the obtained navigation grid path is S 1 2 3 4 5 T.
  • the sections between the road points are long. path.
  • Step 17 During the movement, according to the obtained navigation grid path, a triangle-based A* pathfinding is performed to generate a final moving path.
  • an embodiment of the present invention further provides a map path finding system, including: an area generating module, a waypoint management module, and a path finding module.
  • the area generation module is configured to divide the plane map into at least two equal-sized areas.
  • the waypoint generating module is configured to obtain, as a waypoint, a midpoint of a line segment in which each side of the area coincides with the plane map for each of the divided regions, generate a waypoint sequence for the waypoints in each of the regions, and establish a sequence of the waypoints The connection between the waypoints.
  • the path finding module is used for path finding using A* path finding technology, and further includes an area finding module and a triangle face finding module.
  • the regional path-finding module uses A* path-finding technology to find paths in the area, and determines an area path composed of road points according to the area of the route and the entry point between the areas; the triangular surface finding module, in the moving process Medium, based on the regional path, performs a triangle-based A* pathfinding to obtain the final moving path.

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Navigation (AREA)

Abstract

A map path seeking method and system are disclosed. The method includes: dividing a plane map into at least two regions which are equivalent in size in advance, and determining points of path on borders of the region; when the path seeking being required, performing the path seeking based on the region, and acquiring a region path; according to the region path, performing triangular plane-based path seeking, and generating a final path.

Description

一种地图寻路方法及系统 技术领域  Map searching method and system
本发明涉及网络信息获取技术, 特别涉及一种地图寻路方法及系 统。 发明背景  The present invention relates to network information acquisition technology, and in particular to a map path finding method and system. Background of the invention
随着网络游戏的不断发展, 在基于三维(3D )场景的游戏中, 经常 需要实现虚拟物体在场景中的移动, 从而涉及到在场景对应的地图中寻 路的问题。 在地图寻路技术中, A*寻路技术是一种被人们广泛使用的人 工智能技术, A*寻路技术实现了一种启发式搜索, 就是在每次决策时, 利用一个估价函数评估每个方案的价值, 从而决定需要先尝试的方案。 具体而言, 所谓启发式搜索, 就是在当前搜索节点向下选择下一步节点 时, 通过一个启发函数来进行选择, 选择代价最少的节点, 如距离当前 节点最近的节点, 并跳转到选定的节点上, 将选定的节点作为当前搜索 节点继续搜索, 直到到达目标节点。  With the continuous development of online games, in games based on three-dimensional (3D) scenes, it is often necessary to realize the movement of virtual objects in the scene, thereby involving the problem of finding paths in the map corresponding to the scene. In map finding technology, A* path finding technology is an artificial intelligence technology widely used by people. A* path finding technology implements a heuristic search, which is to evaluate each time using a valuation function for each decision. The value of a program, which in turn determines the solution that needs to be tried first. Specifically, the so-called heuristic search is to select a heuristic function when the current search node selects the next node downward, and select the node with the least cost, such as the node closest to the current node, and jump to the selected node. On the node, the selected node continues to search as the current search node until it reaches the target node.
目前, 3D场景中常用的寻路方法有: 基于三角面的 A*寻路方法、 A*二层寻路方法。 具体来说, 基于三角面的 A*寻路方法先要设置存放 所有已探知但未搜索过的节点的打开表(Open Table ), 以及存放已搜索 过的节点的关闭表(Close Table )。 开始寻路时, 自起始节点起, 将每个 节点作为当前节点加入 Open Table, 在未到达目标节点且 Open Table表 非空的情况下, 逐一针对每个当前节点寻找其可能的子节点, 并计算每 个子节点的估值。 估算完毕后, 将当前节点放入 Close Table, 并从已估 算的子节点中选择新的当前节点, 之后再针对新的当前节点寻找其可能 的子节点, 并计算每个子节点的估值, 如此反复, 直到输出找到的路径 为止。 从上述处理过程可以看出, 在基于三角面寻路时, 当一个场景对 应的地图由大量密集的三角面组成时, 如果起始节点距离目标节点很 远, 由于要存储每个已探知或已搜索过的节点, 那么, 搜索空间中就需 要保存大量扩展出来的节点, 空间开销会特别巨大, 而其中有很多节点 实际是无关节点,如此, 不仅占用了大量不必要的空间开销,造成浪费; 且会严重影响寻路的效率。 At present, the commonly used path finding methods in 3D scenes are: A* path finding method based on triangle face and A* two layer path finding method. Specifically, the triangle-based A* pathfinding method first sets an Open Table that stores all the probed but unsearched nodes, and a Close Table that stores the searched nodes. When starting the pathfinding, starting from the starting node, each node is added to the Open Table as the current node. If the target node is not reached and the Open Table is not empty, each possible node is searched for its possible child node one by one. And calculate the valuation of each child node. After the estimation is completed, the current node is placed in the Close Table, and the new current node is selected from the estimated child nodes, and then the new current node is searched for its possible The child nodes, and calculate the valuation of each child node, and so on, until the path found is output. As can be seen from the above process, when the map corresponding to a scene is composed of a large number of dense triangular faces when searching based on triangular faces, if the starting node is far away from the target node, since each of the detected or already Searched nodes, then, the search space needs to save a large number of extended nodes, the space overhead will be extremely large, and many of them are actually unrelated nodes, thus not only occupying a lot of unnecessary space overhead, resulting in waste; And will seriously affect the efficiency of pathfinding.
至于 A*二层寻路方法, 主要是在地图上创建一个低密度的菱形网 格, 固定选取菱形网格的中心点作为路点, 先采用宏观寻路方法确定粗 略路径, 然后在每一段路径上使用微观寻路, 但这种方法在寻路过程中 采用的搜索节点是网格的中心点, 在适用范围上具有一定的局限性, 只 能处理二维形状规则的地图, 而不能用于二维或三维不规则形状的地 图。 发明内容  As for the A* two-layer pathfinding method, a low-density diamond mesh is created on the map, and the center point of the diamond mesh is fixedly selected as the waypoint. The macro pathfinding method is first used to determine the rough path, and then in each path. Micro-path finding is used on the path, but the search node used in the path-finding process is the center point of the grid. It has certain limitations in the scope of application. It can only process maps of two-dimensional shape rules, but not for maps. 2D or 3D irregularly shaped maps. Summary of the invention
本发明实施例提供了一种地图寻路方法, 包括:  An embodiment of the present invention provides a method for searching for a map, including:
预先将平面地图划分为至少两个大小相等的区域, 并在所述区域的 边界上确定路点;  Dividing the planar map into at least two equal-sized regions in advance, and determining the waypoints on the boundaries of the regions;
当需要寻路时, 基于所述区域进行寻路, 获得区域路径;  When path finding is required, path finding is performed based on the area to obtain a regional path;
根据所述区域路径, 进行基于三角面的寻路, 生成最终路径。  Based on the area path, a triangle-based path finding is performed to generate a final path.
本发明实施例还提供了一种地图寻路系统, 包括:  The embodiment of the invention further provides a map path finding system, comprising:
区域生成模块, 用于将平面地图划分为至少两个大小相等的区域; 路点生成模块, 用于在所述区域的边界上确定路点;  a region generating module, configured to divide the plane map into at least two equal-sized regions; a waypoint generating module, configured to determine a waypoint on a boundary of the region;
寻路模块, 用于基于区域进行寻路, 获得区域路径; 根据所述区域 路径, 进行基于三角面的寻路, 生成最终路径。 本发明实施例所提供的地图寻路方法及系统, 预先将需要处理的平 面地图划分为若干个大小相等的区域, 并在区域的边界上生成路点; 寻 路时, 先基于区域进行寻路, 获得区域路径后, 再进一步根据所确定的 区域路径在具体场景中采用基于三角面的寻路, 生成最终的移动路径。 因此, 本发明实施例具有以下的优点和特点: The path finding module is configured to perform path finding based on the area, obtain a regional path, and perform a path based on the triangular face according to the regional path to generate a final path. The map finding method and system provided by the embodiment of the present invention divides the planar map to be processed into a plurality of equal-sized regions in advance, and generates a waypoint on the boundary of the region; when searching for a path, first performs path-finding based on the region After obtaining the regional path, the triangle-based pathfinding is further used in the specific scenario according to the determined regional path to generate a final moving path. Therefore, the embodiments of the present invention have the following advantages and features:
1 )在本发明实施例中, 先基于区域进行寻路, 再基于所确定区域涉 及到的路点进行寻路, 虽然也是采用 A*寻路算法, 但第一次寻路是以 区域为单位, 搜索节点相当于是一个个区域, 第二次寻路仅涉及已确定 的区域路径涵盖的范围, 不再有大量的无关节点, 显然, 寻路过程中大 大减少了需占用的存储空间, 降低了空间开销。  1) In the embodiment of the present invention, the path is first searched based on the area, and then the waypoint is performed based on the road points involved in the determined area. Although the A* path finding algorithm is also used, the first path finding is based on the area. The search node is equivalent to one area. The second path-finding only involves the range covered by the determined area path. There are no more unrelated nodes. Obviously, the path-finding process greatly reduces the storage space required and reduces the storage space. Space overhead.
2 )本发明采用的二级寻路方式,第一级以区域为单位先做粗略寻路, 将搜索范围缩小; 第二级再基于已确定的区域逐一做精细寻路, 按照基 于三角面的方式进行寻路, 获取最终移动路径, 如此, 相当于 4巴高密度 的三角面稀疏化, 分摊了时间、 空间的开销, 有效降低了整个寻路过程 的时空复杂度, 可大大提高寻路效率。  2) The second-level path-finding method adopted by the present invention, the first level first performs rough pathfinding by region, and narrows the search range; the second level performs fine path finding one by one based on the determined regions, according to the triangular face-based The way to find the way, to obtain the final moving path, is equivalent to the high-density triangular surface thinning of 4 bar, sharing the time and space overhead, effectively reducing the space-time complexity of the entire path-finding process, and greatly improving the path-finding efficiency. .
3 )由于将地图进行了区域划分, 且所采用的路点在区域边界上, 路 点的位置与地图的形状相关, 所以, 本发明可适用于对各种形状的地图 进行处理, 例如存在不连通区域的地图等, 适用范围更广, 实用性更强。  3) Since the map is divided into regions, and the road points used are on the regional boundary, the location of the road points is related to the shape of the map, so the present invention can be applied to processing maps of various shapes, for example, there is no A map of connected areas, etc., has a wider range of applications and is more practical.
4 )本发明中路点获取的是所划分区域的边与多边形地图的边重合线 段的重点, 可以动态生成路点, 而不是固定不变的, 这样, 在实现上更 灵活、 方便, 与实际路径更接近, 所得到的移动路径精确度更高。 附图简要说明  4) In the present invention, the waypoint obtains the focus of the edge of the divided area and the edge of the polygon map, and can dynamically generate the waypoint instead of being fixed, so that the implementation is more flexible, convenient, and the actual path. Closer, the resulting moving path is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
图 1为本发明实施例中地图寻路方法的总体实现流程示意图; 图 2为三维场景地图投影到平面的示意图; 图 3为将图 2所示地图划分为导航格的示意图; 1 is a schematic diagram of a general implementation flow of a method for searching for a map in an embodiment of the present invention; FIG. 2 is a schematic diagram of a 3D scene map projected onto a plane; 3 is a schematic diagram of dividing the map shown in FIG. 2 into a navigation grid;
图 4为图 2所示地图确定路点后的示意图;  Figure 4 is a schematic view of the map shown in Figure 2 after determining the waypoint;
图 5为本发明实施例中一种生成导航格的实现流程示意图; 图 6a至图 6g为本发明实施例的实现过程示意图。 实施本发明的方式  FIG. 5 is a schematic diagram of an implementation process of generating a navigation grid according to an embodiment of the present invention; FIG. 6a to FIG. 6g are schematic diagrams of implementation processes of an embodiment of the present invention. Mode for carrying out the invention
在本发明实施例中, 预先将需要处理的平面地图划分为至少两个大 小相等的区域, 并在每个区域的边界上确定该区域的路点; 当需要寻路 时, 先基于区域进行寻路, 获得从起点到终点的区域路径; 之后, 根据 获得的区域路径, 采用基于三角面的寻路, 生成最终路径。  In the embodiment of the present invention, the planar map to be processed is divided into at least two equal-sized regions in advance, and the waypoints of the region are determined on the boundary of each region; when path finding is required, the region is first searched The road obtains the regional path from the starting point to the ending point; after that, based on the obtained regional path, the triangular path based path finding is used to generate the final path.
其中, 每个区域可称为一个导航格, 相应的, 区域的路点是导航格 的各边与平面地图重合的线段的中点, 每个导航格各个边上的所有路点 构成该导航格对应的路点序列, 区域路径是将每个导航格看作一个点, 先确定由起点所属导航格到终点所属导航格途经的所有导航格, 再根据 所确定导航格间的关联及导航格间的进入点, 获得一条由路点构成的导 航格路径, 即区域路径。  Each area may be referred to as a navigation grid. Correspondingly, the road point of the area is the midpoint of the line segment where each side of the navigation grid coincides with the plane map, and all the way points on each side of each navigation grid constitute the navigation grid. Corresponding road point sequence, the area path is to treat each navigation grid as a point, first determine all the navigation grids from the navigation grid to which the starting point belongs to the navigation grid to which the destination belongs, and then according to the relationship between the navigation grids determined and the navigation grid The entry point, obtain a navigation grid path composed of road points, that is, the area path.
这里, 需要处理的平面地图对应的场景可以是二维或三维场景, 例 如游戏中的 3D社区地图。 对于 3D场景, 先将 3D场景的地图导航片投 影到平面上, 将得到的一个多边形平面地图作为需要处理的平面地图; 对于二维平面场景, 可直接采用平面地图作为需要处理的平面地图。 导 航格可以采用不同的形状, 如方格、 矩形格、 六角形格等, 只要区域大 小相等即可; 较佳的, 用等间距的垂直和水平线将整个平面地图分割为 至少两个区域大小相等的方格。  Here, the scene corresponding to the planar map to be processed may be a two-dimensional or three-dimensional scene, such as a 3D community map in the game. For a 3D scene, the map navigation piece of the 3D scene is projected onto the plane, and the obtained polygon plane map is used as the plane map to be processed. For the 2D plane scene, the plane map can be directly used as the plane map to be processed. The navigation grid can take different shapes, such as squares, rectangles, hexagons, etc., as long as the regions are equal in size; preferably, the entire planar map is divided into at least two regions of equal size by equally spaced vertical and horizontal lines. Square.
图 1示出了本发明实施例中地图寻路方法的总体实现流程示意图。 如图 1所示, 本发明实施例中的地图寻路方法包括以下步骤。 步骤 101: 预先获取需要处理的平面地图, 并将所获取的平面地图 划分为至少两个大小相等的导航格。 FIG. 1 is a schematic diagram showing the overall implementation process of a map path finding method in an embodiment of the present invention. As shown in FIG. 1, the map path finding method in the embodiment of the present invention includes the following steps. Step 101: Acquire a plane map to be processed in advance, and divide the acquired plane map into at least two navigation grids of equal size.
如果需要处理平面地图对应 3D场景的地图, 例如游戏中的社区地 图, 则先将 3D场景的地图的导航片投影到平面上, 得到一个平面地图。 如图 2所示, 图 2是一个 3D社区地图导航片投影到平面得到的多平面 地图。  If it is necessary to process a map corresponding to a 3D scene of a plane map, such as a community map in a game, first project a map of the map of the 3D scene onto a plane to obtain a plane map. As shown in Fig. 2, Fig. 2 is a multi-plane map obtained by projecting a 3D community map navigation piece onto a plane.
在本步骤中, 可以采用不同方式对平面地图进行划分, 划分出的导 航格可以是不同的形状, 只要各个导航格对应的区域面积相等即可。 较 佳的, 用等间距的垂直和水平线将多边形划分为若干个方格, 如图 3所 示, 图 3为将图 2所示平面地图划分为大小相等的方格。  In this step, the plane map may be divided in different manners, and the divided navigation grids may have different shapes, as long as the area corresponding to each navigation grid is equal. Preferably, the polygon is divided into a plurality of squares by equally spaced vertical and horizontal lines, as shown in Fig. 3, and Fig. 3 is a plane map of Fig. 2 divided into equal-sized squares.
步骤 102: 预先确定每个导航格对应的路点序列, 建立并保存每个 路点序列内各路点之间的连通关系。  Step 102: Predetermine a sequence of waypoints corresponding to each navigation grid, and establish and save a connection relationship between each waypoint in each route sequence.
在本实施例中, 将导航格的某条边与平面地图重合的线段的中点确 定为导航格的路点。 如图 4所示, 图 4为图 2所示地图确定路点后的地 图。 图 4中的黑点均为路点, 导航格各边上的所有路点构成该导航格的 路点序列。在本实施例中,为每个导航格创建一个结构体或称数据结构, 结构体中包括该导航格的相关信息以及其对应的路点序列。  In this embodiment, the midpoint of the line segment that coincides with a plane of the navigation map and the plane map is determined as the waypoint of the navigation grid. As shown in Fig. 4, Fig. 4 is a map after the map shown in Fig. 2 is determined. The black points in Figure 4 are waypoints, and all waypoints on each side of the navigation grid form a sequence of waypoints for the navigation grid. In this embodiment, a structure or a data structure is created for each navigation grid, and the structure includes related information of the navigation grid and its corresponding waypoint sequence.
路点序列内各路点间的连通关系, 即路点序列内各路点之间的可达 关系, 可以根据基于三角面的寻路建立。 连通关系的保存可使用并查集 的数据结构来实现, 所谓并查集是指若干个不相交集合, 能够实现较快 的合并、 判断元素所在集合等操作, 主要涉及对集合的合并和查找。  The connectivity relationship between the various waypoints in the sequence of the waypoints, that is, the reachable relationship between the various waypoints in the sequence of the waypoints, can be established based on the pathfinding based on the triangular faces. The preservation of the connected relationship can be realized by using the collected data structure. The so-called parallel check refers to a number of disjoint sets, which can realize the operations of faster merging, judging the set of elements, and the like, mainly involving merging and searching of the set.
在本实施例中, 步骤 101和 102是在寻路之前预先执行的, 仅需执 行一次, 无需在每次寻路前都执行。  In the present embodiment, steps 101 and 102 are performed in advance before the path finding, and only need to be performed once, and need not be performed before each path finding.
步骤 103: 需要寻路时, 采用基于导航格的 A*寻路, 获得导航格路 具体来说, 当需要寻路时, 首先获取起点和终点的坐标位置, 根据 坐标位置即可定位起点和终点分别所属的导航格; 之后, 以导航格作为 单位点, 起始导航格为起点, 终止导航格为终点, 进行 A*寻路。 Step 103: When a pathfinding is required, a navigation grid based A* path finding is used to obtain a navigation path. Specifically, when path finding is needed, the coordinate positions of the start point and the end point are first obtained, and the navigation grid to which the start point and the end point belong respectively can be located according to the coordinate position; after that, the navigation grid is used as the unit point, and the start navigation grid is the starting point. Terminate the navigation grid as the end point and perform A* path finding.
具体基于导航格的 A*寻路过程包括以下步骤:  The A* pathfinding process based on the navigation grid includes the following steps:
A、 构造 Open表, 根据预先建立的路点之间的连通关系, 访问起始 导航格可到达的相邻导航格, 把二元组<导航格, 进入点〉作为元素放入 表中。  A. Construct an Open table, according to the connection relationship between the pre-established waypoints, access the adjacent navigation grid reachable by the starting navigation grid, and put the two-group <navigation grid, entry point> as an element into the table.
这里, 对于起始导航格可到达的相邻导航格需要调用现有技术中基 于三角面的寻路来确定扩展方向。  Here, the adjacent navigation grids reachable by the starting navigation grid need to call the prior art triangle-based path finding to determine the direction of expansion.
B、 如果 Open表不空, 取出表中估价值最小的元素, 将当前导航格 放入 Close表。 设置取出的导航格为当前导航格。  B. If the Open table is not empty, take out the element with the lowest valuation value in the table and put the current navigation grid into the Close table. Set the extracted navigation grid to the current navigation grid.
C、 如果当前导航格等于终点导航格, 则寻路结束, 执行步骤 E; 否则, 执行步骤 D;  C. If the current navigation grid is equal to the destination navigation grid, the pathfinding ends, and step E is performed; otherwise, step D is performed;
D、 访问当前导航格可到达的相邻导航格, 处于未访问过状态的元 素〈导航格, 进入点〉都加入 Open表中, 返回步骤  D. Access the adjacent navigation grid reachable by the current navigation grid. The elements in the unvisited state (navigation grid, entry point) are added to the Open table, and the steps are returned.
E、 如果寻找到终点, 则沿各状态点生成一条由路点构成的从起点 到终点的路径。  E. If the end point is found, a path from the start point to the end point formed by the waypoint is generated along each state point.
步骤 104: 根据获得的导航格路径, 进行基于三角面的 A*寻路, 生 成最终的移动路径。  Step 104: Perform a triangle-based A* path finding according to the obtained navigation grid path to generate a final moving path.
在步骤 103中获得的导航格路径是一条由路点构成的粗略路径, 无 法直接作为移动的依据。 本步骤中, 在移动过程中, 进一步采用基于三 角面的 A*寻路, 得到细化的移动路径。  The navigation grid path obtained in step 103 is a rough path composed of waypoints and cannot be directly used as a basis for movement. In this step, during the moving process, the A* path finding based on the triangular surface is further adopted to obtain a refined moving path.
本发明实施例中, 之所以将所划分的区域称为导航格, 是因为每个 导航格对应着一个导航片区域, 具有导航作用, 也就是说相邻导航格之 间具有关联关系。 基于此, 本发明实施例中一种生成导航格的过程如图 5所示, 包括以下步骤: In the embodiment of the present invention, the divided area is referred to as a navigation grid because each navigation grid corresponds to a navigation area, and has a navigation function, that is, adjacent navigation grids have an association relationship. Based on this, a process of generating a navigation grid in the embodiment of the present invention is as shown in the figure. As shown in 5, the following steps are included:
步骤 501 : 确定当前导航格左上角坐标;  Step 501: Determine coordinates of the upper left corner of the current navigation grid;
因为地图具有一定的坐标范围, 且每个导航格的大小在划分时是已 知的, 根据导航格左上角坐标可以确定导航格在地图中所处的位置, 也 可以确定导航格边界与地图的关系。  Because the map has a certain coordinate range, and the size of each navigation grid is known at the time of division, according to the coordinates of the upper left corner of the navigation grid, the position of the navigation grid in the map can be determined, and the boundary of the navigation grid and the map can also be determined. relationship.
步骤 502: 获取当前导航格右边界路点和下边界路点;  Step 502: Obtain a right navigation road boundary point and a lower boundary road point of the current navigation grid;
在本步骤中, 可以不用获取当前导航格上边界和左边界的路点。 当 两个导航格有公共边, 也就是说两个导航格相邻时, 公共边上的路点可 以被两个导航格共用。 通过在步骤 503中, 提取左边导航格右边界上的 路点、 以及上边导航格下边界上的路点, 可以直接获取当前导航格的上 边界和左边界上的路点。 这样一来, 提高了获取导航格路点的效率, 降 低运算的复杂度。  In this step, it is not necessary to obtain the waypoints of the upper and left boundaries of the current navigation grid. When two navigation grids have a common edge, that is, when two navigation grids are adjacent, the waypoints on the common edge can be shared by the two navigation grids. By extracting the waypoint on the right border of the left navigation grid and the waypoint on the lower boundary of the upper navigation grid in step 503, the upper boundary of the current navigation grid and the waypoint on the left boundary can be directly obtained. In this way, the efficiency of obtaining navigational waypoints is improved, and the complexity of the operation is reduced.
步骤 503: 设置当前导航格与上边导航格、 左边导航格的关联, 获 取上边界和左边界上的路点;  Step 503: Set the association between the current navigation grid and the navigation bar on the left side and the navigation grid on the left side, and obtain the waypoints on the upper boundary and the left boundary;
对于当前导航格而言, 其上边导航格和左边导航格的路点已经在先 生成并获取, 此处只要当前导航格主动与上边导航格、 左边导航格进行 关联, 即可获取当前导航格上边界和左边界上的路点。  For the current navigation grid, the waypoints of the upper navigation grid and the left navigation grid have been acquired and acquired. Here, as long as the current navigation grid is actively associated with the upper navigation grid and the left navigation grid, the current navigation grid can be obtained. The waypoints on the boundary and the left border.
步骤 504: 生成当前导航格的路点序列, 并建立各路点之间的连通 关系。  Step 504: Generate a sequence of waypoints of the current navigation grid, and establish a connection relationship between the road points.
这里, 所述路点序列就是当前导航格各个边界上所有路点的集合; 所述建立各路点间的连通关系是通过基于三角面的 A*寻路方法实现。  Here, the sequence of waypoints is a set of all waypoints on each boundary of the current navigation grid; the establishing the connection relationship between the respective waypoints is implemented by a triangle-based A* pathfinding method.
图 5给出的生成导航格的方法是从左上角开始向右、 向下生成导航 格, 在实际应用中, 也可以从右上角向左、 向下生成导航格, 或从左下 角向右、 向上生成导航格, 或从右下角向左、 向上生成导航格, 处理过 程都是类似的,只需替换上述步骤中选择的角坐标以及边界即可,例如: 确定右上角坐标, 获取左边界、 下边界上的路点等等。 The method for generating the navigation grid shown in Figure 5 is to generate a navigation grid from the upper left corner to the right and down. In the actual application, the navigation grid can also be generated from the upper right corner to the left and down, or from the lower left corner to the right. Generate a navigation grid up, or generate a navigation grid from the lower right corner to the left and up. The processing is similar. Just replace the angular coordinates and boundaries selected in the above steps, for example: Determine the coordinates of the upper right corner, get the left and lower road points, and so on.
下面结合具体实施例和附图详细说明一下本发明实施例中地图寻 路方法的实现。  The implementation of the map finder method in the embodiment of the present invention will be described in detail below with reference to specific embodiments and the accompanying drawings.
本实施例中, 已经预先采用等间距的垂直和水平线将多边形地图划 分为至少两个方格, 确定每个导航格对应的路点序列, 建立并保存每个 路点序列内各路点之间的连通关系。  In this embodiment, the polygon map is divided into at least two squares by using equal-space vertical and horizontal lines in advance, and the sequence of road points corresponding to each navigation grid is determined, and each road point sequence in each road point sequence is established and saved. Connectivity.
图 6a至图 6g给出了本实施例中实现地图寻路的过程。 其中, 需要 寻路的起点为 S点, 终点为 T点。 如图 6所示, 图中的黑点均为路点。 S点和 T点分别用五角星表示, 灰色填充的方格为搜索过的方格节点。  Figures 6a through 6g show the process of implementing map path finding in this embodiment. Among them, the starting point for the path finding is S point, and the ending point is T point. As shown in Figure 6, the black points in the figure are waypoints. The S and T points are respectively represented by a five-pointed star, and the gray-filled square is the searched square node.
图 6a为起始状态, 从 S点到 T点的寻路过程如下。  Figure 6a shows the initial state, and the path finding process from point S to point T is as follows.
步骤 11 : 定位起点 S与终点 T所属的导航格分别为 Gs、 Gt, 如图 6b所示。  Step 11: Positioning starting point S and ending point T The navigation grid to which T belongs is Gs and Gt, respectively, as shown in Figure 6b.
步骤 12:执行 A*寻路,根据 S点能走到的路点,扩展出导航格 GO, 并将 GO放入优先队列, 如图 6c所示。  Step 12: Perform A* pathfinding, expand the navigation grid GO according to the waypoint that S point can reach, and put the GO into the priority queue, as shown in Figure 6c.
这里,导航格 GO是从起始导航格 Gs第一个扩展出的导航格, 具体 如何确定起始导航格 Gs的扩展方向, 可以根据现有的基于三角面的 A* 寻路技术确定。 具体到本实施例中, 对于导航格 Gs来说, 根据基于三 角面的 A*寻路, 从起点 S只能向左移动, 右边不连通, 所以就从导航 格 Gs向左扩展出导航格 GO; 如果从起点 S向左、 右两侧都可以移动的 话, 根据 A*寻路技术, 可以从导航格 Gs向左、 向右各扩展出一个导航 格, 之后继续基于导航格执行 A*寻路。  Here, the navigation grid GO is the navigation grid expanded from the first navigation grid Gs. How to determine the extension direction of the initial navigation grid Gs can be determined according to the existing triangle-based A* pathfinding technique. Specifically, in the embodiment, for the navigation grid Gs, according to the A* path finding based on the triangular surface, the starting point S can only move to the left, and the right side is not connected, so the navigation grid GO is extended from the navigation grid Gs to the left. If you can move from the starting point S to the left and right sides, according to the A* path finding technique, you can expand a navigation grid from the navigation grid Gs to the left and right, and then continue to perform A* path finding based on the navigation grid. .
步骤 13: 基于 A*寻路技术, 从导航格 GO扩展出导航格 Gl、 G2、 G3 , 如图 6d所示。  Step 13: Based on the A* path finding technique, expand the navigation grids Gl, G2, and G3 from the navigation grid GO, as shown in Figure 6d.
步骤 14: 根据启发搜索规则, 即根据到导航格 Gt的距离, 优先扩 展导航格 G1 , 得到导航格 G4, 如图 6e所示。 步骤 15: 依据与步骤 14相同的原理进行操作, 扩展导航格 G4, 得 到导航格 G5, 进而到达 Gt, 如图 6f所示。 至此, 确定 Gs、 G0、 Gl、 G4、 G5、 Gt为导航格路径途径的所有导航格。 Step 14: According to the heuristic search rule, that is, according to the distance to the navigation grid Gt, the navigation grid G1 is preferentially extended, and the navigation grid G4 is obtained, as shown in Fig. 6e. Step 15: According to the same principle as step 14, the navigation grid G4 is extended to obtain the navigation grid G5, and then reaches Gt, as shown in Fig. 6f. At this point, it is determined that Gs, G0, Gl, G4, G5, and Gt are all navigation grids of the navigation path path.
步骤 16: 根据各导航格之间的关联关系以及进入点, 生成一个路点 序列, 进而得到从 S点到 T点的导航格路径。 如图 6f所示, Gs与 GO 之间相邻, Gs到 GO的进入点为点 1; GO与 G1之间相邻, GO到 G1的 进入点为点 2; G1与 G4之间相邻, G1到 G4的进入点为点 3; G4与 G5之间相邻, G4到 G5的进入点为点 4; G5与 Gt之间相邻, G5到 Gt 的进入点为点 5, 因此, 所生成的路点序列为 {S、 1、 2、 3、 4、 5、 T} , 得到的导航格路径为 S 1 2 3 4 5 T, 如图 6g所示, 各路点之间 的路段组成长路径。  Step 16: According to the association relationship between each navigation grid and the entry point, a route sequence is generated, and then the navigation path from S point to T point is obtained. As shown in FIG. 6f, Gs is adjacent to GO, and the entry point of Gs to GO is point 1; GO is adjacent to G1, and the entry point of GO to G1 is point 2; G1 and G4 are adjacent to each other. The entry point of G1 to G4 is point 3; G4 is adjacent to G5, the entry point of G4 to G5 is point 4; G5 is adjacent to Gt, and the entry point of G5 to Gt is point 5, therefore, generated The sequence of waypoints is {S, 1, 2, 3, 4, 5, T}, and the obtained navigation grid path is S 1 2 3 4 5 T. As shown in Fig. 6g, the sections between the road points are long. path.
步骤 17: 在移动过程中, 根据获得的导航格路径, 进行基于三角面 的 A*寻路, 生成最终的移动路径。  Step 17: During the movement, according to the obtained navigation grid path, a triangle-based A* pathfinding is performed to generate a final moving path.
为实现上述方法, 本发明实施例还提出一种地图寻路系统, 包括: 区域生成模块、 路点管理模块、 寻路模块。  To implement the above method, an embodiment of the present invention further provides a map path finding system, including: an area generating module, a waypoint management module, and a path finding module.
区域生成模块用于将平面地图划分为至少两个大小相等的区域。 路点生成模块用于针对划分的每块区域, 获取区域各边与平面地图 重合的线段的中点作为路点, 将每块区域中的路点生成路点序列, 并建 立路点序列内各路点之间的连通关系。  The area generation module is configured to divide the plane map into at least two equal-sized areas. The waypoint generating module is configured to obtain, as a waypoint, a midpoint of a line segment in which each side of the area coincides with the plane map for each of the divided regions, generate a waypoint sequence for the waypoints in each of the regions, and establish a sequence of the waypoints The connection between the waypoints.
寻路模块用于采用 A*寻路技术进行寻路, 其进一步包括区域寻路 模块和三角面寻路模块。 区域寻路模块是以区域为单位采用 A*寻路技 术进行寻路, 并根据途径的区域及区域间的进入点, 确定一条由路点构 成的区域路径; 三角面寻路模块, 在移动过程中, 根据区域路径, 进行 基于三角面的 A*寻路, 得到最终移动路径。  The path finding module is used for path finding using A* path finding technology, and further includes an area finding module and a triangle face finding module. The regional path-finding module uses A* path-finding technology to find paths in the area, and determines an area path composed of road points according to the area of the route and the entry point between the areas; the triangular surface finding module, in the moving process Medium, based on the regional path, performs a triangle-based A* pathfinding to obtain the final moving path.
以上所述仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。 The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention. Range of protection.

Claims

权利要求 Rights request
1、 一种地图寻路方法, 其特征在于,  A map finding method, characterized in that
预先将平面地图划分为至少两个大小相等的区域, 并在所述区域的 边界上确定路点;  Dividing the planar map into at least two equal-sized regions in advance, and determining the waypoints on the boundaries of the regions;
当需要寻路时, 基于所述区域进行寻路, 获得区域路径;  When path finding is required, path finding is performed based on the area to obtain a regional path;
根据所述区域路径, 进行基于三角面的寻路, 生成最终路径。  Based on the area path, a triangle-based path finding is performed to generate a final path.
2、根据权利要求 1所述的地图寻路方法, 其特征在于, 所述划分区 域包括: 采用等间距的垂直和水平线将所述平面地图划分为至少两个大 小相等的方格。  The map path finding method according to claim 1, wherein the dividing area comprises: dividing the plane map into at least two squares of equal size by using equally spaced vertical and horizontal lines.
3、根据权利要求 2所述的地图寻路方法, 其特征在于, 所述在所述 区域的边界上确定路点包括:  The method of map finding according to claim 2, wherein the determining the waypoint on the boundary of the area comprises:
确定当前区域左上角的坐标;  Determining the coordinates of the upper left corner of the current region;
获取所述当前区域右边界上的路点和下边界上路点;  Obtaining a waypoint on a right boundary of the current area and a waypoint on a lower boundary;
设置所述当前区域与上边区域和左边区域的关联, 获取所述上边区 域的下边界上的路点作为所述当前区域的上边界上的路点, 获取所述左 边区域的右边界上的路点作为所述当前区域的左边界上的路点。  And setting a relationship between the current area and the upper area and the left area, obtaining a waypoint on a lower boundary of the upper area as a waypoint on an upper boundary of the current area, and acquiring a path on a right boundary of the left area The point serves as a waypoint on the left border of the current area.
4、根据权利要求 1所述的地图寻路方法, 其特征在于, 所述在所述 区域的边界上确定路点包括: 将所述区域各边与平面地图重合的线段的 中点确定作为路点。  The map path finding method according to claim 1, wherein the determining the waypoint on the boundary of the area comprises: determining a midpoint of a line segment in which each side of the area coincides with a plane map as a road point.
5、根据权利要求 1所述的地图寻路方法, 其特征在于, 所述基于区 域进行寻路, 获得区域路径包括:  The method of claim 1 according to claim 1, wherein the path finding is performed based on the area, and obtaining the area path comprises:
基于区域进行寻路, 确定从起点所属的区域到终点所属的区域途径 的区域;  Path finding based on the area, determining the area from the area to which the start point belongs to the area to which the end point belongs;
-点, 获 得所述区域路径。 - point, get The path of the area is obtained.
6、 根据权利要求 1至 5任一项所述的地图寻路方法, 其特征在于, 所述寻路采用 A*寻路技术。  The map path finding method according to any one of claims 1 to 5, wherein the path finding adopts an A* path finding technique.
7、 根据权利要求 1至 5任一项所述的地图寻路方法, 其特征在于, 在划分区域之前, 该方法进一步包括: 将三维场景对应的地图导航片投 影到平面, 形成所述平面地图。  The map path finding method according to any one of claims 1 to 5, wherein before the dividing the area, the method further comprises: projecting a map navigation piece corresponding to the three-dimensional scene onto a plane to form the plane map. .
8、 一种地图寻路系统, 其特征在于, 包括:  8. A map path finding system, comprising:
区域生成模块, 用于将平面地图划分为至少两个大小相等的区域; 路点生成模块, 用于在所述区域的边界上确定路点;  a region generating module, configured to divide the plane map into at least two equal-sized regions; a waypoint generating module, configured to determine a waypoint on a boundary of the region;
寻路模块, 用于基于区域进行寻路, 获得区域路径; 根据所述区域 路径, 进行基于三角面的寻路, 生成最终路径。  The path finding module is configured to perform path finding based on the area, obtain a regional path, and perform a path based on the triangular surface according to the area path to generate a final path.
9、根据权利要求 8所述的地图寻路系统, 其特征在于, 所述寻路模 块包括:  The map path finding system according to claim 8, wherein the path finding module comprises:
区域寻路模块, 用于基于区域进行寻路, 确定从起点所属的区域到 终点所属的区域途径的区域; 根据所确定的区域之间的关联以及所确定 的区域之间的进入点, 获得所述区域路径;  a regional path finding module, configured to perform path finding based on the area, determine an area from the area to which the starting point belongs to the area to which the end point belongs; obtain the location according to the determined relationship between the areas and the determined entry point between the areas Regional path
三角面寻路模块,用于根据所述区域路径,进行基于三角面的寻路, 生成最终路径。  A triangular surface path finding module is configured to perform a triangle face based path finding according to the area path to generate a final path.
PCT/CN2009/070182 2008-01-17 2009-01-16 Map path seeking method and system WO2009092327A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200810056378.8 2008-01-17
CN2008100563788A CN101241507B (en) 2008-01-17 2008-01-17 Map road-seeking method and system

Publications (1)

Publication Number Publication Date
WO2009092327A1 true WO2009092327A1 (en) 2009-07-30

Family

ID=39933040

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/070182 WO2009092327A1 (en) 2008-01-17 2009-01-16 Map path seeking method and system

Country Status (2)

Country Link
CN (1) CN101241507B (en)
WO (1) WO2009092327A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012167174A1 (en) * 2011-06-03 2012-12-06 Cardinal Optimization, Inc. Systems and methods for multi-vehicle resource allocation and routing solutions
CN107357563A (en) * 2017-05-25 2017-11-17 腾讯科技(深圳)有限公司 Object moving method and device and storage medium, electronic installation
CN114470776A (en) * 2022-04-02 2022-05-13 北京优锘科技有限公司 Efficient hierarchical path finding method, device, medium and equipment
CN115238525A (en) * 2022-09-16 2022-10-25 广东工业大学 Feasible path searching method for pedestrian simulation passenger flow organization

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101241507B (en) * 2008-01-17 2011-09-14 腾讯科技(深圳)有限公司 Map road-seeking method and system
CN101504776B (en) * 2009-03-17 2011-03-23 北京像素软件科技股份有限公司 3D scene path finding method and apparatus
CN102800242B (en) * 2011-05-25 2014-09-17 腾讯科技(深圳)有限公司 Path finding verification method and device
CN102645228B (en) * 2012-04-12 2014-09-10 清华大学 Trafficability route-finding algorithm of vehicle navigation system
CN103020443A (en) * 2012-12-08 2013-04-03 大连创达技术交易市场有限公司 Method for map training
CN103021258A (en) * 2012-12-08 2013-04-03 大连创达技术交易市场有限公司 Speed-optimized map way-finding algorithm
CN103207951B (en) * 2013-04-22 2015-02-25 腾讯科技(深圳)有限公司 Way finding method and device
CN103198234A (en) * 2013-04-25 2013-07-10 腾讯科技(深圳)有限公司 Routing method and routing device
CN103714234B (en) * 2013-08-09 2017-01-25 网易(杭州)网络有限公司 Method and equipment for determining moving paths of objects in games
CN104613976B (en) * 2014-08-26 2017-12-15 腾讯科技(深圳)有限公司 Determine the method and device in path
CN104548597B (en) * 2014-12-26 2018-06-01 北京像素软件科技股份有限公司 The automatic generation method and device of navigation grid
CN104548598B (en) * 2014-12-31 2017-08-08 北京像素软件科技股份有限公司 A kind of method of pathfinding in virtual reality scenario
CN105138859B (en) * 2015-09-30 2018-02-16 四川师范大学 Three-dimensional panorama roams method for searching and system
CN105758410B (en) * 2015-11-14 2018-12-25 大连东软信息学院 Fast path based on A-Star algorithm plans mixed method
CN106110656B (en) * 2016-07-07 2020-01-14 网易(杭州)网络有限公司 Method and device for calculating route in game scene
CN106582023B (en) * 2016-12-01 2020-06-02 北京像素软件科技股份有限公司 Game way finding method and device
CN106964156B (en) * 2017-03-24 2020-10-27 腾讯科技(深圳)有限公司 Path finding method and device
CN107158703B (en) * 2017-06-14 2018-12-04 浙江无端科技股份有限公司 A kind of method and system of AI metope pathfinding
CN108090155A (en) * 2017-12-12 2018-05-29 苏州蜗牛数字科技股份有限公司 A kind of 2D grids method for searching, device and storage medium
CN108647787A (en) * 2018-03-30 2018-10-12 中山大学 A kind of multiple agent cognition planning algorithm based on heuristic search
CN108815850B (en) * 2018-06-15 2021-01-05 腾讯科技(深圳)有限公司 Method and client for controlling path finding of analog object
CN109568959A (en) * 2019-01-12 2019-04-05 孙伟乐 A kind of method for supporting a large amount of units pathfinding simultaneously in game
CN111228804B (en) * 2020-02-04 2021-05-14 腾讯科技(深圳)有限公司 Method, device, terminal and storage medium for driving vehicle in virtual environment
CN112686476A (en) * 2021-01-26 2021-04-20 广东省博瑞海曼科技有限公司 Path generation method, system, equipment and storage medium applied to map
CN113827973A (en) * 2021-09-27 2021-12-24 网易(杭州)网络有限公司 Map path finding method, device, terminal and storage medium
CN113842641A (en) * 2021-09-27 2021-12-28 网易(杭州)网络有限公司 Method, device, terminal and storage medium for determining nearest waypoint

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1975747A (en) * 2006-10-12 2007-06-06 中山大学 Automatic generating method and apparatus for RPG game scene path
CN101105402A (en) * 2007-08-08 2008-01-16 晟航行动运算股份有限公司 Path calculation device quick calculation method
CN101241507A (en) * 2008-01-17 2008-08-13 腾讯科技(深圳)有限公司 Map road-seeking method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1975747A (en) * 2006-10-12 2007-06-06 中山大学 Automatic generating method and apparatus for RPG game scene path
CN101105402A (en) * 2007-08-08 2008-01-16 晟航行动运算股份有限公司 Path calculation device quick calculation method
CN101241507A (en) * 2008-01-17 2008-08-13 腾讯科技(深圳)有限公司 Map road-seeking method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CHEN G. ET AL.: "Research on Improving A* Algorithm in Game Map Path Finding", SCIENCE TECHNOLOGY AND ENGINEERING, vol. 7, no. 15, August 2007 (2007-08-01), pages 3731 - 3732 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012167174A1 (en) * 2011-06-03 2012-12-06 Cardinal Optimization, Inc. Systems and methods for multi-vehicle resource allocation and routing solutions
US8630958B2 (en) 2011-06-03 2014-01-14 Cardinal Optimization, Inc. Systems and methods for multi-vehicle resource allocation and routing solutions
CN107357563A (en) * 2017-05-25 2017-11-17 腾讯科技(深圳)有限公司 Object moving method and device and storage medium, electronic installation
CN114470776A (en) * 2022-04-02 2022-05-13 北京优锘科技有限公司 Efficient hierarchical path finding method, device, medium and equipment
CN115238525A (en) * 2022-09-16 2022-10-25 广东工业大学 Feasible path searching method for pedestrian simulation passenger flow organization

Also Published As

Publication number Publication date
CN101241507B (en) 2011-09-14
CN101241507A (en) 2008-08-13

Similar Documents

Publication Publication Date Title
WO2009092327A1 (en) Map path seeking method and system
CN106582023B (en) Game way finding method and device
Li et al. On trip planning queries in spatial databases
WO2017162036A1 (en) Yawing recognition method, terminal and storage medium
JP5381679B2 (en) Route search system, method, program, and moving object
CN111375205B (en) Processing method and device of path finding path in game, electronic equipment and storage medium
CN110909961B (en) BIM-based indoor path query method and device
CN107402018A (en) A kind of apparatus for guiding blind combinatorial path planing method based on successive frame
JP2022528593A (en) Wall polishing route planning method, equipment, equipment and media
CN111080786B (en) BIM-based indoor map model construction method and device
CN110488839A (en) A kind of legged type robot paths planning method and device based on tangent line interior extrapolation method
CN103439726B (en) Rapid K shortest path planning method applied to GPS
CN112221144A (en) Three-dimensional scene path finding method and device and three-dimensional scene map processing method and device
CN101777093B (en) Large-scale virtual crowd routing method
CN107544502A (en) A kind of Planning of Mobile Robot under known environment
JP4997597B2 (en) Shortest path search method
CN112161631A (en) Safe path planning method based on large satellite grid map
CN114035572A (en) Obstacle avoidance and itinerant method and system of mowing robot
CN112288854B (en) Construction method of three-dimensional model of overpass
CN112328877A (en) Skyline inquiry method for multiple users on time-dependent road network
CN106326492B (en) Space vector data generation method and device
CN116009552A (en) Path planning method, device, equipment and storage medium
CN108731688A (en) Air navigation aid and device
KR20160135907A (en) An extended System and Method for searching nearest spatial entity based on tree index
US11846517B2 (en) Vector tile navigation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09703705

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 4077/CHENP/2010

Country of ref document: IN

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC

122 Ep: pct application non-entry in european phase

Ref document number: 09703705

Country of ref document: EP

Kind code of ref document: A1