#Grouping same set of entities without transform component

1 messages · Page 1 of 1 (latest)

desert island
#

I would like official to support grouping same set of entities without transform component so make it easy to find the entity at Entities Hierarchy. Currently to group same set of entities you will need to add parent component to make the entity together and visualize as parent and child entities but this incur unnecessary performance overhead. It's better to have editor tooling to do the similar things without require to attach any transform component that it will not affect the structure of entities at player runtime build. This quite useful for physics entities that physics will unparent all the entities by default and entities will scatter all over the place which is really hard to view. With this feature, it will automatically group them together to make it so much pleasant to view.

gleaming haven
#

Since we are unparenting rigid body entities for performance reasons, I suppose you are refering to this use case where you would still like to see that certain entities belonged originally (prebaking) to some game object hierarchy.

#

Is that what you are looking for here?

tepid shadow
#

This will be also useful for logical grouping entities for example to group character entity and character abilities entities.

desert island
gleaming haven
#

To clarify, what do you mean by "same set of entities" in your original post?
Do you just mean the entities that have the same archetype, and you would like these to be grouped within the hierarchy?

desert island
# gleaming haven To clarify, what do you mean by "same set of entities" in your original post? Do...

Nope. I mean like when u have character or environment that has a lot of child game objects with collider and then when u bake into entity, it will unparent because of dots physics default behavior and scatter all over the place. So Entities Hierarchy needs some kind of folder grouping to tell u that all these unparent entities are belongs to the same set that is baked from the same game object.

gleaming haven
#

Ok. Just to confirm my understanding, we have this situation, where we have two game objects with Physics Bodies in a hierarchy, both of which will produce one root level Entity rigid body.

#

Sphere and capsule both have the same set of components.

#

In the Entities Hierarchy, they are displayed correctly as root entities without parent/child relationship.

#

You would like to have this original edit-time parent/child relationship still represented in the Entities Hierarchy in some way.
Correct?

desert island
gleaming haven
#

That's exactly what I was also thinking. Maybe a sort of "original hierarchy" mode or "bake-time" / "edit-time" mode in the Entities Hierarchy could offer that. Any other ideas?

#

Note that the editor does retain that link btw.
You simply need to use both the classic game object Hierarchy view AND the Entities Hierarchy view to see it.
See below.

#

In this case, the Convex game object is a rigid body that is a child game object of the Cube.
The corresponding entities get unparented as you can see in the Entities Hierarchy view.
When clicking on either Convex entry in the Hierarchy or the Entities Hierarchy view, it highlights the corresponding entry in the other view as you can see here:

#

So the information on what game object a given Entity was created from is retained and it is represented in the UI.

#

You can also ping the game object from an entity as follows:

#

In this tooltip you can see that the information that is retained for an entity is its "source game object".

#

So theoretically, the Entity Hierarchy could offer that additional view as a separate overlay or mode but since this view is effectively represented by the classic Hierarchy view, this would be duplication of information.
Let me know if the information above helps to provide a sufficiently improved debugging experience or if you would like something improved or added here.

desert island
#

And I also want to feedback that until latest 1.0.14 release, Entities Hierarchy is still buggy with error spamming and now even worst. At Entities Hierarchy with subscene opened, most of the time when u select entity it keep showing game object authoring instead of entity with components at inspector. No matter how u change switch the mode at inspector and entities hierarchy still can't fix the issue

gleaming haven
gleaming haven
desert island
desert island
gleaming haven
#

@desert island : Are you aware of the "mixed" mode in the Entities Hierarchy?
If you use it combined with the runtime mode in the Inspector, you can still see the hierarchy of game objects in the Entities Hierarchy side by side with runtime generated entities (which were not baked). When you then click on a game object within that hierarchy it shows you to the entity's components in the Inspector.

The runtime / mixed modes can be selected with the dots I marked in the screenshot.

desert island
# gleaming haven <@303918357961375745> : Are you aware of the "mixed" mode in the Entities Hierar...

Looks like Mixed Mode covered most of my needs but something still missing. Seems like this debugging experience doesn't work at prefab entity that u bake game object prefab authoring using GetEntity() and at Mixed mode it will only show instantiated entity from prefab entity and it doesn't show prefab entity. So basically it can't show corresponding game object prefab authoring that make it not possible to get debugging experience like screenshot. I test it at dots netcode project that maybe this issue only happen at dots netcode?

gleaming haven
#

@desert island : To confirm my understanding, are you referring to a Game Object Prefab which you bake into an Entity Prefab and that you then instantiate into Entity Prefab Instances at runtime using EntityManager.Instantiate?

gleaming haven
#

Here is an example to show what happens with Game Object Prefabs that are baked into Entity Prefabs, and then instantiated at runtime into Entity Prefab Instances.
This is taken from the Collider Filter Change demo in the PhysicsSamples project.

As you can see below, in run-time mode of the Entities Hierarchy the Game Object Prefab, which is not in the game object hierarchy since it is only referenced in the authoring components but not directly added to the scene, does appear as a baked Entity Prefab in the Entities Hierarchy.

#

The run-time instantiated Prefab Entity Instance also appears in the Entities Hierarchy as expected. Here you can see that the instance does not have the Prefab tag.

#

In mixed mode, the Entities Hierarchy does no longer show the Prefab Entity, which is consistent in a way with the fact that that entity also does not appear in the standard game object hierarchy.

#

With that example in mind, is there anything that you think is incorrect and should be different?

#

@desert island : Update here.
You can even in mixed mode see the entity prefabs by adding the +IncludePrefab filter. Hope this helps!

desert island
gleaming haven
#

That's the part I would need a bit more clarification on. As you can see above, the entity prefabs which are baked from game object prefabs that are not part of the scene tree are not displayed in the Entities Hierarchy in mixed mode just like they are not displayed in the Game Object Hierarchy.

Wouldn't that be as expected?

Furthermore, when the Entities Hierarchy is in runtime mode, it shows everything that exists at runtime in the Entities world.
Again here, I imagine that this is what would be expected.

If you would like specific changes to this setup, let me know what you have in mind.

#

Finally, when you have game object prefab instances, instantiated from a game object prefab, which appear directly in the scene tree and are shown in the Game Object Hierarchy, then they will also appear in the Entities Hierarchy in mixed mode. This seems to be also as expected. Let me know if you think otherwise.

You can see this situation below, taken from the Change Box Collider Size demo in the PhysicsSamples project.
The "DynamicCube" and the "DynamicCube (X)" game objects are game object prefab instances of a "DynamicCube" game object prefab in the project.
Since these are all instantiated at edit time, they will all appear as regular entities after baking as per design without any relationship to a prefab.
The Entities Hierarchy in mixed mode then shows them as would be expected.

desert island
# gleaming haven That's the part I would need a bit more clarification on. As you can see above, ...

🤔 I didn't expect it works like that until u tell me. Anyway if this is how official designs it and how entities hiearchy mixed mode should work, then official will need to implement some kind of entity logical grouping for a couple of use case like unparent physics entity and also ghost entity that its child entity has zero transform component that both are spawned from prefab entity. Since according to this design, there's no way to get same debug experience like directly drag and drop game object into subscene to bake into entity version.

gleaming haven
#

I believe the intention is that the Entities Hierarchy and Game Object Hierarchy views are used at the same time to unlock all the workflows: game object workflows, i.e., the drag & drop you mentioned, and entities workflows, i.e., inspection of baked and run-time spawned entities.