百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
H

hierarchical-pathfinding

> 编程语言
开源

在Unity中执行近奥平分路径搜索(HPA*)算法,通过从"龙相:起源"测试地图

195 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

在Unity中执行近奥平分路径搜索(HPA*)算法,通过从"龙相:起源"测试地图

Hierarchical Pathfinding

In this project, we explore a variation of A* which utilizes the concept of abstracting a map into clusters and precomputing information to do pathfinding. This method is called Near-Optimal Hierarchical Pathfinding (HPA*).

The idea is to separate a map into multiple levels of clusters and to precompute information on how to navigate between clusters so that we can use this information later to do pathfinding on a higher level. This method mainly addresses the issue of pathfinding in real-time. Searching for a path should be efficient and should be done often. Moreover, given that the state of a game is constantly changing, we often disregard many of the pathfinding done. By using HPA*, we divide a map into clusters and precompute information on how to travel from a cluster to another. Therefore, we can efficiently do pathfinding on a higher level at a much lower cost, reusing precomputed low level paths between clusters. Consequently, pathfinding is generally faster than a traditional A* algorithm, and disregarding unnecessary paths is less heartbreaking. However, given that we travel from cluster to cluster by predetermined boundary nodes, the resulting paths from this method can be a bit less optimal than a straightforward A*, hence the name “Near-Optimal”.

Near-Optimal Hierarchical Pathfinding was implemented on grid-based maps using arbitrarily-sized automatically generated clusters. We tested the results of our algorithm on real maps from BioWare’s commercial game Dragon Age: Origins, provided by the Moving AI lab (See credits).

How to test

  1. Clone the repo

  2. Download maps from Moving AI's 2d Pathfinding benchmark sets

    • The expected map folder structure from the repo's root is the following:

      Maps/
      |- map/
      |  |- my_map1.map
      |  |- my_map2.map
      |  |- ...
      |- scen/
      |  |- my_map1.scen
      |  |- my_map2.scen
      |  |- ...
    • If you download all the maps from a specific data set, extract all the .map files into Maps/map/

    • If you want to run the tests set as well, download the benchmark data and extract all the .scen files into Maps/scen/, and create an empty Maps/results/ folder

  3. Launch the project in unity, load the scene "main" and run it


Credits

  • HPA* was introduced in this paper written by Botea, Müller, and Schaeffer.

  • All .map and .scen files used for testing come from Moving AI's 2d Pathfinding benchmark sets

  • The Priority Queue used in this project comes from BlueRaja's High Speed Priority Queue for C#. All files in folder Priority Queue comes from the repo's Priority Queue folder.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#astar-pathfindinggamedevpathfindingunity

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言