导致这种Astar节点基本探索结果的可能错误是什么?
我正在使用Unity使用Astar探索插件,并且在获得此结果之前,它以前很漂亮。
请参阅Unity编辑器视图的屏幕截图,蓝色节点是步行区域,黄点是起始位置,而目标节点是星形图标所在的位置。因此,所需的方式应该是绿线,但实际结果是红线。
我知道这不是插件的问题,但是我多次检查了我的代码,找不到任何问题,并且在其他情况下效果很好。
更奇怪的是,如果我删除紫色区域中的可步行节点,则插件可以找到正确的方法。
我想知道可能导致这一结果的可能发生的错误,任何线索都会被涉及。谢谢。
I'm using a AStar pathfinding plugin in Unity, and it works prety well previously until I got this result.
Please see the screen shot of Unity Editor view, the blue nodes are walkable area, the yellow point is the starting position, and the target node is where the Star icon is. So the desired way should be the green line, but the actual result is the red line.
I know it's very possible that it's not the problem of the plugin, but I checked my code many times and can't find any problem and it works well in other cases.
what is even more strange is that if I remove the walkable nodes in the purple area, the plugin finds the right way.
I'd like to know what is the possible mistake that could lead to this result, any clue would be appreicated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可悲的是,我无法远程调试您的图形,但是我会逐渐检查您当前的开始位置的许多路径,在此过程中,它切换到正确的路径并诊断哪些节点是断开连接的。
也许有些节点升高或阻塞。
简而言之,请尝试调试游戏网格,以最小的可再现的越野车行为和一个工作的行为,并试图了解它们彼此之间的不同之处。
关于a*的内部工作的一些基本提示:
I sadly can't debug your graph remotely, but I would check many paths from your current start position gradually towards the goal, where it switches to a correct path and diagnose which nodes are disconnected.
Maybe some nodes are elevated or obstructed.
In a nutshell, try to debug your game grid to a minimal reproducible buggy behaviour and a working one and try to understand where they differ from each other.
Some basic hints on the inner workings of A*: