Search Unity

Dots Netcode: iOS client build can't add systems to ClientAndServerSimulationGroup

Discussion in 'Multiplayer' started by AdamBebko, Dec 2, 2020.

  1. AdamBebko

    AdamBebko

    Joined:
    Apr 8, 2016
    Posts:
    168
    I'm building to iOS, and on program start every system that updates in a Server group or a ClientAndServer group won't load. The systems in ClientSimulationGroup and ClientInitializationGroup work fine. Some of the affected systems are my own but the majority are built into DotsNetcode itself.

    Edit: Just wanted to add everything works great in the editor, and I tried adding UNITY_CLIENT to the scripting define symbols, which didn't help.

    Here's an example system I created

    Code (CSharp):
    1. [UpdateInGroup(typeof(ClientAndServerSimulationSystemGroup))]
    2.     public class TestSystem : ComponentSystem {
    3.         protected override void OnUpdate() {
    4.             Debug.Log("Updating");
    5.         }
    6.     }
    Which produces an error in Xcode, and also doesn't print "updating" every frame

    Code (CSharp):
    1. A system Networking.TestSystem wants to execute in Unity.NetCode.ClientAndServerSimulationSystemGroup but this group has [DisableAutoCreation] and Networking.TestSystem does not. The system will not be added to any group and thus not update.
    2. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    3. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    4. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    Does anyone know how to get this to work?

    Here is the full Xcode error output:

    Edit: Using netcode 0.5.0

    Code (CSharp):
    1. A system Unity.NetCode.NetworkStreamCloseSystem wants to execute in Unity.NetCode.ClientAndServerSimulationSystemGroup but this group has [DisableAutoCreation] and Unity.NetCode.NetworkStreamCloseSystem does not. The system will not be added to any group and thus not update.
    2.  
    3. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    4.  
    5. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    6.  
    7. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    8.  
    9.  
    10. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    11.  
    12.  
    13. A system Unity.NetCode.GhostSendSystem wants to execute in Unity.NetCode.ServerSimulationSystemGroup but this group has [DisableAutoCreation] and Unity.NetCode.GhostSendSystem does not. The system will not be added to any group and thus not update.
    14.  
    15. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    16.  
    17. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    18.  
    19. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    20.  
    21.  
    22. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    23.  
    24.  
    25. A system Unity.NetCode.Generated.GhostComponentSerializerRegistrationSystem wants to execute in Unity.NetCode.ClientAndServerInitializationSystemGroup but this group has [DisableAutoCreation] and Unity.NetCode.Generated.GhostComponentSerializerRegistrationSystem does not. The system will not be added to any group and thus not update.
    26.  
    27. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    28.  
    29. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    30.  
    31. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    32.  
    33.  
    34. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    35.  
    36.  
    37. A system Unity.Transforms.Generated.GhostComponentSerializerRegistrationSystem wants to execute in Unity.NetCode.ClientAndServerInitializationSystemGroup but this group has [DisableAutoCreation] and Unity.Transforms.Generated.GhostComponentSerializerRegistrationSystem does not. The system will not be added to any group and thus not update.
    38.  
    39. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    40.  
    41. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    42.  
    43. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    44.  
    45.  
    46. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    47.  
    48.  
    49. A system Networking.ServerDetectDisconnectSystem wants to execute in Unity.NetCode.ServerSimulationSystemGroup but this group has [DisableAutoCreation] and Networking.ServerDetectDisconnectSystem does not. The system will not be added to any group and thus not update.
    50.  
    51. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    52.  
    53. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    54.  
    55. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    56.  
    57.  
    58. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    59.  
    60.  
    61. A system Assembly_CSharp.Generated.GhostComponentSerializerRegistrationSystem wants to execute in Unity.NetCode.ClientAndServerInitializationSystemGroup but this group has [DisableAutoCreation] and Assembly_CSharp.Generated.GhostComponentSerializerRegistrationSystem does not. The system will not be added to any group and thus not update.
    62.  
    63. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    64.  
    65. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    66.  
    67. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    68.  
    69.  
    70. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
     
    Last edited: Dec 2, 2020
  2. AdamBebko

    AdamBebko

    Joined:
    Apr 8, 2016
    Posts:
    168
    Update: I've reproduced this issue in an empty project

    . upload_2020-12-3_13-7-21.png

    I added a single system:

    Code (CSharp):
    1. using Unity.Entities;
    2. using Unity.NetCode;
    3. using UnityEngine;
    4.  
    5.  
    6. [UpdateInGroup(typeof(ClientAndServerSimulationSystemGroup))]
    7. public class testsystem : ComponentSystem
    8. {
    9.     protected override void OnUpdate() {
    10.         Debug.Log("Updating test system");
    11.     }
    12. }
    13.  

    Building to IOS yields the following in Xcode console:


    Code (CSharp):
    1. 2020-12-03 12:51:02.970217-0500 NewUnityProject[12310:1297840] Built from '2020.1/staging' branch, Version '2020.1.15f1 (97d0ae02d19d)', Build type 'Release', Scripting Backend 'il2cpp'
    2. -> applicationDidFinishLaunching()
    3. -> applicationDidBecomeActive()
    4. GfxDevice: creating device client; threaded=1
    5. Initializing Metal device caps: Apple A12X GPU
    6. Initialize engine version: 2020.1.15f1 (97d0ae02d19d)
    7. 2020-12-03 12:51:03.168030-0500 NewUnityProject[12310:1298078] fopen failed for data file: errno = 2 (No such file or directory)
    8. 2020-12-03 12:51:03.168073-0500 NewUnityProject[12310:1298078] Errors found! Invalidating cache...
    9. 2020-12-03 12:51:03.564749-0500 NewUnityProject[12310:1298078] fopen failed for data file: errno = 2 (No such file or directory)
    10. 2020-12-03 12:51:03.564799-0500 NewUnityProject[12310:1298078] Errors found! Invalidating cache...
    11. 2020-12-03 12:51:03.754291-0500 NewUnityProject[12310:1297840] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x109127200>.
    12. UnloadTime: 4.212375 ms
    13. TypeManager.Initialize took: 282ms
    14. A system Unity.NetCode.NetworkStreamCloseSystem wants to execute in Unity.NetCode.ClientAndServerSimulationSystemGroup but this group has [DisableAutoCreation] and Unity.NetCode.NetworkStreamCloseSystem does not. The system will not be added to any group and thus not update.
    15. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    16. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    17. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    18. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    19.  
    20. A system Unity.NetCode.GhostSendSystem wants to execute in Unity.NetCode.ServerSimulationSystemGroup but this group has [DisableAutoCreation] and Unity.NetCode.GhostSendSystem does not. The system will not be added to any group and thus not update.
    21. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    22. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    23. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    24. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    25.  
    26. A system Unity.NetCode.Generated.GhostComponentSerializerRegistrationSystem wants to execute in Unity.NetCode.ClientAndServerInitializationSystemGroup but this group has [DisableAutoCreation] and Unity.NetCode.Generated.GhostComponentSerializerRegistrationSystem does not. The system will not be added to any group and thus not update.
    27. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    28. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    29. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    30. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    31.  
    32. A system Unity.Transforms.Generated.GhostComponentSerializerRegistrationSystem wants to execute in Unity.NetCode.ClientAndServerInitializationSystemGroup but this group has [DisableAutoCreation] and Unity.Transforms.Generated.GhostComponentSerializerRegistrationSystem does not. The system will not be added to any group and thus not update.
    33. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    34. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    35. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    36. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    37.  
    38. A system testsystem wants to execute in Unity.NetCode.ClientAndServerSimulationSystemGroup but this group has [DisableAutoCreation] and testsystem does not. The system will not be added to any group and thus not update.
    39. Unity.Entities.DefaultWorldInitialization:FindGroup(World, Type, Attribute)
    40. Unity.Entities.DefaultWorldInitialization:AddSystemToRootLevelSystemGroupsInternal(World, IEnumerable`1, Int32)
    41. Unity.Entities.DefaultWorldInitialization:Initialize(String, Boolean)
    42. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    43.  
     
  3. AdamBebko

    AdamBebko

    Joined:
    Apr 8, 2016
    Posts:
    168
    Update: I managed to fix this error. It seems to be an issue with the default bootstrapper. The one listed in the NetCube tutorial didn't work. Here is the bootstrapper I used. Thanks to @florianhanke . Note the #if at the top of the file, to have it only run in IOS builds.

    Code (CSharp):
    1. #if UNITY_IOS &&  !UNITY_EDITOR
    2. using Unity.Entities;
    3. using Unity.NetCode;
    4. using UnityEngine;
    5.  
    6.  
    7. public class IOsBootstrap : ClientServerBootstrap {
    8.  
    9.     public override bool Initialize(string defaultWorldName)
    10.         {
    11.  
    12.             Debug.Log("Initializing typemanager");
    13.             TypeManager.Initialize();
    14.  
    15.             Debug.Log("getting all systems");
    16.             var systems = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default);
    17.      
    18.             Debug.Log("generating all system lists");
    19.             GenerateSystemLists(systems);
    20.  
    21.             Debug.Log("creating default world");
    22.             var world = new World(defaultWorldName);
    23.             World.DefaultGameObjectInjectionWorld = world;
    24.  
    25.             Debug.Log("Initializing default world");
    26.             DefaultWorldInitialization.AddSystemsToRootLevelSystemGroups(world, ExplicitDefaultWorldSystems);
    27.      
    28.             Debug.Log("updating player loop");
    29.             ScriptBehaviourUpdateOrder.UpdatePlayerLoop(world);
    30.  
    31.             Debug.Log("creating client world");
    32.             CreateClientWorld(world, "Client");
    33.             return true;
    34.         }
    35.  
    36.  
    37. }
    38.  
    39. #endif