[5.7] About the level actor data loss on blueprint error

This question was created in reference to: [Child blueprint class can loose modified properties on it’s instance placed in level due to error caused by change in parent [Content removed]

Hello :slight_smile: This bug is slightly problematic as it also affect validation errors, not only raw blueprint compilation error, i managed to sortof track down one part of the issue

[Image Removed]

the bErrorFree variable would be false when the compiled blueprint have an error, leading to the actor in the level loosing all its components, the problem is probably not here but before that point

another part of the issue is here

[Image Removed]

I’m guessing that the cached actor data doesn’t include the ongoing modification of the original ticket (i didn’t test out that case myself tho)

But there is two issues for me, first, a validation error should not prevent actors from beeing reconstructed (i’m guessing a flag like the warnings specific for validation error would do, as long as it’s not BS_Error, it should not prevent the actors from reruning construction scripts), it’s often sanity check that we put in place and it’s easy for people to just say they will fix it later, in the meantime, they could go over the maps and resave corresponding actors without noticing that they are now saving close to empty actors

For the second one i’m just doing a wild guess here, but isn’t preventing doing anything on the actors at all in case there is an actual blueprint compilation error would be something possible ? or there is too much going on behind the scene for that kind of workaround to work ?

[Attachment Removed]

Steps to Reproduce

See the linked support ticket

[Attachment Removed]

I just tested the original case as well, the problem is far more concerning that i first though, even on a saved asset, fixing the child BP, a static mesh will not come back for example, the only way to get back a valid actor is by reloading the levels, this can really easily lead to data loss and could potentially lead to a massive work to redo

[Attachment Removed]

I managed to found another piece of the puzzle, basically this diff

[Image Removed]is removing at least the data loss part, if people come across, please don’t use it, i have no idea of the side effects of this

now for the reason why, the components are renamed before the duplicate of the class, and restore after the class have been duplicated, and i’m not sure how and why, but this manage to corrupt the sourceComponentTemplate

[Image Removed]they get new names, so when we the actor construction is trying to reapply them

[Image Removed]the names between the sourceComponentTemplate and the component template don’t match, and we loose the data

[Attachment Removed]

Regarding to prevent the actor resave when in a corrupted state, a proof of concept could be

[Image Removed]to prevent any save from happening, even if a dedicated flags would probably be best

[Attachment Removed]

This is great investigation - if you have a test case demonstrating the bug please share it with us and we can get it prioritized. If you do have a fix feel free to link it here - but the fragile nature of this code means that a supporting test case will be very helpful.

[Attachment Removed]

Thx :slight_smile: The original support had a repro in it, that i used for my own testing, i do have a modification that remove the data loss part, this

[Image Removed]From the code getting removed, it look liked it’s an optimization or to not duplicate Archetype components, didn’t see any side effect of this for now, but yeah an insight would be appreciated :slight_smile:

the original ticket [Content removed]

the engine issue associated https://issues.unrealengine.com/issue/UE-368907

[Attachment Removed]

ps: For my test case i used a really simple setup like the one in the original ticket, but to be sure it was a new map with actor in external package activated (what we use most)

then 2 really simple Blueprints, the parent, with a custom even taking a bool, and a static mesh component

then the child, which call the custom even from the parent in the beginplay, which i give a litteral bool to the parameter

Place a BP_Child on the map, setup a mesh for it (Cube for example)

Modify the BP_Parent to not take a boolean to the function

after that, the BP_Child is getting recompiled and the code in the post before modify the components names, leading to the current state of the object not beeing reapplied, even when i remove the bool parameter in BP_Child

[Attachment Removed]

This popped back up in my queue and I spent some time trying to reproduce the probelm but I failed. If you have a test asset that demonstrates the bug please attach it.

[Attachment Removed]

On which version did you test to reproduce ? i was able to reproduce with the original ticket repro steps, with 5.7, maybe part of the issue has been fixed already on main, i saw this for example

https://github.com/EpicGames/UnrealEngine/commit/7bc06f2e3699f98cc5cfce8fe842b40adbebad3c

but it’s only a part of it, and seemed to have referenced the original issue https://issues.unrealengine.com/issue/UE\-368907, which is now fixed, but the problem is wider than just the root transform, if i have some time i will create BP_Parent and BP_Child

[Attachment Removed]

In general I test at head, unfortunately. If you have a test project I can run it through a regression search, but without a test project I can only test at head and verify the issue doesn’t occur.

[Attachment Removed]