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

Trouble getting started with NetCode

Discussion in 'Multiplayer' started by chatrat12, May 29, 2020.

  1. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    Trying to follow this guide: Getting started with NetCode

    I'm on Unity 2019.3.15f1

    I'm getting these errors:
    upload_2020-5-29_15-17-13.png
    Looks like the entire Networking namespace is missing and an issue with a call to NativeHashMap.Length not being a thing.

    The guide says to install the packages: Entities, Hybrid Renderer, Unity NetCode, and Unity Transport. All packages are up to date.

    Anyone now what the issue is?
     

    Attached Files:

  2. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    I believe the root cause is the first 3 errors about the NativeHashMap. That error making the Transport fail to compile and NetCode depends on the transport.
     
  3. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    Did more digging. Turns out
    NativeHashMap
    is part of a package named
    collections
    . From the collections change log on the latest update that happened on the 25th:

    Removed

    • Removed expired APIs for UnsafeHashMap.Length
    • Removed expired APIs for NativeHashMap.Length
    Entities and Jobs depend on the latest Collections. Going to try and roll back all 3 to see if it fixes my issues
     
  4. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    Just getting more errors :\
     
  5. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    Manually fixed the Transport package to get it to work. More info here
     
  6. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    Now NetCode is calling `ArchetypeChunk.GetComponentVersion` instead of `ArchetypeChunk.GetChangeVersion`. After fixing that I get the following error:


    InvalidOperationException: Group of type Unity.NetCode.ClientSimulationSystemGroup has not been created, either the derived class forgot to call base.OnCreate(), or it has been destroyed
    Unity.Entities.ComponentSystemGroup.CheckCreated () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:67)
    Unity.Entities.ComponentSystemGroup.AddSystemToUpdateList (Unity.Entities.ComponentSystemBase sys) (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:72)
    Unity.NetCode.ClientServerBootstrap.CreateClientWorld (Unity.Entities.World defaultWorld, System.String name) (at Library/PackageCache/com.unity.netcode@0.1.0-preview.6/Runtime/ClientServerWorld/ClientServerBootstrap.cs:86)
    Unity.NetCode.ClientServerBootstrap.Initialize (System.String defaultWorldName) (at Library/PackageCache/com.unity.netcode@0.1.0-preview.6/Runtime/ClientServerWorld/ClientServerBootstrap.cs:51)
    Unity.Entities.DefaultWorldInitialization.Initialize (System.String defaultWorldName, System.Boolean editorWorld) (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities.Hybrid/Injection/DefaultWorldInitialization.cs:97)
    Unity.Entities.AutomaticWorldBootstrap.Initialize () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities.Hybrid/Injection/AutomaticWorldBootstrap.cs:15)