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

Resolved Build success but .exe crash?!

Discussion in 'Entity Component System' started by tassarho, Jul 24, 2022.

  1. tassarho

    tassarho

    Joined:
    Aug 25, 2019
    Posts:
    64
    So i have the most simple scene you can possibly have:
    upload_2022-7-24_12-27-43.png

    PS: The terrain is the only element converted to entity
    upload_2022-7-24_12-36-9.png
    No Script (except convert to entity)

    No Error OnPlayMode
    No Error on Build

    But when executing the exe, it just crash?!?!?!
    Build Settings:

    upload_2022-7-24_12-29-59.png

    I tried everything, tweaks conversion settings in every way possible, but i don't get how a scene that simple can crash?
    upload_2022-7-24_12-32-41.png
     

    Attached Files:

  2. tassarho

    tassarho

    Joined:
    Aug 25, 2019
    Posts:
    64
    For reason i can't explain using Latios Bootsrap Does solve the issue?!

    Code (CSharp):
    1.     [UnityEngine.Scripting.Preserve]
    2.     public class LatiosConversionBootstrap : ICustomConversionBootstrap
    3.     {
    4.         public bool InitializeConversion(World conversionWorldWithGroupsAndMappingSystems, CustomConversionSettings settings, ref List<Type> filteredSystems)
    5.         {
    6.             GameObjectConversionGroup defaultGroup = conversionWorldWithGroupsAndMappingSystems.GetExistingSystem<GameObjectConversionGroup>();
    7.             BootstrapTools.InjectSystems(filteredSystems, conversionWorldWithGroupsAndMappingSystems, defaultGroup);
    8.  
    9.             Latios.Psyshock.Authoring.PsyshockConversionBootstrap.InstallLegacyColliderConversion(conversionWorldWithGroupsAndMappingSystems);
    10.             Latios.Kinemation.Authoring.KinemationConversionBootstrap.InstallKinemationConversion(conversionWorldWithGroupsAndMappingSystems);
    11.             return true;
    12.         }
    13.     }
    14.  
    15.     [UnityEngine.Scripting.Preserve]
    16.     public class LatiosBootstrap : ICustomBootstrap
    17.     {
    18.         public unsafe bool Initialize(string defaultWorldName)
    19.         {
    20.             LatiosWorld world = new LatiosWorld(defaultWorldName);
    21.             World.DefaultGameObjectInjectionWorld = world;
    22.  
    23.             List<Type> systems = new List<Type>(DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.Default));
    24.             BootstrapTools.InjectSystems(systems, world, world.simulationSystemGroup);
    25.  
    26.             CoreBootstrap.InstallImprovedTransforms(world);
    27.             Latios.Myri.MyriBootstrap.InstallMyri(world);
    28.             Latios.Kinemation.KinemationBootstrap.InstallKinemation(world);
    29.  
    30.             world.initializationSystemGroup.SortSystems();
    31.             world.simulationSystemGroup.SortSystems();
    32.             world.presentationSystemGroup.SortSystems();
    33.  
    34.             ScriptBehaviourUpdateOrder.AppendWorldToCurrentPlayerLoop(world);
    35.             return true;
    36.         }
    37.     }

    Still investigating but seems the default world/systems are the issue?
     
  3. apkdev

    apkdev

    Joined:
    Dec 12, 2015
    Posts:
    263
    Please at least attach the crash log. It's impossible to diagnose the crash without it.

    You shouldn't be using the Build Settings window for building your project when using ECS. See the instructions here:
    https://docs.unity3d.com/Packages/com.unity.entities@0.51/manual/ecs_building_projects.html

     
  4. darkAbacus247

    darkAbacus247

    Joined:
    Sep 7, 2010
    Posts:
    251
    ..
    ...wait, WHAT?
    I'm hitting this error trying unity 2021+ without anything imported other than entities. I've never followed this setup. I'll do so asap to see if I royaly oopsied here but...why now? I've just been using the normal build options.

    Unfortunately I'm remote atm so can't provide valid data but it's that straight forward. Install unity 2021.x (HDRP), import entities & build. Success without error, exe crashes on launch no real mentions of why in dump. I can upload later tho...
     
  5. Occuros

    Occuros

    Joined:
    Sep 4, 2018
    Posts:
    284
    If you are using entities before 1.0.0 you can’t use the normal unity build options you need to use the custom build setup for entities.

    if you do want to use the default unity build you need to use the editor 2022.x (currently in beta) and entities 1.0
     
  6. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,653
    That's incorrect. Before 1.0 you need build options if you using SubScenes (which most of users don't use) otherwise you can build through normal pipeline without issues (Win which is his case because of exe). Our game built through classic pipeline without issues since the beginning up to 1.0
     
    Occuros and xVergilx like this.
  7. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,292
    If Entities were built prior to 1.0.0 via build settings - resource catalog won't be built, hence causing an exception upon bootstrap, when its been called into.

    Subscenes features won't be available in this case, and as for the exception handling - depends on the platform.

    Android / iOS it just crashes on launch in release mode.
    Dev throws an exception into native log & runs fine.

    Standalone PC - throws an exception to the log and I assume runs fine if subscenes not used (for development build) and will crash as well in release.

    If you're using a custom bootstrap, its possible to run without subscenes / conversion.
    That's what I've did prior to 1.0.0.
     
  8. darkAbacus247

    darkAbacus247

    Joined:
    Sep 7, 2010
    Posts:
    251