UE4 Actor Replication(同步)的性能问题 - 纳金网
联系我们

给我们留言

联系我们

地址:福建省晋江市青阳街道洪山路国际工业设计园纳金网

邮箱:info@narkii.com

电话:0595-82682267

(周一到周五, 周六周日休息)

当前位置:主页 > 3D教程 > 图文教程

UE4 Actor Replication(同步)的性能问题

来源: 52vr | 责任编辑:传说的落叶 | 发布时间: 2019-06-06 08:26 | 浏览量:

[UE4]Actor Replication(同步)的性能问题

 

看了下相关文档,UE自带的Replication机制效率还是很低的,UE为了提供通用的同步功能,这个Replication实现的非常简单粗暴,如果是承载客户端链接很多的项目,这个Replication貌似不可取,最好还是根据自己的项目需求自己实现一套同步机制。
 

关掉Replication:
AActor::SetReplicates( false )

如果实在要用Replication,可以降低更新频率来提升效率:
AActor::NetUpdateFrequency()

 

2016-03-29补充:

v4.4开始,shipping编译出来的版本,会自动禁用Replication,所以如果是对通信性能较高的项目,Replication不要用,只能作为测试工具使用。

Dedicated server connection

https://answers.unrealengine.com/questions/70015/dedicated-server-connection.html

 

官方解释:

Performance and Bandwidth Tips

https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Actors/ReplicationPerformance/

 

 

When gathering actors for replication, the server will check a few things like relevancy, update frequency, dormancy, etc. You can tweak any of these checks to affect performance. When thinking about making this process as efficient as possible, it's best to prioritize in this order:

  • Turning off replication (AActor::SetReplicates( false ))

    • When is actor is not replicating, it's not on the list in the first place, so this is the biggest win, to make sure actors that don't need to replicate are marked as such.

  • Lower NetUpdateFrequency value

    • The less an actor updates, the less time it takes to update. It's best to make this number as low as possible. This number represents how often per second this actor will replicate to clients.

  • Dormancy

  • Relevancy

  • NetClientTicksPerSecond

Don't mark properties to replicate if they aren't absolutely necessary. It's best to try and derive state from existing replicated properties when possible.

Try to take advantage of the quantization functionality that already exists. e.g. FVector_NetQuantize. These will greatly reduce the size needed to replicate this state over to clients, and if used properly, shouldn't cause any noticeable artifacts.

FNames are not generally compressed, so when you are using them as parameters to RPCs, keep in mind that they will generally send the string each call. This can be a lot of overhead.

 

另一篇关于UE的Replication解释:
Everything you ever wanted to know about replication (but were afraid to ask)

https://wiki.beyondunreal.com/Everything_you_ever_wanted_to_know_about_replication_(but_were_afraid_to_ask)#Thi


相关文章
网友评论

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

关闭

全部评论:0条

推荐
热门