Search Unity

NetCode "lag"

Discussion in 'NetCode for ECS' started by penow, Feb 7, 2020.

  1. penow

    penow

    Joined:
    Aug 15, 2019
    Posts:
    1
    Hi, please watch the video. Does anyone have an idea why it is "lagging"? Both server and client are running at 60fps, server and network tick rates are 60. It is happening at about 300 and more entities (for example 290 entities no lag) synchronized using GhostComponent, in the editor and also in the build. It seems that the problem is at server side, but I can't figure it out where. Probably some sending queue limits? Thanks for any help.
     

    Attached Files:

  2. timjohansson

    timjohansson

    Unity Technologies

    Joined:
    Jul 13, 2016
    Posts:
    473
    It looks like you are just sending too many entities. The netcode has a fixed bandwidth limit, when you go above that you no longer send all entities every frame.
    If you open `Multiplayer > Open NetDbg` in the menu and connect you should see the size of your snapshots and see if they are too big to send.
    You can change your data to compress better by sending less state or changing the quantization. You can also setup distance based priority to control which entities get the most frequent updates. Another option would be to increase the interpolation delay so the fact that entities are split up is less obvious. I am not sure if we are exposing the interpolation delay as an easy to access setting right now though.
     
    penow likes this.