KBEngine官方论坛

 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 配置 开服
楼主: DarkWere

Navigation mesh for UE4

[复制链接]

8

主题

3374

帖子

7586

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7586
QQ
发表于 2017-5-22 17:06:23 | 显示全部楼层
DarkWere 发表于 2017-5-22 16:22
Does it need to set "rangemgr_y" to true in kbengine_defs.xml in order to navmesh to work?

Rangemgr_y only affects (aoi, trap), navigation has no effect
柯标
3603661@qq.com
回复

使用道具 举报

8

主题

3374

帖子

7586

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
7586
QQ
发表于 2017-5-22 17:06:28 | 显示全部楼层
DarkWere 发表于 2017-5-22 16:22
Does it need to set "rangemgr_y" to true in kbengine_defs.xml in order to navmesh to work?

Rangemgr_y only affects (aoi, trap), navigation has no effect
柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-6-4 18:51:26 | 显示全部楼层
Hello everyone!

There is a problem still persist! I've recorded a video, illustrating a problem: https://yadi.sk/i/1-TBflBA3JodeS

In a words: monsters adjusting their height according to players height, not for themselves!

[2017-06-04 15:30:59 802] - KBEngine::addSpaceGeometryMapping: spaceID=6, respath=spaces/kbengine_ue4_demo, shouldLoadOnServer=1!
[2017-06-04 15:30:59 802] - onSpaceData: spaceID=6, key=_mapping, value=spaces/kbengine_ue4_demo.
[2017-06-04 15:30:59 802] - created space[7] entityID = 2086, res = spaces/kbengine_ue4_demo.
[2017-06-04 15:30:59 803] - NavMeshHandle::create: (/home/oleg/kbengine/kbengine_demos_assets/res/spaces/kbengine_ue4_demo/kbengine_ue4_demo.navmesh), layer=0
[2017-06-04 15:30:59 809] -      ==> tiles loaded: 2809
[2017-06-04 15:30:59 809] -      ==> BVTree nodes: 7324
[2017-06-04 15:30:59 809] -      ==> 3662 polygons (12677 vertices)
[2017-06-04 15:30:59 809] -      ==> 21789 triangles (10607 vertices)
[2017-06-04 15:30:59 809] -      ==> 1.30 MB of data (not including pointers)
[2017-06-04 15:30:59 902] - KBEngine::onLoadedSpaceGeometryMapping: spaceID=6, respath=spaces/kbengine_ue4_demo!
[2017-06-04 15:30:59 902] - onSpaceGeometryLoaded: spaceID=6, mapping=spaces/kbengine_ue4_demo.
[2017-06-04 15:30:59 902] - onAllSpaceGeometryLoaded: spaceID=6, isBootstrap=1, mapping=spaces/kbengine_ue4_demo.
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-6-4 19:21:41 | 显示全部楼层
DarkWere 发表于 2017-6-4 18:51
Hello everyone!

There is a problem still persist! I've recorded a video, illustrating a problem: ht ...

This is because on the client side, when entity.isGround = true, the server will optimize the traffic, do not synchronize the Y value, you need to force the entity to be placed on the ground.
https://github.com/kbengine/kben ... /KBEngine.cpp#L2618

Calling the navigation function on the server side will be automatically set to isGround = true. Position.x = x or moveToPoint, will be set to false.
The player's isGround property is set by the client, the other set by the server,
https://github.com/kbengine/kben ... r/KBEngine.cs#L1970


热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-6-4 20:58:43 | 显示全部楼层
I didn't get it.
I need to set isOnGround = false on client side?
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-6-4 21:39:46 | 显示全部楼层
DarkWere 发表于 2017-6-4 20:58
I didn't get it.
I need to set isOnGround = false on client side?

No,
Non-player entities are automatically set by the server. You need to judge this property, is true, you need to force the monster to the ground
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-6-4 22:15:47 | 显示全部楼层
Sorry to bother you again, but i still don't understand the problem.

Can you point me into standard kbengine_ue4_demo code where to fix this behaviour of the monsters?

I'll be very grateful for your help!
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-6-5 08:41:45 | 显示全部楼层
DarkWere 发表于 2017-6-4 22:15
Sorry to bother you again, but i still don't understand the problem.

Can you point me into standard ...

Can you give me this demo of navmesh? I will improve the behavior of this demo
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-6-5 10:59:54 | 显示全部楼层
Yes, sure!

kbengine_ue4_demo.obj - https://yadi.sk/d/NJf-ujxD3Jpciu

kbengine_ue4_demo.navmesh - https://yadi.sk/d/Ezr_VxSj3Jpcjp

回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-6-5 14:01:53 | 显示全部楼层
You changed the kbengine_ue4_demo map?
回复

使用道具 举报

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-6-5 15:05:07 | 显示全部楼层
Yes, give me some time.

I'll record a video about algorithm.
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-6-5 15:32:50 | 显示全部楼层
About the algorithm and video. I have some difficulties with recording the video, that's why I'll explain by words.

I'm choosing the landscape from the list of actors, and then shrinking the scale from 100 to 1 in all three dimensions.
And i also replace the whole Landscape from -25200.0000 cm, -25200.0000 cm, 100.0000 cm to -252.0000 cm, -252.0000 cm, 1.0000 cm.
Then I'm exporting this landscape into OBJ file, it is exporting like it has metres as scale units.
After that i'm using RecastDemo to generate tile navmesh.
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-6-5 15:51:35 | 显示全部楼层
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-6-5 15:53:43 | 显示全部楼层
DarkWere 发表于 2017-6-5 15:32
About the algorithm and video. I have some difficulties with recording the video, that's why I'll ex ...

OK, I have successfully exported it
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-6-5 20:18:39 | 显示全部楼层
I've updated the demo. The monsters are still flying in the air...
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-6-5 23:37:41 | 显示全部楼层
Oh, sorry! Monsters are moving on the ground...
But... I thought that height position of the monsters would be set by server based on navigation mesh.
You made it by client scripts.
I think this is not a good idea... Cheaters would be happy!
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-6-6 10:20:01 | 显示全部楼层
DarkWere 发表于 2017-6-5 23:37
Oh, sorry! Monsters are moving on the ground...
But... I thought that height position of the monster ...

This reduces the transmission cost of Y, and when the number of entities on the same screen is particularly large, the benefits are very large
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

30

主题

7138

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
16457
QQ
发表于 2017-6-6 10:28:52 | 显示全部楼层
In addition, since the navmesh mesh on the server is usually of lower accuracy, the client always needs to be forcibly placed on the ground.
热爱游戏、热爱开源!
柯标
3603661@qq.com

柯标
3603661@qq.com
回复

使用道具 举报

11

主题

96

帖子

813

积分

高级会员

Rank: 4

积分
813
 楼主| 发表于 2017-6-6 13:22:43 | 显示全部楼层
What to do if I need the Y transmitted?

Another question: does a navmesh handling working on server? How can I be sure if server doesn't transmit Y and entities a leveled by client!
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|KBEngine Forum

GMT+8, 2018-12-15 01:08 , Processed in 0.032608 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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