In world partition levels, deleted actors can become unexpectedly unloaded prior to saving, causing loss of work. Specifically, this issue occurs after the undo history has been cleared (either manually or through some other editor operation) and a subset of deleted actors are saved. When it happens, previously deleted actors are removed from the unsaved asset list and become unloaded in the level editor. Once in this state, the deletion of the affected actor is lost and it is unable to be loaded through pinning or the world partition minimap until the map is reloaded.
A licensee suggested cause of this issue is how world partition tracks dirty actor packages. The class TExternalDirtyActorsTracker makes use of a map with weak object pointers as keys. Unfortunately, the equality operator for weak pointers returns true when comparing two pending kill objects, even if they are pointing at different objects. This can lead to the wrong entries being removed from the map when deleted actors are undirtied, as they are pending kill and TWeakObjectPtr::Get() will return nullptr.
Once an incorrect entry is removed from the dirty actor map, it will cause the affected actor to be prematurely destroyed in the next garbage collection pass due to how world partition maintains references to deleted actors. Once GC'ed, the actor will be unloaded in the level editor and all changes to it lost.
A simple world partition map with two static mesh actors is attached to this bug report. In order to reproduce this issue, the map and actors must have been saved to disk and NOT newly created.
1. Load the Bug_ActorUnloading level and ensure that a region encompassing the Cube and Cube2 actors is loaded in the World Partition minimap.
2. Delete the Cube and Cube2 actors.
3. Select Edit > Undo History from the top menu bar, then discard all transactions using the trash can icon in the bottom left of the window that appears.
4. Open the unsaved asset list by click the "2 Unsaved" button at the bottom right of the main editor window.
5. Uncheck the entry for Cube and ensure that the entry for Cube2 is checked, then click Save Selected.
6. Open the unsaved asset list again, which forces garbage collection to run.
7. When the bug occurs, observe that the actor Cube will show up as unloaded in the Outliner window and be unable to be pinned. The unsaved asset list will also become empty, no longer listing an entry for Cube, preventing its deletion from being saved.
8. Reloading the map restores the actor Cube back to its original, undeleted state.
Please note that this issue is non-deterministic since it involves the hashing of memory addresses and may take several attempts to reproduce.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-270089 in the post.
0 |
Component | UE - World Creation - Worldbuilding Tools - World Partition |
---|---|
Affects Versions | 5.5.4 |
Created | Apr 11, 2025 |
---|---|
Updated | Apr 22, 2025 |