KBEngine官方论坛

 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 配置 开服
查看: 3622|回复: 98

Navigation mesh for UE4

[复制链接]

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
发表于 2017-4-21 20:09:43 | 显示全部楼层 |阅读模式
Hello, everyone!

I would be very grateful for somebody if one explain how to generate a Navigation Mesh for kbengine server!

Thanks in advance!
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-6-5 14:53:19 | 显示全部楼层
DarkWere 发表于 2017-6-5 14:01
You changed the kbengine_ue4_demo map?

Update demo.
Yes, for better demonstration, I made some changes. Can you give me a new navmesh?


Can you open your obj scaling algorithm? I can export the correct obj later
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-5-8 19:03:27 | 显示全部楼层
I've cloned this particular version above (https://github.com/kbengine/recastnavigation) in order to use the recastdemo to generate a navmesh. The solution does not compile neither with VS2010 nor VS2015. May be something is not right with this version, and why not you to try to update to the latest version of recastnavigation ?
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-4-21 23:55:57 | 显示全部楼层
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-4-22 18:49:04 | 显示全部楼层
it is too complicated for me now.

Is it possible to export level from UE4 to FBX, then import to UNITY3D and use nav_critterai to generate navmesh?
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-4-22 18:56:54 | 显示全部楼层
May be
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-4-22 19:51:02 | 显示全部楼层
Can you fix https://github.com/kbengine/unity3d_nav_critterai page? The pictures has gone...
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-4-22 20:03:56 | 显示全部楼层
fixed!
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-5-7 18:49:11 | 显示全部楼层
So, I'm stucked again.

I've got a Go port of Recast/Detour (https://github.com/aurelien-rainone/go-detour)
I've build a navmesh of kbengine_ue4_demo map (exported to obj file).
[oleg@white bin]$ ./recast build --input kbengine_ue4_demo.obj

PROG Building navigation:
PROG  - 2191 x 2191 cells
PROG  - 262.1K verts, 508.0K tris
PROG Build Times
PROG - Rasterize                :        2996.35ms        (40.2%)
PROG - Build Compact                :        0.00ms        (0.0%)
PROG - Filter Border                :        0.00ms        (0.0%)
PROG - Filter Walkable                :        0.00ms        (0.0%)
PROG - Erode Area                :        341.00ms        (4.6%)
PROG - Median Area                :        0.00ms        (0.0%)
PROG - Mark Box Area                :        0.00ms        (0.0%)
PROG - Mark Convex Area                :        0.00ms        (0.0%)
PROG - Mark Cylinder Area        :        0.00ms        (0.0%)
PROG - Build Distance Field        :        0.00ms        (0.0%)
PROG     - Distance                :        0.00ms        (0.0%)
PROG     - Blur                        :        0.00ms        (0.0%)
PROG - Build Regions                :        2406.78ms        (32.3%)
PROG     - Watershed                :        0.00ms        (0.0%)
PROG       - Expand                :        0.00ms        (0.0%)
PROG       - Find Basins        :        0.00ms        (0.0%)
PROG     - Filter                :        2185.82ms        (29.3%)
PROG - Build Layers                :        0.00ms        (0.0%)
PROG - Build Contours                :        265.63ms        (3.6%)
PROG     - Trace                :        186.04ms        (2.5%)
PROG     - Simplify                :        40.02ms        (0.5%)
PROG - Build Polymesh                :        155.34ms        (2.1%)
PROG - Build Polymesh Detail        :        272.86ms        (3.7%)
PROG - Merge Polymeshes                :        0.00ms        (0.0%)
PROG - Merge Polymesh Details        :        0.00ms        (0.0%)
PROG === TOTAL:        7.453309367s
PROG >> Polymesh: 16853 vertices  8366 polygons
success
navmesh written to 'navmesh.bin'
[oleg@white bin]$

with the following options:
[oleg@white bin]$ cat recast.yml
cellsize: 23
cellheight: 10
agentheight: 2
agentradius: 0.6
agentmaxclimb: 0.9
agentmaxslope: 45
regionminsize: 8
regionmergesize: 20
edgemaxlen: 12
edgemaxerror: 1.3
vertsperpoly: 6
detailsampledist: 6
detailsamplemaxerror: 1
partitiontype: 1
tilesize: 0
[oleg@white bin]$

Then I've renamed the file into kbengine_ue4_demo.navmesh and put it to res/spaces/kbengine_ue4_demo folder

