This can't be it. ECS feels awful in the editor.

I’ve deliberately put off using Unity’s ECS thus far because it would have only slowed me down and having to constantly relearn things every two weeks seemed like a waste of time. I wanted to avoid all of the growing pains associated with early adoption of tech - but it seems my patience has been in vain.

Or perhaps I’m just missing something?

Given the amount of praise I’ve been hearing nonstop about ECS over the last five years and especially since 1.0 has released I was honestly expecting a much better experience. But these last two days have been some of the worst ‘learning’ experiences I’ve ever had in software. Let’s not even get into the state of the documentation and get straight to it - the editor for this stuff sucks. It’s slow, clunky, constantly constantly, constantly breaks, and for the life of me I can’t even seem to create a simple single entity in the scene and bake it without getting runtime memory leaks. The error messages are next to useless. And rarely ever give a clue as to what part of my code is actually triggering the issue (if it even is my code!). The subscene is always failing to work or update and it requires me to either restart Unity or delete and reload the sub-scene after like every third run. Sometimes I run the subscene and it works and then it simply doesn’t on the next. It’d probably just stick to manually creating all of my entities in code but even that seems to not be very reliable. Heck, half the time I can’t even go back to using GameObjects in the inspector because the editor seems to think that I am NOT in the GO Hierarchy window with Authoring turned on while selecting a GO that isn’t in the subscene. I’m constantly just clicking around and resetting stuff and just hoping something will react to a button press.

Overall this feels like a massive step back for me in terms of production. The performance simply doesn’t feel worth the hassle. I switched from C/C++ years ago to C#/Java because it massively improved my workflow and this whole experience has taken me so far back I feel like I’m using Borland’s Turbo C++ again…

But this can’t really be the issue right? I mean there seems to be a whole lively community around this and all I hear see is praise. I’m not trying to rant here, I actually want to understand what is going on so that I can make some progress. They can’t all be drinking coolaid on this so I’m going to assume I’m just doing something absolutely stupid here and ask for help. I don’t exactly know what it is I need help with but really I just don’t even have a clue where to begin or what to address. I’m using Unity 2022.3.11f1 if that helps. I generally understand the concepts if not the exact library of code available to me but honestly I can’t even get to the coding portion of it all because the editor itself feels like it is sabotaging me at every step of the way. Is this really how the editor works with all of this stuff currently?

Not sure how to answer this… question? I guess I’ll just say my experience with it is not that bad lol. There are more problems than the well-matured gameobject/mono workflow, I’ll give you that. But for me, I wouldn’t go back to gameobject/mono if I can avoid it.

So then am I correct in assuming that my experience is unusual? Are you also experiencing constant warnings about memory leaks and functionality of the editor just failing nonstop? I’m just trying to get to the bottom of this because if that’s the normal workflow then no thank you. But I am assuming it isn’t normal and I’m just having an exceptional experience here.

I don’t get constant warnings, but I do sometimes. Sometimes there are leaks in unities packages too, I get a unity leak warning every few times I stop running, maybe like 1 in 5, but I’ve sort of stopped noticing it haha.

I’m not sure that your experience is completely unusual. If you are getting ‘constant warnings’, you need to check where they are coming from by enabling leak detection with full tracing, and make sure it’s nothing you are doing.

9422564--1320479--upload_2023-10-21_14-35-21.png

Another thing to note is with subscenes, you want to keep them closed when you hit play to keep things uncomplicated I think…

A few things. First off, make sure you are using the latest stable Entities, which is 1.0.16. Also, I’ve heard 2022.3.11 has been problematic for some people. I’ve had good experience with 2022.3.10.

For the hierarchy and stuff, I usually leave the normal GameObject hierarchy for editing GameObjects and open subscenes. I then keep the Entities hierarchy in runtime mode (it sometimes likes to switch back), and then the inspector shows either authoring or runtime based on which window I first selected the GameObject/Entity from.

There are leaks. If you see a few after code changes, don’t worry about them for right now. Only start to worry if you get spammed. There is a way to turn on stack traces to look at leaks if you are unsure, and you can share those traces and we can tell you whether it is your fault of Unity’s.

I’m not sure what is up with subscenes for you, though I have seen some pretty weird issues with 1.1.0-exp.1 and when you have a runtime error in your bakers and baking systems.

