As someone who has been focused on building true ECS solutions for a lot of the missing features (for personal reasons), I’m very curious what approach for interop you gravitated towards so quickly. Also, are you are using subscenes?
I am simply setting the components for primary pathing Entities. Those that have a flag set for it (a path request). Then the system for navigation will lazily get some corners from main Unity, and set those components. This in itself would be slow usually but it’s only one path a frame. I am certain this is the most simplest approach (I’m trying to keep all my stuff really simple, but moving forward because as you know - I am learning). These lead a bunch of boid-like Entities which have richer parallel AI that don’t depend on paths but do much more raycasting and so on.
It’s not a lot of traffic between classic and ECS worlds (once a frame if that!). However, there is a lot of additional AI logic I plan for local seeking / sensing / cover and so on that I want to keep as stateless and parallel as possible, so while paths solve dead ends, most of the AI will not be needing pathfinding calculated per frame or even often.
I can’t see myself always wanting this, but I’m pretty cautious around experimental API.
This is only for my learning project, and I would absolutely love a proper 0.50+ stable navigation solution, but it is outside of my expertise in ECS / DOTS. I think there’s a whole bunch of problems I can stumble into with my ignorance at the moment. I also noticed Unity said quite clearly it’s on hold with no plan at all for it (on the roadmap).
I am using subscenes as much as possible. I haven’t done much testing on them but so far, so good. Can’t bake navigation without the subscene open of course. Why did you ask?
I was more asking ECS/MonoBehaviour interop in general, not so much nav meshes. A lot of people find it difficult to reference scene GameObjects that don’t have a good ECS implementation (like Mecanim) from within subscenes. There are a few different solutions, but they all tend to involve some indirect route. So I was curious if you settled on a particular approach to this yet?
I guess I’m going to answer my own question further up about entities being invisible when built for Android to help out anyone who has the same issue…
There are a ton of restrictions on what is actually supported by Hybrid Renderer V2, and that is why entities weren’t rendering for me.
1: URP or HDRP only. Built-in is dead. (I wish built-in support was kept honestly, since URP still can’t match built-in mobile shaders for performance, and like, isn’t performance the name of the game here? For me no matter how much of an improvement there is upgrading from 0.17 to 0.5, since I have to use URP instead of built-in mobile shaders it still results in a net loss in performance. Granted it’s not significantly worse performance.)
2: Vulkan ONLY on Android! This is kind of huge. Pretty much only newer phone support till Entities 1.0. (You have to actually go in and turn off “Auto Graphics API” and disable “OpenGLES2” and “OpenGLES3” in Graphics APIs.)
3: Linear Color Space ONLY. No Gamma. (Another thing where now the higher performance version isn’t supported. Ugh.)
4: On the URP Render Pipeline asset “SRP Batcher” has to be enabled.
5: Make sure you build with the new “Platforms” Package and create a “Build Configuration” and use the “Build and Run” button on the Build Configuration asset and not in the usual spot in the menu.
Unfortunately, for someone like me trying to make something for Android, the things listed above are big enough drawbacks that the best course is to stay on 0.17 at least until the Entities 1.0 release with at least OpenGLES3 support.
Even then, 0.17 running built-in mobile shaders and Gamma lighting mode will probably still have higher performance for mobile than the final 1.0 release. With OpenGLES3 support, it’ll probably be worth the performance loss to not have 0.17’s random project-breaking bugs though.
Can someone in this thread tell me what the latest status of entities + Unity 2021 LTS is? Does it work yet, or not? I saw that 0.51 is meant to handle that, but I also have heard some conflicting stuff from some other developers so any clarity would be great ![]()
0.51 is not yet released. (latest is 0.50.1 for 2020.3)
Thanks!
Is there a shortcut to see generated sources?
Also, I’ve encountered a memory leak in one of the systems’ ForEach, but not sure what is causing it.
Edit:
Nvm, it turns out to be somehow related to the custom bootstrap and disabling automatic world boostrap. Probably related to some new feature that has been added and is my fault.
Haven’t found a way to open generated sources unless errors pop up.
So it seems sources aren’t actually preserved after being compiled into dll.
Decided to take a better look at what approaches there are out there, including porting an older sample (zulfajuniadi). I can see why you asked, there’s a few different ways to handle this. Mine is not optimal it seems. Wonder if Unity plans anything more for interop?
hippocoder posting DOTS feedback on code and DreamingImLatios providing it is an incredible learning opportUNITY for us learners.
Ok, so I figured out what’s causing native leaks with custom bootstrap.
No InitializationSystemGroup means no WorldUpdateAllocatorResetSystem which resets some kind of internal allocator (?).
If anyone else encounters ~1mb leak/sec behaviour, make sure you’ve got logic identical to WorldUpdateAllocatorResetSystem (state.m_WorldUnmanaged.ResetUpdateAllocator()).
Adding it as first in begin frame phase does the trick, but unfortunately requires package modification.
To UT:
Having a mechanism to override system update group attributes in custom bootstrap would be really handy.
in DOTS authoring and debugging workflows in the Unity Editor | Unity at GDC 2022 they use Unity 2022.2 to demonstrate DOTS autoring workflow.
I want to thank Unity for their efforts in DOTS new features and optimizations.
Unfortunately, we only see the tip of the iceberg, and we don’t realize the amount of hard work behind it.
usually people come here to ask questions about issues they are facing and don’t take the time to say thank you.
so thanks again Unity <3 <3 <3
I’m really super excited with DOTS again ![]()
Sorry for the negativity but I find it hard to be exited when the presenter has a hard time dealing with the workflow himself :S
DOTS is recent in UNITY and it is quite normal to be difficult at the beginning.
even simple things like speaking while building words and sentences were so difficult at some point we just dont remember it
.
to be honest, looking at the GDC once has already given me everything I need to know about these tools.
even though I can’t 100% remember how they work, I know exactly what to do, so if I feel the need to use one of them, It just requires me 10 minutes to review that part.
There is still some legacy stuff lurking around and missing animation and navigation are fairly big pain points so a project relying on those will encounter non trivial hurdles.
I’ve recently been getting “Exception: This method should have been replaced by codegen” error messages whenever I try and install entities 0.50. I’ve filed a bug report. Has anyone else seen this error and know how to correct it?
Are you using Unity 2021 by any chance? This happened to me, currently Entities is only supported in Unity 2020. It will be updated for 2021 between May and June in theory. You can downgrade your project if you can and know how to.
No. I tried 2020.3.32 and 2020.3.34. I also tried entities 0.50.0-preview.24 and 0.50.1-preview.2. This is only a very recent issue. So perhaps since the latest package (0.50.1-preview.2) was released as I was using 0.50.0-preview.24 the other week without issues but now unable to.
I just installed 0.17.0-preview.42 and it worked fine. I upgraded the package to 0.50.1-preview.2 and after restarting the editor it works fine. However if I install 0.50 as a fresh install I get the error. So it seems the only workaround for me is to first install 0.17 then upgrade to 0.50 when starting a new project.
EDIT: I’ll add that I uninstalled all editors, Unity Hub as well as removed all Unity folders/files and reinstalled everything and the issue remains. So I don’t think there is anything wrong on my end. Perhaps a recent change made by Unity?
Can you clear out your Entities source gen cache and try again? It seems to me that something tripped over and didn’t get updated (perhaps a related package)?
Ideally you only grab Entities from the Package Manager and the rest will be fetched with their corresponding versions. Also I’m using VS 2022 for the source generator stuff, but I am not sure how all that works (apparently it is merely slower if it is absent).