Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

NetCode "lag"

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

  1. penow


    Aug 15, 2019
    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


    Unity Technologies

    Jul 13, 2016
    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.