There’s a real chance that you are doing one particular thing very wrong, but Unity doesn’t expect at all and doesn’t know how to warn you about it and it is causing Unity to have a fit. That is one area where ECS is worse, it is much more fragile if you don’t know what you are doing. But the community here typically tries to get people past that stage, and once you are past it, it gets a lot better.

Ooof, I find it unacceptable that we should just expect the editor to give us with warnings about leaking memory. If all we are expected to do is ignore it then what even is the point of it existing?

I do have leak detection on full and there is nothing for me to trace because I haven’t done anything yet! An empty scene in a freshly opened editor will display leak warnings when I hit play with ECS in the project. If I do something as complicated as placing a default cube into the subscene and let it bake then all hell breaks loose when I hit play and it warns me about leaks in the baking system (well the full trace gives a ton of irrelevant stuff but it seems at some point the baker shows up so I guess it must start there). It only gets worse if I put my own authoring component on there and bake it. I literally don’t even do anything in the bake except add the empty component to the entity.

And it only gets worse when I actually try to do anything actually useful. I was excited to try baking a terrain into an ECS terrain collider but was met with dismay when I found that merely creating the BlobAsset and assigning it to the collider causes a leak too. Is this really how people have been working with this stuff all along? O _o

At the very least I’ve found if I disable the warnings and checks on everything I can actually work somewhat uninterrupted. The hierarchy doesn’t seem to break. The scene usually runs without random runtime exceptions. Occasionally I have to restart Unity or reset the window layout just to clear Unity’s brains out a bit and get it to think clearly but I guess at this point that’s just part of the workflow. But it feels like an absolutely terrible idea to just run in the dark with no pants like that.

Here’s the full stack trace. They post when I enter playmode. The number of leaks seems to be arbitrary in quantity and I can get more than one log like this.

