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
  3. Dismiss Notice

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

    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:
    522
    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:
    10
    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
     
  8. edin97

    edin97

    Joined:
    Aug 9, 2021
    Posts:
    58
    Hello,
    I still get this issue, (netcode 1.0.0prev6) unity 2020.3.15f2,I'm using steam transport and not instantiating any GameObjects. It seems to happen when client and host are first connected and then the client leaves abruptly and comes back, sometimes you get this error, sometimes you don't. When it happens, the host is stuck in an error loop, and needs to restart his game. Which is pretty annoying because majority of the time, restarting doesn't work. Host needs to wait some time idk like 1 minute before executing StartHost() again. full error :

    Code (CSharp):
    1. KeyNotFoundException: The given key was not present in the dictionary.
    2. System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    3. Unity.Netcode.NetworkManager.TransportIdToClientId (System.UInt64 transportId) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.6/Runtime/Core/NetworkManager.cs:1340)
    4. 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.6/Runtime/Core/NetworkManager.cs:1413)
    5. Unity.Netcode.NetworkManager.OnNetworkEarlyUpdate () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.6/Runtime/Core/NetworkManager.cs:1232)
    6. Unity.Netcode.NetworkManager.NetworkUpdate (Unity.Netcode.NetworkUpdateStage updateStage) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.6/Runtime/Core/NetworkManager.cs:1207)
    7. Unity.Netcode.NetworkUpdateLoop.RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage updateStage) (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.6/Runtime/Core/NetworkUpdateLoop.cs:149)
    8. Unity.Netcode.NetworkUpdateLoop+NetworkEarlyUpdate+<>c.<CreateLoopSystem>b__0_0 () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.6/Runtime/Core/NetworkUpdateLoop.cs:172)
    full stack enabled, no more informations than this.
    I was able to get this error consistently : leave as a client by pressing play button, purposly let one variable unassigned that you'll call on ApplicationQuit, while closing your game, it give your an error. Press Play again, join host and you just stun locked the host, great.
    Any information if this is fixed in newer versions ? if not i'll keep looking if it's my mistake but yeah... Thanks in advance.