Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

1.0.0

Issue ID

ECSB-313

Regression

No

Entities Hierarchy does not display Entities when instantiated through Script and using a custom world

Package: Entity Component System (ECS)

-

How to reproduce:
1. Open the “Entities_Hierarchy_Bug” project
2. Open the “SampleScene“
3. Enter Play Mode and observe the Entities Hierarchy window in Runtime Mode (Window > Entities > Hierarchy)

Expected result: 5 Entities are visible in the Entities Hierarchy window
Actual result: none or less than 5 Entities are visible in the Entities Hierarchy window

Reproduced with: 1.0.0-pre.65 (2022.2.19f1, 2023.1.0b16, 2023.2.0a14)
Could not test with: 0.17.0-preview.41 (2020.3.48f1, 2021.3.25f1, 2022.2.19f1, 2023.1.0b16, 2023.2.0a14), 1.0.0-pre.65 (2020.3.48f1, 2021.3.25f1) (Could not resolve scripting errors)

Reproduced on: Windows 11

Notes:
1. Sometimes, when opening the project or loading the scene, all the added Entities will be listed in the Entities Hierarchy window (Window > Entities > Hierarchy), reload the project and the issue will be reproducible again
2. Sometimes, only one Entity will be displayed in the Entities Hierarchy window
3. The Archetypes window displays the correct amount of Entities (Window > Entities > Archetypes)

  1. Resolution Note:

    This issue relies in how the Entities Hierarchy detects changes in Entities. The window is only checking for changes in the world if the world is _running_ ie: when systems are operating on entities. It allows the window to not do its update work when the world did not run.

    In this particular example the world will contain 5 entities but doesn't have systems operating on it. This will cause the EntityManager.GlobalSystemVersion to not be incremented, causing the window to determine that no work have been done, and thus to not look for new changes since its previous update.

    If you manually reload the window you will see the entities appear.

    Unfortunately at the moment we don't have any public API to increment this EntityManager.GlobalSystemVersion. But there is an internal way: by calling world.EntityManager.GetCheckedEntityDataAccess()->EntityComponentStore->IncrementGlobalSystemVersion();

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.