Found 1 leak(s) from callstack:
0x00000246c4d65b43 (Mono JIT Code) Unity.Collections.Memory/Unmanaged/Array:Resize (void*,long,long,Unity.Collections.AllocatorManager/AllocatorHandle,long,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/Memory.cs:79)
0x00000246c4d65a03 (Mono JIT Code) Unity.Collections.Memory/Unmanaged:Allocate (long,int,Unity.Collections.AllocatorManager/AllocatorHandle) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/Memory.cs:20)
0x00000246c4d657fb (Mono JIT Code) Unity.Collections.AllocatorManager:TryLegacy (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:1023)
0x00000246c4d655eb (Mono JIT Code) Unity.Collections.AllocatorManager:Try (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:1055)
0x00000246c4d6555b (Mono JIT Code) Unity.Collections.AllocatorManager/AllocatorHandle:Try (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:540)
0x00000246c4d652b3 (Mono JIT Code) Unity.Collections.AllocatorManager:AllocateBlock<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int,int,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:32)
0x00000246c4d6517b (Mono JIT Code) Unity.Collections.AllocatorManager:Allocate<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int,int,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:53)
0x00000246c9f90f83 (Mono JIT Code) Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Unity.Entities.BakerEntityUsage/ReferencedEntityUsage>:ResizeExact<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/UnsafeList.cs:354)
0x00000246c9f90ec3 (Mono JIT Code) Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Unity.Entities.BakerEntityUsage/ReferencedEntityUsage>:SetCapacity<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/UnsafeList.cs:390)
0x00000246c9f90dfb (Mono JIT Code) Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Unity.Entities.BakerEntityUsage/ReferencedEntityUsage>:SetCapacity (int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/UnsafeList.cs:399)
0x00000246c9f90d3b (Mono JIT Code) Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Unity.Entities.BakerEntityUsage/ReferencedEntityUsage>:.ctor (int,Unity.Collections.AllocatorManager/AllocatorHandle,Unity.Collections.NativeArrayOptions) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/UnsafeList.cs:181)
0x00000246c9f90bf3 (Mono JIT Code) Unity.Entities.BakerEntityUsage:.ctor (Unity.Entities.Entity,int,Unity.Collections.Allocator) (at ./Library/PackageCache/com.unity.entities@1.0.16/Unity.Entities.Hybrid/Baking/BakerEntityUsage.cs:36)
0x00000246cb17b0d3 (Mono JIT Code) Unity.Entities.BakerState:.ctor (Unity.Entities.Entity,Unity.Collections.Allocator) (at ./Library/PackageCache/com.unity.entities@1.0.16/Unity.Entities.Hybrid/Baking/BakerState.cs:44)
0x00000246c9f889fb (Mono JIT Code) Unity.Entities.BakedEntityData:ApplyBakeInstructions (Unity.Entities.Baking.BakeDependencies&,Unity.Entities.Baking.IncrementalBakingContext/IncrementalBakeInstructions,Unity.Entities.BlobAssetStore,Unity.Entities.BakingSettings,Unity.Entities.Conversion.IncrementalHierarchy&,Unity.Entities.Baking.GameObjectComponents&) (at ./Library/PackageCache/com.unity.entities@1.0.16/Unity.Entities.Hybrid/Baking/BakedEntityData.cs:579)
0x00000246c9f7206b (Mono JIT Code) Unity.Entities.BakingSystem:Bake (Unity.Entities.IncrementalBakingChangeTracker,UnityEngine.GameObject[]) (at ./Library/Pack

Subsequently, after leaving playmode and re-entering I’ll also get this message along with the others. This is all simply from placing a default cube inside the sub-scene or really anything that has a baker associated with it I guess.

Found 6 leak(s) from callstack:
0x00000246c4daa1b3 (Mono JIT Code) Unity.Collections.Memory/Unmanaged/Array:Resize (void*,long,long,Unity.Collections.AllocatorManager/AllocatorHandle,long,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/Memory.cs:79)
0x00000246c4daa073 (Mono JIT Code) Unity.Collections.Memory/Unmanaged:Allocate (long,int,Unity.Collections.AllocatorManager/AllocatorHandle) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/Memory.cs:20)
0x00000246c4da9e6b (Mono JIT Code) Unity.Collections.AllocatorManager:TryLegacy (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:1023)
0x00000246c4da9c5b (Mono JIT Code) Unity.Collections.AllocatorManager:Try (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:1055)
0x00000246c4da9bcb (Mono JIT Code) Unity.Collections.AllocatorManager/AllocatorHandle:Try (Unity.Collections.AllocatorManager/Block&) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:540)
0x00000246c4da9923 (Mono JIT Code) Unity.Collections.AllocatorManager:AllocateBlock<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int,int,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:32)
0x00000246c4da97eb (Mono JIT Code) Unity.Collections.AllocatorManager:Allocate<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int,int,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/AllocatorManager.cs:53)
0x00000246ca25f773 (Mono JIT Code) Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Unity.Entities.BakerEntityUsage/ReferencedEntityUsage>:ResizeExact<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/UnsafeList.cs:354)
0x00000246ca25f6b3 (Mono JIT Code) Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Unity.Entities.BakerEntityUsage/ReferencedEntityUsage>:SetCapacity<Unity.Collections.AllocatorManager/AllocatorHandle> (Unity.Collections.AllocatorManager/AllocatorHandle&,int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/UnsafeList.cs:390)
0x00000246ca25f5eb (Mono JIT Code) Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Unity.Entities.BakerEntityUsage/ReferencedEntityUsage>:SetCapacity (int) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/UnsafeList.cs:399)
0x00000246ca25f52b (Mono JIT Code) Unity.Collections.LowLevel.Unsafe.UnsafeList`1<Unity.Entities.BakerEntityUsage/ReferencedEntityUsage>:.ctor (int,Unity.Collections.AllocatorManager/AllocatorHandle,Unity.Collections.NativeArrayOptions) (at ./Library/PackageCache/com.unity.collections@2.1.4/Unity.Collections/UnsafeList.cs:181)
0x00000246ca25f3e3 (Mono JIT Code) Unity.Entities.BakerEntityUsage:.ctor (Unity.Entities.Entity,int,Unity.Collections.Allocator) (at ./Library/PackageCache/com.unity.entities@1.0.16/Unity.Entities.Hybrid/Baking/BakerEntityUsage.cs:36)
0x00000246ca14c793 (Mono JIT Code) Unity.Entities.BakerState:.ctor (Unity.Entities.Entity,Unity.Collections.Allocator) (at ./Library/PackageCache/com.unity.entities@1.0.16/Unity.Entities.Hybrid/Baking/BakerState.cs:44)
0x00000246ca254c53 (Mono JIT Code) Unity.Entities.BakedEntityData:ApplyBakeInstructions (Unity.Entities.Baking.BakeDependencies&,Unity.Entities.Baking.IncrementalBakingContext/IncrementalBakeInstructions,Unity.Entities.BlobAssetStore,Unity.Entities.BakingSettings,Unity.Entities.Conversion.IncrementalHierarchy&,Unity.Entities.Baking.GameObjectComponents&) (at ./Library/PackageCache/com.unity.entities@1.0.16/Unity.Entities.Hybrid/Baking/BakedEntityData.cs:720)
0x00000246ca130e1b (Mono JIT Code) Unity.Entities.BakingSystem:Bake (Unity.Entities.IncrementalBakingChangeTracker,UnityEngine.GameObject[]) (at ./Library/Pack

I believe those leaks have been fixed in 1.1.0.exp-1

imo if you’re starting a new project I’d just start on 1.1.0. IMO it’s more stable than 1.0.16 as it fixes quite a few bugs. I’m only aware of 1 regression if you inline some code gen that most users won’t run into

That one annoys most if not all of us. Classic Unity “production ready” != polished.

Baking systems are really hard to write well in general. Not something someone new to ECS should be doing so soon. Stick to bakers for this use case. Just make sure to add the Blob Asset to the baker (it expects it as ref as it will replace the reference and dispose the one you just created if it detects it is a duplicate).

This is not an experience I share. But it may be that I have a better sense of what Unity is choking on when it happens. Why the window layout matters really makes me suspicious something is very broken in the editor version you are using with some editor tool you have installed.

state.WorldUpdateAllocator is your friend. I can’t comment on persistent containers since I have a custom solution for this that is less effected by this issue.

Not your fault unfortunately. You are just going to have to ignore these. Or if it absolutely drives you insane, fork entities to fix it or mute it by making the allocation untracked.

Unity’s ECS is a tool. One that you have to sharpen yourself to make it effective. It is not “the future” nor “the new way of doing things”. It is simply a tool. If the tool doesn’t work for you, find a different tool. For me, ECS is cheaper than writing a custom engine. But I still rewrite whatever feature isn’t working for me, because every feature is just a tool. Everyone here has their own reason for why the benefits of Unity’s ECS is worth the extra workflow burdens that come with not-fully-polished tech. But I can tell you right now, the alternatives are no better (yet).

There’s also a bug where the editor just completely fails to run any of the subscene editor tools for existing subscenes, and the subscenes just never load. You have to nuke your library folder or rebuild the subscene GameObjects in your scenes. This one is extremely confusing for new users. While I agree that 1.1.0-exp.1 is better about the memory bugs, I’ve found a few other regressions, especially with Entities Graphics. It is 6 one way, half a dozen the other I guess.

The only issue I’ve seen reported was an issue specifically in 2022.3.11

Is there something else specific? Because I haven’t seen anything myself or reported by other users on discord.

Okay, so what I’m reading here is that Unity ECS is still basically a prototype with the classic ‘use at your own risk’ warning label. I guess I’m actually kinda relieved as I was starting to think maybe I was missing out :smile:

I have found that I can at least get a basic game running if I turn off all of the warnings. So I’ll probably give it a play around for a few days but I really can’t see myself taking this too seriously at this state of things. Ninety percent of the reason I was attracted to Unity is the fact that the editor integrated so well with the workflow and the performance in this case isn’t enough to justify all of the hoops and issues.

It’s not a prototype anymore, at least to me after 7 months of using it. But I agree that the editor experience just not there yet, you would have to abandon much of the established comfortability of the MonoBehaviour world.

Speaking from my experience, a few days won’t be enough to get anything works the way you want. You shouldn’t expect that. However, people are delivering complete games using either version 0.51 or 1.0 (including myself) I encourage you to try it seriously if ECS is your target for the near future.

I lurk on the Unity discord, but don’t really talk there unless pinged. But I found several regressions related to the changes they made with submeshes and materials and posted the most egregious on the graphics subforum. I believe if that one is fixed, most of the others will likely disappear as well.

“Prototype” is the wrong word here. It is much closer to a late beta or release candidate or a late “early access”.

If that’s the amount of patience you have to give, don’t even waste those couple of days. From a developer’s standpoint, this is a racecar for the tortoise, and it really shines in that “last 10%” phase. I had prior experience with building my own games from scratch with homegrown ECS architectures before going down this route, and it still took me nearly a month before I could do something cool with the tech.

If you don’t need performance and you don’t strongly prefer DOD over OOP, don’t bother right now. It is perfectly fine to say that it is not for you. GameObjects are still here to stay. Everyone is different, and everyone needs to make their own decision based on their own values.

I just want to clairfy here cause I think it’s coming off as “I don’t understand ECS and I hate it”. I have no issue with ECS or DOTS itself. I’ve used bits and pieces here and there and I already use cache-friendly, SoA style things in my code as it is. I’m definitely not new to this stuff at a general level. My gripe isn’t with ECS. It’s with the lack of integration and editor tooling. After five years I’d expect better than this. With that sort of time frame I’d expect maybe a couple of complete operating systems by now :p.

But at least I know it really isn’t just me being a doofus and the tooling really is still that bad. That actually puts me more at ease and makes me feel more comfortable since I know I can just play with it and not worry too much about results.

That’s a good clarification. Thank you!

I think the Editor Tooling being not-so-great is the least surprising to me. There is a mountain of technical debt with GameObjects that have to be tunneled through. The memory leaks still being around months after the leak detector was fixed is still ridiculous to me, as are a lot of the other runtime quirks that I feel should be super easy to fix.

Looking back at your original post, it does seem like you are having more problems getting editor window interactions to register than the rest of us. I think it would help if you elaborated on more of the frustrations you have with the editor tooling with some concrete examples with pictures (aside from the leaks, because we know about those).

It’s not just you. At the beginning I fighted the editor on a daily basis. It was so annoying that I finally implemented things differently, or used some strategies to avoid working with the “ECS” editor frequently. It’s a kind of runtime conversion I devised to go along with the current state of editor tooling.

Im experiencing the same issues, its ok if I manually tick the subscene during runtime, but auto load causes tons of errors. How do you select that tickbox via code?

edit: works now, errors were from something else. and tickbox is only for opening scene in editor. overall very impressed with ECS though Im afraid to learn it myself :slight_smile: the entities arent even game objects so its kind of a different way of thinking, and subscenes are a tiny bit weird.

I hear you. You kind of learn to work with the system, but overall the 1.0 was a huge disappointment in terms of quality.
My tests stopped working when ran in sequence due to something happening during scene switch and subscene load. For example doing a simple get entity count gives incorrect amount of entities. At some point I felt the entities where working. During the 0.5ish all the tests worked in sequence perfectly. Now I’m stuck either converting from subscenes to a hybrid instantiation or run some of the tests 1 by one. Most annoying thing was the subscenes. 1.0 forced to use subscenes that worked half of the time and still not 100%.

The entities journaling has never helped me with anything. I have tried using it but I feel its for some worst case I have not faced.

You kind of just have to know what you are doing and if something weird starts to happen you just have to know by experience what system is causing it and where.

There is a silver lining and that silver lining is speed which might get you a tons of players more. Or maybe make a game that is not possible with mono behaviors alone

What can you do? Switch to Unreal and c++ or some other engine?

What?!

Yeah you reached some obstruction, and your best proposal is to run away, to different engine, like if it solves the issue? Specially you made assets. Makes no sense.
While if such road blocker, you could simply either switch to older package, or even not using it at all. At least you would stay in your comfort zone of expertise.

Saying that, I am not most fond of subscenes, specially when comes to physics. Other than that, I had no issue with them.

lol I think you misunderstood. I’m not running away from anything that’s just absurd.

I mean what can you do if all your assets and development is in Unity?
Like switch engine and start all over again. A joke :wink:
But yea I probably shouldn’t complain as much, just that I kind of agree with the op that the ECS gets a lot of praise, but to regular people might find them in a unbearable situation and its not exactly as advertised in the beginning.

And new features. I wanted to use the enableable components, but due to random runtime crashes on builds I had to switch back