Search Unity

Question Increase buffer size NetworkList

Discussion in 'Multiplayer' started by HRDev, Feb 9, 2022.

  1. HRDev

    HRDev

    Joined:
    Jun 4, 2018
    Posts:
    58
    I have to pass a lot of players data in a NetworkList.
    All works with low data, but when i increes the variables in the struct i recive this error:

    Code (CSharp):
    1. OverflowException: Writing past the end of the buffer
    2. Unity.Netcode.NetworkList`1[T].WriteDelta (Unity.Netcode.FastBufferWriter writer) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.5/Runtime/NetworkVariable/Collections/NetworkList.cs:125)
    is there any way to increase the buffer size?
     
  2. cerestorm

    cerestorm

    Joined:
    Apr 16, 2020
    Posts:
    666
    This is an on-going issue which has been mentioned several times. I've created a test project that reproduces the issue and attached it to a bug report so hopefully that will be picked up and the problem fixed.
     
    HRDev likes this.
  3. HRDev

    HRDev

    Joined:
    Jun 4, 2018
    Posts:
    58
    there is no work around?
     
  4. cerestorm

    cerestorm

    Joined:
    Apr 16, 2020
    Posts:
    666
    You could limit the amount you add to the list in one go, that would likely work.

    Btw I did bug this and apparently it's fixed already, but I think there's a block on merging it into a release (someone from Unity would have to clarify this).