hxhb / blog-comments

https://imzlp.com and https://zhalipeng.com is my blog.
1 stars 0 forks source link

posts/20203/ #118

Open hxhb opened 4 years ago

hxhb commented 4 years ago

https://imzlp.com/posts/20203/

Recast Navigation是一个开源的游戏导航/寻路引擎,可以为游戏中的AI提供寻路计算。UE和Unity都是集成了RecastNavigation来为游戏提供寻路(当然是修改过的版本),UE中模块NavigationSystem以及NavMesh中可以看到相关的代码。

papalqi commented 4 years ago

大佬,你知道为什么寻路的sys,是all actor on all level 在八叉树中。。。它的八叉树是做什么作用的

papalqi commented 4 years ago

我想用recastnavmesh的体素化过成的结果,不知道应该怎么做

hxhb commented 4 years ago

@papalqi 我想用recastnavmesh的体素化过成的结果,不知道应该怎么做

你可以看一下RecastDemo中的Voxels或者Walkable Voxels的部分,在RecastDemo/Source/Sample_SoloMesh.cpp#L289

MacSummer commented 4 years ago

安装了插件,使用的是UE4.23,导出了TopDown这个例子的导航图,用recast demo打开,无法拉近查看,按build,等待一会后recastdemo直接崩溃了,这个有什么要求吗?

hxhb commented 4 years ago

@maydayzm 安装了插件,使用的是UE4.23,导出了TopDown这个例子的导航图,用recast demo打开,无法拉近查看,按build,等待一会后recastdemo直接崩溃了,这个有什么要求吗?

导出NavMesh是额外的东西,如果只是想要在外面使用UE的Recast导航数据,直接使用插件导出的.bin就可以了。 你遇到的RecastDemo会Crash的问题是因为默认导出NavMesh的单位是cm,导进到RecastDemo中太大,可以修改一下单位为m,我在ExternRecastNavMeshGenetator.cpp#L61中已经写了相关的代码了,把导出cm的代码取消注释,然后把下面导出为m的注释即可。

hxhb commented 4 years ago

@maydayzm 另外,不建议直接使用从RecastDemo生成的bin,因为配置参数无法与UE的完全保持一致,直接使用插件导出的bin就好。

MacSummer commented 4 years ago

@hxhb @maydayzm 另外,不建议直接使用从RecastDemo生成的bin,因为配置参数无法与UE的完全保持一致,直接使用插件导出的bin就好。

感谢~ recastdemo上已成功build 使用的话还是会用UE4的插件产生的bin文件,在recast上只是用来查看寻路路径而已~

BuLiangRenDarkStar commented 4 years ago

你好,我是做unity的。想问下这句话的意思“从UE导出Navmesh的含义是,把UE寻路范围内的模型导出”,请问这里导出的NavMesh.obj文件是导航网格还是场景里需要烘焙的模型?

hxhb commented 4 years ago

你好,我是做unity的。想问下这句话的意思“从UE导出Navmesh的含义是,把UE寻路范围内的模型导出”,请问这里导出的NavMesh.obj文件是导航网格还是场景里需要烘焙的模型?

模型,需要在这个模型上生成导航信息。

ghost commented 3 years ago

Hey! Hello and greetings from Argentina! Thanks for doing this awesome work and sharing! There's so few out information out there about this!

I wanted to ask you something because I'm trying to implement your plugin into my UE4 project, and everything until now seems fine. I can extract the NavMesh easily and then I run the tests with ue4-detour.exe and all the valid and invalid points are OK, the same ones I obtain when projecting them inside the game.

The problem I think is in the server side! I want to calculate some paths in the server with the navmesh obtained with your plugin. For that, I was thinking about doing this steps: 1) Export the navmesh to the server 2) Load the navmesh in the server code, and Deserialize it, like in this function https://github.com/hxhb/ue4-recast-detour/blob/master/UE4RecastHelper.cpp#L207 3) Convert the Origin and Destination points from Unreal2Recast using functions like this ones: https://github.com/hxhb/ue4-recast-detour/blob/master/UE4RecastHelper.cpp#L283 4) Calculate the path

Do you think this steps are correct? Or is there something I'm missing? Thank you so much again for youor work and I hope you could give me a hint or point me in the right direction.

hxhb commented 3 years ago

Hey! Hello and greetings from Argentina! Thanks for doing this awesome work and sharing! There's so few out information out there about this!

I wanted to ask you something because I'm trying to implement your plugin into my UE4 project, and everything until now seems fine. I can extract the NavMesh easily and then I run the tests with ue4-detour.exe and all the valid and invalid points are OK, the same ones I obtain when projecting them inside the game.

The problem I think is in the server side! I want to calculate some paths in the server with the navmesh obtained with your plugin. For that, I was thinking about doing this steps:

  1. Export the navmesh to the server
  2. Load the navmesh in the server code, and Deserialize it, like in this function https://github.com/hxhb/ue4-recast-detour/blob/master/UE4RecastHelper.cpp#L207
  3. Convert the Origin and Destination points from Unreal2Recast using functions like this ones: https://github.com/hxhb/ue4-recast-detour/blob/master/UE4RecastHelper.cpp#L283
  4. Calculate the path

Do you think this steps are correct? Or is there something I'm missing? Thank you so much again for youor work and I hope you could give me a hint or point me in the right direction.

I submitted the latest code, please pull the master branch and use ue4-findpath.cpp for pathfinding test.