Thanks for that explanation, it was helpful.
I’m still really confused about the entity indexing though.
Quick background - I wanted to use subscenes, but found out that whenever I tried to spawn an entity from prefab at runtime, it would not work in release-build-mode because the resources for the spawned items weren’t loading. So I started using the Addressables package and that worked, although addressables and subscenese don’t play well together because they cause duplicate resources in memory. Recently, I was told that instead of using the Addressables package, I could preload entities in a subscene and make a map of them and then use that map to spawn entities at runtime.
So I made a dummy project and attempted to build such a paradigm, but I am discovering that the entity indexes are nothing like what I expected. In the dummy project, the idea is to simply spawn two different entities periodically.
First of all, during the conversion in the editor, the two entities get stored into the map as index 3 and 4.
However, when I look at the DOTS Hierarchy, the two prefab entities are indexed 8 and 10 instead:
So I did not expect that. To make it even stranger, after pressing the “Play” button in the editor, the two prefab entity indexes changed yet again to 16 and 13.
Well, needless to say, the spawner looks up the ids in the map and tries to clone entity 3 and 4 (which don’t exist) when it really should be cloning 16 and 13.
I put the whole dummy project in a git repo here: https://gitlab.com/lclemens/buggy . Is anyone else doing this type of thing? What am I doing wrong, and why do the entity indexes change during conversion and again after play starts?