Then changed scripts/cell/space.py :
                resPath = d_spaces.datas.get(self.spaceUType)['resPath']
                KBEngine.addSpaceGeometryMapping(self.spaceID, None, resPath, True, {0 : "srv_xinshoucun_1.navmesh", 1 : "srv_xinshoucun.navmesh", 7 :  kbengine_ue4_demo.navmesh"})
                #KBEngine.addSpaceGeometryMapping(self.spaceID, None, resPath)

Here is a cellapp log:

    INFO    cellapp01 500 7129652375332859700  [2017-05-07 15:17:30 979] - KBEngine::addSpaceGeometryMapping: spaceID=6, respath=spaces/kbengine_ue4_demo, sh
ouldLoadOnServer=1!
   S_DBG    cellapp01 500 7129652375332859700  [2017-05-07 15:17:30 979] - onSpaceData: spaceID=6, key=_mapping, value=spaces/kbengine_ue4_demo.
   S_DBG    cellapp01 500 7129652375332859700  [2017-05-07 15:17:30 979] - created space[7] entityID = 1109, res = spaces/kbengine_ue4_demo.
    INFO    cellapp01 500 7129652375332859700  [2017-05-07 15:17:30 980] - EntityApp::createEntity: new SpawnPoint 1111
   ERROR    cellapp01 500 7129652375332859700  [2017-05-07 15:17:30 980] - NavMeshHandle::create: open(/home/oleg/kbengine/kbengine_demos_assets/res/spaces/k
bengine_ue4_demo/srv_xinshoucun_1.navmesh) is error!
   ERROR    cellapp01 500 7129652375332859700  [2017-05-07 15:17:30 980] - NavMeshHandle::create: open(/home/oleg/kbengine/kbengine_demos_assets/res/spaces/k
bengine_ue4_demo/srv_xinshoucun.navmesh) is error!
   DEBUG    cellapp01 500 7129652375332859700  [2017-05-07 15:17:30 980] - NavMeshHandle::create: (/home/oleg/kbengine/kbengine_demos_assets/res/spaces/kbeng
ine_ue4_demo/kbengine_ue4_demo.navmesh), layer=7
   ERROR    cellapp01 500 7129652375332859700  [2017-05-07 15:17:30 981] - NavMeshHandle::create: navmesh version(1297302868) is not match(1)!
    INFO    cellapp01 500 7129652375332859700  [2017-05-07 15:17:31 080] - KBEngine::onLoadedSpaceGeometryMapping: spaceID=6, respath=spaces/kbengine_ue4_dem
o!
   S_DBG    cellapp01 500 7129652375332859700  [2017-05-07 15:17:31 080] - onSpaceGeometryLoaded: spaceID=6, mapping=spaces/kbengine_ue4_demo.
   S_DBG    cellapp01 500 7129652375332859700  [2017-05-07 15:17:31 080] - onAllSpaceGeometryLoaded: spaceID=6, isBootstrap=1, mapping=spaces/kbengine_ue4_de
mo.

geometry is not loaded and all entities just standing still.

What i'm doing wrong ?!
Help me please!
Thanks in advance.
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-5-7 19:20:46 | 显示全部楼层
[oleg@white bin]$ ./recast infos srv_xinshoucun.navmesh
error, wrong magic number: 1
[oleg@white bin]$ ./recast infos srv_xinshoucun_1.navmesh
error, wrong magic number: 1
[oleg@white bin]$ ./recast infos navmesh.bin
successfully loaded 'navmesh.bin'
'solo' navmesh infos:
{
  "Orig": [
    -25200,
    100,
    -25200
  ],
  "TileWidth": 50400,
  "TileHeight": 50400,
  "MaxTiles": 1,
  "MaxPolys": 8366
}[oleg@white bin]$

Strange... Different file formats?!
回复

使用道具 举报

8

主题

3374

帖子

7586

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7586
QQ
发表于 2017-5-7 21:45:57 | 显示全部楼层
柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-5-7 22:44:51 | 显示全部楼层
Tried this!

[oleg@white bin]$ ./recast infos all_tiles_navmesh.bin
successfully loaded 'all_tiles_navmesh.bin'
'solo' navmesh infos:
{
  "Orig": [
    -25200,
    100,
    -25200
  ],
  "TileWidth": 749.76,
  "TileHeight": 749.76,
  "MaxTiles": 8192,
  "MaxPolys": 512
}[oleg@white bin]$

Renamed generated all_tiles_navmesh.bin to kbengine_ue4_demo.navmesh and put it to res/spaces/kbengine_ue4_demo folder.
Result is the same:

   INFO    cellapp01 500 7129652375332859700  [2017-05-07 19:35:15 730] - KBEngine::addSpaceGeometryMapping: spaceID=6, respath=spaces/kbengine_ue4_demo, sh
ouldLoadOnServer=1!
   S_DBG    cellapp01 500 7129652375332859700  [2017-05-07 19:35:15 730] - onSpaceData: spaceID=6, key=_mapping, value=spaces/kbengine_ue4_demo.
   S_DBG    cellapp01 500 7129652375332859700  [2017-05-07 19:35:15 730] - created space[7] entityID = 86, res = spaces/kbengine_ue4_demo.
   ERROR    cellapp01 500 7129652375332859700  [2017-05-07 19:35:15 731] - NavMeshHandle::create: open(/home/oleg/kbengine/kbengine_demos_assets/res/spaces/k
bengine_ue4_demo/srv_xinshoucun_1.navmesh) is error!
   ERROR    cellapp01 500 7129652375332859700  [2017-05-07 19:35:15 731] - NavMeshHandle::create: open(/home/oleg/kbengine/kbengine_demos_assets/res/spaces/kbengine_ue4_demo/srv_xinshoucun.navmesh) is error!
   DEBUG    cellapp01 500 7129652375332859700  [2017-05-07 19:35:15 731] - NavMeshHandle::create: (/home/oleg/kbengine/kbengine_demos_assets/res/spaces/kbengine_ue4_demo/kbengine_ue4_demo.navmesh), layer=7
   ERROR    cellapp01 500 7129652375332859700  [2017-05-07 19:35:15 783] - NavMeshHandle::create: navmesh version(1297302868) is not match(1)!
    INFO    cellapp01 500 7129652375332859700  [2017-05-07 19:35:15 830] - KBEngine::onLoadedSpaceGeometryMapping: spaceID=6, respath=spaces/kbengine_ue4_demo!
   S_DBG    cellapp01 500 7129652375332859700  [2017-05-07 19:35:15 830] - onSpaceGeometryLoaded: spaceID=6, mapping=spaces/kbengine_ue4_demo.
   S_DBG    cellapp01 500 7129652375332859700  [2017-05-07 19:35:15 830] - onAllSpaceGeometryLoaded: spaceID=6, isBootstrap=1, mapping=spaces/kbengine_ue4_de
mo.

What else can I do?!
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-5-8 10:14:53 | 显示全部楼层
KBE uses recastnavigation to navigate.

"NavMeshHandle::create: navmesh version(1297302868) is not match(1)!"
This error is due to the fact that the recastnavigation is not recognized, or the version is incorrect.
On this error you can refer to the recastnavigation source code, you can export the navmesh format can be identified by recastnavigation.

               
You can also go to GitHub consulting developer:
https://github.com/recastnavigation/recastnavigation/issues
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-5-8 16:59:51 | 显示全部楼层
One question, pls!

Did you changed the source code of recast navigation somehow?

I'm asking this because there are size differences in source files of recast navigation version 1.4 between your's version (in lib/navigation) and taken from other sources (unreal engine source code for example)!

And I've also noticed the absence of RecastAssert.cpp, DetourAssert.cpp in lib/navigation source tree of kbengine.
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-5-8 17:50:04 | 显示全部楼层
KBE did not change (recastnavigation)
Just version is not the latest (https://github.com/kbengine/recastnavigation)
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

8

主题

3374

帖子

7586

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7586
QQ
发表于 2017-5-8 22:08:21 | 显示全部楼层
DarkWere 发表于 2017-5-8 19:03
I've cloned this particular version above (https://github.com/kbengine/recastnavigation) in order to ...

The current version compiles the recastdemo without any problems, and you need to refer to the readme to generate the project file and compile.

The new version has not been maintained by the original author,so I need to wait for a stable release to be updated.

You can replace the new version yourself

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-5-9 01:12:42 | 显示全部楼层
I've compiled the latest version of recastnavigation with kbengine.
It seems to be working fine, but still reject all versions of my kbengine_ue4_demo navmesh files, with version mismatch message...
srv_xinshoucun.navmesh have been loaded...
回复

使用道具 举报

8

主题

3374

帖子

7586

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7586
QQ
发表于 2017-5-9 08:34:40 | 显示全部楼层
DarkWere 发表于 2017-5-9 01:12
I've compiled the latest version of recastnavigation with kbengine.
It seems to be working fine, but ...

You need to use the recastnavigation, which is used in kbengine, to generate the navmesh through the.obj file.
Version matching recastnavigation, generated by the navmesh file, should not be wrong. Because I didn't modify the recastnavigation source code
柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-5-9 18:40:51 | 显示全部楼层
With all respect to you, guys, and you work, I want you to know the following:

1. I've succeeded to compile the recast demo from recastnavigation repository at kbengine github homepage.
https://yadi.sk/i/65mSkHIi3HtU9D

2. The created navmesh of kbengine_ue4_demo map has the same version as earlier, and it's not "1".
https://yadi.sk/i/hYbr3kV_3HtVUb

3. Your's navmesh files has "1".
https://yadi.sk/i/ez3bwAsK3HtVid

4. It seems to me that problem not in the recastnavigation code, may be in src/lib/navigation/navigation.* code.

5. Can you try to generate kbengine_ue4_demo navmesh for yourself? Just to find out that i'm dumbass!

6. I really appreciate your work, but I need to solve this problem with navmesh's!
Thanks in advance!
回复

使用道具 举报

8

主题

3374

帖子

7586

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7586
QQ
发表于 2017-5-9 21:44:23 | 显示全部楼层
I'm sorry, there may be some misunderstanding. I need to take a time to test it.

The current version of KBE does not have a good support for the UE4 export of navmesh, as well as the problem of UE4 world scale(navmesh) in addition to your current problems
柯标
3603661@qq.com
回复

使用道具 举报

8

主题

3374

帖子

7586

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7586
QQ
发表于 2017-5-9 21:44:27 | 显示全部楼层
I'm sorry, there may be some misunderstanding. I need to take a time to test it.

The current version of KBE does not have a good support for the UE4 export of navmesh, as well as the problem of UE4 world scale(navmesh) in addition to your current problems
柯标
3603661@qq.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|KBEngine Forum

GMT+8, 2018-12-11 16:49 , Processed in 0.037947 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表