生成寻路网格的配置(场景自行搭建)
(本文章所使用的A*插件版本为4.1.16)
以下为我搭建的场景(地面10*10,障碍物均为5*5,楼梯每阶高0.3)

创建一个空物体,命名为A*,然后添加上Pathfinder组件



点击Graph,会出现好几种生成寻路网格的方式,这里我会讲我之前在做寻路测试用的两种Grid Graph和Recast Graph。

首先先看一下Grid Graph生成导航网格的方法
The Grid Graph is the most straight forward graph. As the name implies it generates nodes in a grid pattern.
It works great for most scenes and is especially good when you need to update the graph during runtime (such as in an RTS or a Tower Defence game).
It is not particularly good from a performance and memory point of view at handling large worlds with large open spaces however as it represents all regions with the same node density regardless of if they need that detail or not'.
网格图是最直接的正向图。顾名思义,它在网格模式中生成节点。
它在大多数场景中都很好用,当你需要在运行时(例如在RTS或塔防游戏中)更新图形时尤其好用。
但从性能和内存的角度来看,它在处理具有大开放空间的大型世界方面并不是特别好,因为它代表了具有相同节点密度的所有区域,而不管它们是否需要这些细节。
接下来为具体的使用方法:
当我们点击GridGraph以后,场景中出现一小块导航网格,接下来我们需要是导航网格覆盖整个需要场景,同时和地面贴合,为了方便操作,我们首先把显示方式改成wireframe,然后使用改变大小的工具拉升网格四边,直至恰好覆盖场景。



接下来调节参数

最低0.47元/天 解锁文章
168万+

被折叠的 条评论
为什么被折叠?



