Search Unity

[Fixed] Lag when testing on server

Discussion in 'Multiplayer' started by Nitugard, Mar 7, 2017.

  1. Nitugard

    Nitugard

    Joined:
    May 10, 2015
    Posts:
    343
    Hello,

    I'm developing a large multiplayer game and I'm getting really strange errors since I feel they should not be there. The lag would kick in after few minutes and it would grow and grow.

    [Here was a lot of info which I removed due to problem being solved]

    For future reference errors I was getting was depending on network manager configuration: NoResources, SendBytesToReadyFailed, BufferLimitReached, Channels not initialized...and so on...

    How I fixed the errors is I compressed everything, instead of using short I used byte :D
    Then I checked out the profiler which helped me the most. In profiler I saw one type of message being sent every fixed frame which probably caused network to fail, I changed that message to be sent only when it needs to be sent (and that is every 0.1f second or on state change in my case).

    Here is the settings I used if anyone struggles to make stable network.
    settings2.PNG settings.PNG
     
    Last edited: Mar 8, 2017
  2. siblingrivalry

    siblingrivalry

    Joined:
    Nov 25, 2014
    Posts:
    384
  3. Nitugard

    Nitugard

    Joined:
    May 10, 2015
    Posts:
    343
    siblingrivalry likes this.