Search Unity

Official Experimental Entities 1.0 is available

Discussion in 'Entity Component System' started by mfuad, Sep 26, 2022.

Thread Status:
Not open for further replies.
  1. djhatvr

    djhatvr

    Joined:
    Sep 22, 2019
    Posts:
    53
    What is the ETA ballpark of 2022.2?
     
  2. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    585
     
  3. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    I'm testing the new occlusion system and I'm seeing some very buggy behavior. Here is a video showing it. I'm going to test it in the viking village tomorrow. https://streamable.com/ar7avo
    Perhaps I'm doing something wrong here? The readme states " note that there are Occluder and Occludee components attached to the MeshRenderer" but no Occludee component exists in the Entities.Graphics package.
     
  4. BuzzJive

    BuzzJive

    Joined:
    Mar 6, 2014
    Posts:
    75
    Yes for 0.50 and 0.51 - have not tried 1.0 yet. Here's my player settings and package list to compare against. I'm using Unity 2020.3.38. 2021 did NOT work when I tried it a while back.
    upload_2022-10-4_10-30-41.png
     
    PolarTron likes this.
  5. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    Does this package come with in-editor documentation, or is it just online right now? I'm not getting any descriptions in my Intellisense popups in VSCode for the ECS methods.
     
  6. cjddmut

    cjddmut

    Joined:
    Nov 19, 2012
    Posts:
    179
    Has work been done for 1.0 to increase the performance of scheduling jobs? I'm beginning to find in my current project that the performance bottleneck is all the systems scheduling as oppose to the actual work they do.
     
  7. skiplist

    skiplist

    Joined:
    Nov 9, 2014
    Posts:
    46
    Yep, Unity wrote something about it here for example.
     
    elliotc-unity likes this.
  8. Luxxuor

    Luxxuor

    Joined:
    Jul 18, 2019
    Posts:
    89
    Regarding the new data modes in 2022.2: Is there a way to get what data mode you are currently in from script?
    I have a custom tool that injects a simple search bar into the inspector header (got the idea and API from the old "Convert to Entity" checkmark) but it only makes sense in the authoring or mixed view but not in the Runtime. Also it breaks the UI in the Runtime mode so I would like to hide it when in that mode.
     
  9. ParhamXTT

    ParhamXTT

    Joined:
    May 24, 2020
    Posts:
    28
    ECS without a fully functional 3D character animation system is like an airplane without engine.
     
  10. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,769
    Yet not every airplane need an engine.
     
  11. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    43
    @IsaacSeah I'd love to know more about this package: com.unity.logging. In particular, if it's possible to set it up outside of ECS (for use with Burst/Jobs but without Entities/Worlds and the rest of ECS). The docs are a bit unclear on if/how to do this and I'd rather not update in case it's not possible.
     
    Occuros and Mockarutan like this.
  12. jura_z

    jura_z

    Unity Technologies

    Joined:
    Oct 10, 2016
    Posts:
    27
    @rauiz it is not only possible but com.unity.logging was designed to not rely on ECS. The only dependencies for Unity.Logging are Burst (package), Collections (package), and Jobs (built-in). I will update the docs so that's explicitly stated there, thank you!
     
    kdchabuk likes this.
  13. Wieditleestisgek

    Wieditleestisgek

    Joined:
    Dec 18, 2016
    Posts:
    43

    Maybe u could record the position/rotation of every bone during a existing animation for every frame
    save it and then turn it into a blob asset so u can play it in ecs by slerping through them based on time.

    prolly able to group animations (walk run etc) together for each creature too.
     
    One1Guy likes this.
  14. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,264
    This is what Kinemation does. Honestly, that's the easy part.
     
    SolidAlloy likes this.
  15. rauiz

    rauiz

    Joined:
    Mar 19, 2013
    Posts:
    43
    Sounds pretty good then :D If you could add a single "Burst+Jobs" only example into the docs --- it'd be awesome!
     
    jura_z likes this.
  16. sebastienlh

    sebastienlh

    Unity Technologies

    Joined:
    Sep 22, 2017
    Posts:
    40
    Edit - Quick answer: not easily because the concept of DataMode is per window instance and the inspector window is internal and getting the correct instance through reflection is extremely tedious. If you manage to do it, read on.

    We are changing this API at the moment, so what I'm telling you today is not going to stay true for too long, but the principle will be similar.

    First of all, DataModes are per window instance, so based on context I will assume your question is specific to the DataMode of the inspector.

    Then, you will need to find a way to get your InspectorWindow instance, either through reflection or by other means (the type is internal). This type implements IDataModeHandlerAndDispatcher which has a public
    dataMode
    property. It will always return the current DataMode for the inspector. Any window that implements this interface or IDataModeHandler give you access to the current DataMode that way.

    DISCLAIMER
    We are completely changing how DataModes work and both of the interfaces I've mentioned will be removed very soon. I strongly advise not building anything on top of them. This information is for educational purposes only!
     
    Last edited: Oct 8, 2022
  17. SPOfreyre

    SPOfreyre

    Joined:
    Jun 3, 2022
    Posts:
    2
    In Unity 2022.2.0b10, a new project.

    When I add com.unity.entities package, the package manager installs Entities 0.51.1

    When I add com.unity.entities.graphics, the package manager give error:
    "Unable to find the package with the specified name.
    Please check the name and try again."
     
    MarceloBarce likes this.
  18. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    982
    I just read the upgrade guide. In the Remove GenerateAuthoringComponent part, does it mean that all our current components that has the GenerateAuthoringComponent attribute should look like this:
    upload_2022-10-9_17-32-3.png
    I mean does all three of these need to be in the same component file?
     
  19. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    No it does not have to be. The monobehavior should actually should be in a file with it own name.
    You can then have the baker bellow in the same file or in another file. And the ECS component wherever you want.
    (See episode 5 of my DOTS training, link in the signature)
     
    RoughSpaghetti3211 likes this.
  20. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    I'm getting crashes when editing the fields of bakers -- but only on some prefabs, and only if the baker calls CreateAdditionalEntity();

    2022.2.0b10, Entities v1.0.0-exp.8

    Here's an example of what was causing a crash:

    Code (CSharp):
    1. class UniformCircleSpawnBaker : Baker<UniformCircleSpawnAuthoring>
    2. {
    3.     public override void Bake(UniformCircleSpawnAuthoring authoring)
    4.     {
    5.         Entity primary = GetEntity();
    6.         foreach (var info in authoring.spawnData)
    7.         {
    8.             Entity prefab = GetEntity(info.Prefab);
    9.             Entity entity = CreateAdditionalEntity();
    10.             AddComponent(entity, new UniformCircleSpawn {
    11.                 Count = info.Count,
    12.                 Radius = info.Radius,
    13.                 Prefab = prefab,
    14.                 Parent = primary
    15.             });
    16.         }
    17.     }
    18. }
    Interestingly, rebuilding the Library would fix this...for a bit, and then it'd go back to crashing. I'm pretty sure this only happened with prefabs whose thumbnails were failing to load, which also suggests there's some corruption of the cache.

    The top of the stacktrace looks like this:


    #0 0x000002d872fd50 in System.Runtime.InteropServices.GCHandle:Free
    #1 0x000003a4e6f56c in Unity.Entities.EntityCommandBuffer:CleanupManaged
    #2 0x000003a4e6f1d0 in Unity.Entities.EntityCommandBuffer:FreeChain
    #3 0x000003a4e6ef80 in Unity.Entities.EntityCommandBuffer:Dispose
    #4 0x000003a4e35f54 in Unity.Entities.BakedEntityData:ApplyBakeInstructions
    #5 0x000003a3ac0f70 in Unity.Entities.BakingSystem:Bake
    #6 0x000003a3aaf6d8 in Unity.Entities.BakingUtility:BakeScene
    #7 0x000003a3aae324 in Unity.Scenes.Editor.LiveConversionDiffGenerator:Bake
    #8 0x000003a3a9d4ac in Unity.Scenes.Editor.LiveConversionDiffGenerator:UpdateLiveConversion
    #9 0x000003a3a9c9d4 in Unity.Scenes.Editor.LiveConversionConnection:AddLiveConversionChangeSet
    #10 0x000003a3a892b8 in Unity.Scenes.Editor.LiveConversionConnection:Update
    #11 0x000003a3a7eaa4 in Unity.Scenes.Editor.EditorSubSceneLiveConversionSystem:OnUpdate
    [...]


    I guess the command buffer is SEGVing while trying to clean itself up.

    I refactored to avoid creating any extra entities, so I'm fine for now, but I'm curious if anyone else has been seeing this. I can try to reproduce it in a smaller project sometime soon and file a report if this is something new!
     
  21. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    361
    This is not a complaint nor suggestion, I'm only sharing my situation.

    After examining the DOTS guide examples I prettty much understand how prefabs are instantiated in subscenes. However, what I really need to know is how to dynamically load and instantiate Addressable prefabs at runtime. Because that's the only problem I need to solve before deciding to use Unity ECS in production.
     
    defic and kotbrain like this.
  22. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    982
    Regarding this part in step 2, what if the variable is Entity. Do we use Entity in the authoring MonoBehaviour or use GameObject? Because in 0.51, the generated authoring component accepts a GameObject.

    upload_2022-10-10_19-50-13.png
     
  23. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    You will either have to wait for dots addressable for that or come up with you own runtime instantiation/update of entity prefab.

    You could for instance make a scriptable object sub asset to the prefab that will be populated at baking with the archetype and component values by a baking system.
    The prefab entity will be bad with the default values and shiped with your game.
    If you make the scriptable item addressable you can then load the scriptable asset at runtime and update the corresponding prefab with the new data/archetype.
     
    Laicasaane likes this.
  24. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    Use entity in the IComponentData and any monobehavior in the Authoring component.
    Then in the baker use GetEntity(authoring.whateverMonobehavior) to get the matching entity.
     
    Last edited: Oct 10, 2022
    davenirline likes this.
  25. Djo_krd

    Djo_krd

    Joined:
    Sep 6, 2017
    Posts:
    31
    Hello. I read the tutorial on https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/DOTS_Guide
    and I have one question about components_systems cheatsheet, there was example of creating and destroying entities:
    Code (CSharp):
    1. [BurstCompile]
    2. public partial struct MySystem : ISystem
    3. {
    4.     [BurstCompile]
    5.     public void OnCreate(ref SystemState state) { }
    6.  
    7.     [BurstCompile]
    8.     public void OnDestroy(ref SystemState state) { }
    9.  
    10.     [BurstCompile]
    11.     public void OnUpdate(ref SystemState state)
    12.     {
    13.         // The EntityManager of the World to which this system belongs.
    14.         EntityManager em = state.EntityManager;
    15.  
    16.         // Create a new entity with no components.
    17.         Entity entity = em.CreateEntity();
    18.  
    19.         // Add components to the entity.
    20.         em.AddComponent<Foo>(entity);
    21.         em.AddComponent<Bar>(entity);
    22.  
    23.         // Remove a component from the entity.
    24.         em.RemoveComponent<Bar>(entity);
    25.  
    26.         // Set the entity's Foo value.
    27.         em.SetComponentData<Foo>(entity, new Foo { });
    28.  
    29.         // Get the entity's Foo value.
    30.         Foo foo = em.GetComponentData<Foo>(entity);
    31.  
    32.         // Check if the entity has a Bar component.
    33.         bool hasBar = em.HasComponent<Bar>(entity);
    34.  
    35.         // Destroy the entity.
    36.         em.DestroyEntity(entity);
    37.  
    38.         // Define an archetype.
    39.         var types = new NativeArray<ComponentType>(3, Allocator.Temp);
    40.         types[0] = ComponentType.ReadWrite<Foo>();
    41.         types[1] = ComponentType.ReadWrite<Bar>();
    42.         EntityArchetype archetype = em.CreateArchetype(types);
    43.  
    44.         // Create a second entity with the components Foo and Bar.
    45.         Entity entity2 = em.CreateEntity(archetype);
    46.  
    47.         // Create a third entity by copying the second.
    48.         Entity entity3 = em.Instantiate(entity2);
    49.     }
    50. }
    Do I understand correctly that creating entities using EntityManager makes them in main thread immediately (not after the end of frame) and this is bad practice?
     
  26. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    361
    I can't say that I really understand how this procedure would work.

    Btw, almost all of my prefabs and game data must be addressables. My game data are actually scriptableobjects converted from Excel sheets before making into addressables. So I need to load both data and prefabs before entering any "scene". And I need to assign different data to different instances of a prefab at instantiating (or baking?) time. No default value on the prefab should be in use here.

    Would you please explain more about the procedure according to my use case? Much appreciated!
     
    koonm likes this.
  27. WAYNGames

    WAYNGames

    Joined:
    Mar 16, 2019
    Posts:
    992
    I would suggest to make a new thread for more detailed explanation. You can ping me in the new thread and explain your current workflow. My best advice right now would be to stick with what works for your project now and wait for DOTS addressable. If you already have a project in 0.51 you have been working on for a few weeks/month, which sounds like it's the case, I would recommend you stick with 0.51 for that and make "trial" projects on the side to get up to speed on 1.0. And if a feature is not in 1.0 and you have reasonable confidence it will be released "Soon TM" wait for it.
     
    Laicasaane likes this.
  28. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    361
    Oh. Nevermind. I'm already waiting for DOTS Addressables. My previous post was just to contribute a use case. I have no project using 0.51 at the moment. However, my teammates are planning a new project for next year. And I want to get to know the 1.0 APIs before the end of this year.
     
  29. Wieditleestisgek

    Wieditleestisgek

    Joined:
    Dec 18, 2016
    Posts:
    43
    Are baked object supposed to not move in scene view during runtime?

    for me they move in game window but not scene.
     
  30. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Spun up a brand new project in 2022.2.0b8, using the2D Built In template, immediately added the Entities package and now the com.unity.2d.animation package is throwing errors.

    Is Entities not compatible with the 2D Template?

    Library\PackageCache\com.unity.2d.animation@9.0.0-pre.3\Runtime\TransformAccessJob.cs(165,62): error CS1955: Non-invocable member 'NativeHashMap<int, TransformAccessJob.TransformData>.Count' cannot be used like a method.
     
  31. DoctorShinobi

    DoctorShinobi

    Joined:
    Oct 5, 2012
    Posts:
    219
    Same thing happened to me. It works with 3D URP but not 2D URP
     
  32. IsaacsUnity

    IsaacsUnity

    Unity Technologies

    Joined:
    Mar 1, 2022
    Posts:
    94
    A new version of the Entities package has been made available, alongside various fixes and refinements for Unity Physics, Netcode for Entities and Entities Graphics. We recommend using the latest version of these packages with 2022.2.0b11+ as various editor-related fixes for IL2CPP and the Entities Graphics package have been included. Please check out the changelog for more details.
     
    Last edited: Oct 27, 2022
  33. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Currently Entities release can say is almost no new changes. When is the next Entities release with bug fixes and improvements?
     
  34. IsaacsUnity

    IsaacsUnity

    Unity Technologies

    Joined:
    Mar 1, 2022
    Posts:
    94
    Thank you for the question. We're expecting the next release of ECS for Unity to be available alongside Unity 2022.2 Tech Stream. Historically, the 202x.2 Tech Stream has been made available in Q4 but this is subject to change. Hope that helps!
     
    lclemens, bb8_1 and WAYNGames like this.
  35. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I see. That means I need to wait until Unity 2022.2 out of beta. Does this new release still experimental release or it's entering pre-release stage? Btw will we get much more frequent update after entering Unity 2022.2 Tech Stream? The best scenario is new update per week.
     
  36. IsaacsUnity

    IsaacsUnity

    Unity Technologies

    Joined:
    Mar 1, 2022
    Posts:
    94
    The upcoming release of Entities and related packages should be in Pre-release status. This is of course, subject to change. As usual, we are always excited to provide updates where possible, and we'll do our best.
     
  37. unity_8C5877530372917C0585

    unity_8C5877530372917C0585

    Joined:
    Oct 18, 2021
    Posts:
    1
    I had the same problem. I removed Entities Phisics that had an older version than Entity Graphics. Now it works..
     
  38. PolarTron

    PolarTron

    Joined:
    Jun 21, 2013
    Posts:
    94
    Unity.Physics and Unity.Netcode defines ENABLE_TRANSFORM_V1 which makes Entities use V1 of Unity.Transforms.
     
  39. RegdayNull

    RegdayNull

    Joined:
    Sep 28, 2015
    Posts:
    68
    I do not want any transform. For sure I need LocalToWorld for rendering, but I can update if for myself. Is it possible to not generate that useless components like Tags, LocalToWorldTransform and so on? I do not want to pay performance for that, that I just don't use.
     
    Tony_Max likes this.
  40. ScallyGames

    ScallyGames

    Joined:
    Sep 10, 2012
    Posts:
    47
    How is there still no answer on this?
    Having a Camera that is controlled through DOTS but should still work as a camera seems like the most obvious use case.
    Previously you could just add ConvertToEntity with Conversion Mode set to "Convert And Inject Game Object" and everything worked fine. What is the way to do this with Entities 1.0 and subsystem conversion?
     
    charleshendry and Tony_Max like this.
  41. scottjdaley

    scottjdaley

    Joined:
    Aug 1, 2013
    Posts:
    163
    There isn't a direct replacement for "Convert and Inject Game Object". For something like a camera, I would just use Camera.Main inside of a SystemBase. But this doesn't work if you have multiple cameras that you are trying to link.

    In general, if you are trying to link a game object to an entity, you have the following options:
    1. Turn your game object into a prefab. Then in a subscene, add the prefab reference to an authoring component. At runtime, instantiate the prefab and link it to your entity.
    2. Create a MonoBehaviour that, at runtime, creates a new entity and links the game object to it.
    3. Use static variables, like Camera.Main or other custom ones you make. Then access them from systems.
    4. Create a custom solution to get around the limitation of no cross-scene references. For example, you could have a baked entity that, at runtime, looks for a game object with a particular tag and then sets up a link to it.
    The best approach depends on your use case, but I think this is an area that needs to be improved.

    I was asking about hybrid workflows today in the live Q&A on discord and got this response:
     
    Krooq and WAYNGames like this.
  42. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    761
    Sorry for the confusion, but in option 1, what does "and link it to your entity" mean?

    Also, so how would this work for things like particle effect and lights? Currently in 0.51 I can create a prefab for a furnace for example and put a fire particle effect on it (typically as a child game-object with a particle system component). When the prefab gets converted (either via the player spawning a furnace building, or the furnace being placed beforehand in a subscene), a game-object for the particle effect gets created and is "linked" auto-magically such that whenever the player moves around the furnace the fire particle effect is "tethered" and its translations and rotations are updated with their parent entity. Its performance is pretty lousy, but it works. In the inspector for the entity in the DOTS Heirarchy, there will be components for Particle System, Particle System Renderer, and Companion Link like this:

    upload_2022-11-1_18-5-35.png

    Are you saying that in 1.0 this auto-magic companion-linking stuff no longer happens? And if not, what mechanism should be used to "link it to your entity"?
     
  43. scottjdaley

    scottjdaley

    Joined:
    Aug 1, 2013
    Posts:
    163
    Its really up to you. But the simplest option is to simply add the MonoBehaviour to your entity using AddComponentObject(). This will add a managed component with a reference to the MonoBehaviour to your entity. Or you can create a new class IComponentData with a field for the MonoBehaviour. In either case, it is important to note that this MonoBehaviour still lives on a game object somewhere. In the case of option 1, it would continue to live on the instantiated prefab. But by adding a reference to it on your entity, you can use normal system queries to find it and interact with it.

    Technically, CompanionLink is still there, but only for a specific set of allowed components found in CompanionComponentSupportedTypes.cs:

    Code (CSharp):
    1.     internal class CompanionComponentSupportedTypes
    2.     {
    3.         public static ComponentType[] Types =
    4.         {
    5.             typeof(Light),
    6.             typeof(LightProbeProxyVolume),
    7.             typeof(ReflectionProbe),
    8.             typeof(TextMesh),
    9.             typeof(MeshRenderer),
    10.             typeof(SpriteRenderer),
    11.             typeof(VisualEffect),
    12.             typeof(AudioSource),
    13. #if PARTICLE_SYSTEM_MODULE
    14.             typeof(ParticleSystem),
    15.             typeof(ParticleSystemRenderer),
    16. #endif
    17. #if SRP_7_0_0_OR_NEWER
    18.             typeof(Volume),
    19.             typeof(SphereCollider),
    20.             typeof(BoxCollider),
    21.             typeof(CapsuleCollider),
    22.             typeof(MeshCollider),
    23. #endif
    24. #if HDRP_7_0_0_OR_NEWER
    25.             typeof(HDAdditionalLightData),
    26.             typeof(HDAdditionalReflectionData),
    27.             typeof(DecalProjector),
    28.             typeof(PlanarReflectionProbe),
    29.             typeof(LocalVolumetricFog),
    30. #if PROBEVOLUME_CONVERSION
    31.             typeof(ProbeVolume),
    32. #endif
    33. #endif
    34. #if URP_7_0_0_OR_NEWER
    35.             typeof(UniversalAdditionalLightData),
    36. #endif
    37. #if HYBRID_ENTITIES_CAMERA_CONVERSION
    38.             typeof(Camera),
    39. #if HDRP_7_0_0_OR_NEWER
    40.             typeof(HDAdditionalCameraData),
    41. #endif
    42. #if URP_7_0_0_OR_NEWER
    43.             typeof(UniversalAdditionalCameraData),
    44. #endif
    45. #endif
    46.         };
    47.     }
    Not sure if they intend to keep the CompanionLink workflow for the actual 1.0 launch or if they plan to deprecate it. But for now it seems to still work, although I don't use it myself.

    CompanionLink works in a very similar way to option 1. However, instead of instantiating a prefab asset, it clones the authoring game object and then removes all but these specifically allowed Components. Then it adds references to the Components to the baked entity. They also hide the cloned game object from the hierarchy, but it's still there. These Components require a game object to work correctly. Part of the magic of CompanionLink is that they automatically handle the disposal and cleanup of the cloned game object. But the main difference is that they are doing this all at bake time, not at runtime. So they have some concept of a "baked game object". I assume that is why only certain components are allowed for companion link. I think they need to know how much memory they require so that they can persist them in the subscene binary format.

    In case you want to chime in, I proposed a possible workflow for hybrid in this thread: https://forum.unity.com/threads/proposal-for-hybrid-interoperability.1345562/

    However, now that I've learned a bit more about CompanionLink from talking to unity devs, it sounds like that workflow wouldn't be possible (probably something about how the subscene is serialized). But I'm hoping they come up with some kind of improvement in this area.
     
    tmonestudio likes this.
  44. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    Plz be aware that this is not valid in 1.0 anymore. You can't automatically have a prefab converted to entity at runtime.

    Imho, losing that ability sucks. That workflow should be worth any down-side/limitation/bug-fixing-time required...

    (Unless there are plans to completely remove prefabs from unity as a whole and replace them with addressables which would be the biggest breaking change in the history of the engine xD)
     
    mikaelK likes this.
  45. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    866
    Converting a prefab at runtime never made sense, it is very slow, and breaks determinism probably. Prefabs really are a editor concept. Baking works fine for converting prefabs in my experience.
     
    Anthiese likes this.
  46. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    Sorry to be this blunt but u are extremely off target with that one....

    1. Speed is irrelevant for procedural content, you just need to convert once and then just instantiate the entity prototype which is as fast as any other entity instantiation.
    2. Prefabs are not an editor only concept, who ever said that? No offence intended but I think your experience with unity has been too focused/narrow so far (nothing bad with that but realize there are hundreds of different use cases / game architectures / etc out there as good and valid as any other)
    3. I can't bake because all my levels are proceduraly generated in a server and then the client just spawns whats needed in the correct places. And content (prefabs) should be allowed to be read from bundles so I can't just make a mini system to pre-bake every prefab and then expose an access mechanism to other scenes.
     
    mikaelK likes this.
  47. Laicasaane

    Laicasaane

    Joined:
    Apr 15, 2015
    Posts:
    361
    I'm worrying about this issue too. But at this time there is just not enough information to debate about. Let's just wait for more details from Unity when the time comes. I'm already frustrated at the Unite (no news for DOTS that we're not already aware of) but I won't judge just now.
     
  48. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    225
    Mmmm but what if then its too late? Worries and complaints from serious users are better when u get them really early so u can react accordingly.
     
    mikaelK likes this.
  49. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    866
    Unity developers already addressed Addressables in the other thread. You are just going to have to wait and change the architecture of your project as needed.

    Baking serializes data. When they implement it, You likely will not get the original GameObject back you will get a Prefab Entity representation. You could get the original GameObject separately. You are just going to have to move more of your logic to ECS. If you do a lot of procedurally generation you probably want to move more towards pure ECS anyway.
     
    Last edited: Nov 2, 2022
  50. RegdayNull

    RegdayNull

    Joined:
    Sep 28, 2015
    Posts:
    68
    Mergeable EntityCommandBuffer will be extremely useful. Like ecb.Append(ecb1), ecbParallelWrite.Append(ecb1) or something. With that I can create custom ScriptableObject based modular "prefabs". Once generating EntityCommandBuffer array with construction commands and appending it in any System.
     
Thread Status:
Not open for further replies.