A*插件关于生成导航网格的简单配置及一些参数的干货

生成寻路网格的配置(场景自行搭建)

(本文章所使用的A*插件版本为4.1.16)

以下为我搭建的场景(地面10*10,障碍物均为5*5,楼梯每阶高0.3)

scene

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

1

2

3

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

4

首先先看一下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,然后使用改变大小的工具拉升网格四边,直至恰好覆盖场景。

5

6

7

 

接下来调节参数

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值