Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug Basic Bug on Client Side on Version 1.0.0-pre.5

Discussion in 'Netcode for GameObjects' started by unity_J7UBxyoDuGVd7w, Feb 1, 2022.

  1. unity_J7UBxyoDuGVd7w

    unity_J7UBxyoDuGVd7w

    Joined:
    Apr 12, 2018
    Posts:
    3
    Hi I get a basic crash bug on the above version.

    Repro:
    1. Create a new scene in Unity version 2020.3.27f1
    2. Install the Network for Game Objects Version 1.0.0-pre.5 over the packet manager
    3. Create an empty GameObject and name it NetworkManager
    4. Add NetworkManager Component
    5. Select the UNetTransport Layer
    6. Start Game
    7. In NetworkManager press Start Client
    8. Wait approx 1 minute
    Then the following crash happens:





    KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    Unity.Netcode.NetworkManager.TransportIdToClientId (System.UInt64 transportId) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.5/Runtime/Core/NetworkManager.cs:1329)
    Unity.Netcode.NetworkManager.HandleRawTransportPoll (Unity.Netcode.NetworkEvent networkEvent, System.UInt64 clientId, System.ArraySegment`1[T] payload, System.Single receiveTime) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.5/Runtime/Core/NetworkManager.cs:1398)
    Unity.Netcode.NetworkManager.OnNetworkEarlyUpdate () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.5/Runtime/Core/NetworkManager.cs:1221)
    Unity.Netcode.NetworkManager.NetworkUpdate (Unity.Netcode.NetworkUpdateStage updateStage) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.5/Runtime/Core/NetworkManager.cs:1196)
    Unity.Netcode.NetworkUpdateLoop.RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage updateStage) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.5/Runtime/Core/NetworkUpdateLoop.cs:149)
    Unity.Netcode.NetworkUpdateLoop+NetworkEarlyUpdate+<>c.<CreateLoopSystem>b__0_0 () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.5/Runtime/Core/NetworkUpdateLoop.cs:172)
     
  2. luke-unity

    luke-unity

    Unity Technologies

    Joined:
    Sep 30, 2020
    Posts:
    306
  3. Harrier

    Harrier

    Joined:
    May 11, 2015
    Posts:
    8
    I have same error, but probably different cause.
    I made report, here is ticker number: 1404630_kjm7fjtf2a9hmrn7
     
    Last edited: Mar 8, 2022
  4. MiTschMR

    MiTschMR

    Joined:
    Aug 28, 2018
    Posts:
    75
    Just saying, you shouldn't share the link to the fogbugz pages. The conversation there may contain confidential information like email addresses. Simply posting the ticket number is enough.
     
  5. athensM

    athensM

    Joined:
    Mar 18, 2021
    Posts:
    6
    Hi,

    Just to add that I am encountering this issue as well. I upgraded my project from MLAPI 0.1.0 to Netcode for GameObjects and started encountering this issue.

    Edit:
    I think I might have solved this. I upgraded to Netcode for GameObjects using this guide (Upgrade Guide from MLAPI 0.1.0 to Netcode for GameObjects 1.0.0 | Unity Multiplayer Networking (unity3d.com))

    According to the guide, installing the com.unity.netcode.gameobjects package should also install the com.unity.netcode.adapter.utp package. However, as of this writing, it does not install com.unity.netcode.adapter.utp.

    I went to the package manager, clicked on the "+" sign, and added com.unity.netcode.adapter.utp as a package by name. After installing com.unity.netcode.adapter.utp, I created an empty GameObject in the scene, added the component "Unity Transport" to it, and then set the NetworkManager to use this script as the "Network Transport".

    This seems to have solved the above issue. I came to this by downloading BossRoom, and following the code from BossRoom.
     
    Last edited: Feb 21, 2022
  6. unity_J7UBxyoDuGVd7w

    unity_J7UBxyoDuGVd7w

    Joined:
    Apr 12, 2018
    Posts:
    3
    Hi,

    I encountered the issue several times again. It seems to take place if an update message would be too large. This easily happens, if you attach a client to a host, that is already running the game for some time. For instance if a larger number of objects has been spawned in the mean time (approx larger 30) this causes this type of problem.
     
  7. Louiebloo

    Louiebloo

    Joined:
    Jan 26, 2022
    Posts:
    4
    I am also experiencing this issue. Its easily produced if you just keep adding gameobjects to the scene before running and at some point when you connect the client it will throw this error. Making it very hard to develop
     
unityunity