c++ - A星寻路算法怎么应用于不规则 地图 如梦幻西游 ?
怪我咯
怪我咯 2017-04-17 13:18:09
0
2
654

A星寻路算法怎么应用于不规则 地图 如梦幻西游 ?
此问题 研究了 很久了。。。还是没找到答案。
只知道 地图要 分片化后放入二维数组中 ,而分片化 不知怎么完成 。
求些案例 谢谢.

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all (2)
黄舟

If your map can be put into a two-dimensional array, there is no need to treat it as an irregular map. Regardless of whether the map is regular or not, it can be stored, but the nature is not necessarily a two-dimensional array, it may be other data structures (linked lists, sets, etc.). Mainly, you can plan the map into a data structure, and it is very convenient. Reading and writing these data is just a matter of convenience using the A star algorithm.

The key to solving the pathfinding problem of irregular maps A star is to use a reasonable data structure to represent the map, rather than having to stuff an irregular map into a two-dimensional array.

    黄舟

    The A* algorithm is just a general graph search algorithm and has nothing to do with two-dimensional arrays. How to search depends on how the map is saved.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!