I’m about a week into DOTS, more so ECS because restructuring my codebase and remembering to keep data separate from the systems is keeping me on my toes. But a lot of my game contains nested prefabs for rendering, and i’ve been wondering how this will translate/does translate to the new pure ecs workflow? Since a lot of my previous data are nested prefab assets that are essentially gameobjects, and AFAIK pure ecs means you don’t want to be instantiating these nested prefab art assets because performance, what is the middleground? Do I have to redo all of my art asset prefab game objects?
Instantiating prefabs & nested prefabs is perfectly reasonable. DOTS generally converts data from game objects to entities, prefabs & nested prefabs are an important part of that work flow.
The goal of DOTS is that as little content has to be changed as possible.
I feel like somewhere, perhaps in 2018 around UNITE Berlin, I read that ECS (now DOTS i guess) will replace monobehaviors by 2021 or something. Is that no longer the case? Was that never the case? I feel like hybrid ECS was initially a way to bridge the two systems and would eventually be phased out, but the more current news I read about DOTS the more it seems like you want to keep both systems. Do you want people to code in OOP and only use DOTS when it suits them? I know it’s not suited for all but is that your intention?
Can you help me understand where the vision started, what it’s gone through, and where it’s at now? Perhaps it’ll even help how I approach changing over to DOTS or lack there of. Thank you.
We have no plan of replacing MonoBehaviour or game objects. We are building a different way of writing code that can be used to do everything you can do with MonoBehaviours. For those who want to use it, we will invest a lot in making it be a simple & effective way of making a game
At the moment our strategy is to keep the editing tools mostly the same (Fixing scalability issues to support the scalability DOTS can achieve at runtime) but really our authoring format continues to be game objects with scenes, prefabs and various assets. We do this by using converting game objects to entities.
This is what we had around April:
We are currently investing in making the conversion process live & better visualize what is happening as well as debuggable.
This gives a good way forward for content to easily be moved over to DOTS.
For the runtime. Our short term goals are to get as quickly as possible to a point where you can make a game with pure DOTS runtime simulation code and GameObject based authoring. So we want to make it that you don’t need to use any simulation code from the game object world at runtime. Solving issues like instantiation performance, load speed, everything becoming multithreaded. Following principles like determinism by default, networking, performance by default and much more. (Eg dots based Animation, VisualScripting, Netcode, Audio, AI, physics) Check out Unity.Physics for a good example of what we would like to achieve in those areas.
The realistic path to a well working renderer is to build on top of HDRP / LWRP. In the same way we have done in Megacity. (Low level API BatchRendererGroup gets added to Unity and Unity.Entities uses it to make a scalable renderer on top of SRP / HDRP / LWRP that connects with the game code and simulation systems) There is clearly much more work to get to completeness in this area, eg. VfxGraph, decals, light baking, texture streaming, skin mesh rendering and more.
We think we can get to a reasonable place that covers many game genres with DOTS in the first half of next year. Again we do not think of DOTS as something that replaces it. It’s something you can choose if it makes sense for your production.
We think DOTS can replace all code in a game. Especially as we create simpler ways of writing ECS code. Whether it is the right choice depends on the specific team & production and the unity community.
We are simply making the option available. We think it has many advantages. It is up to the Unity community over the next years to decide where it will take us.