We just integrated 4.14 into our game and I was interested in trying out the Event Driven Loader, but it seems to have issues with some of our content that prevents the cooker from working properly.
We have some slightly unusual content, as we have a lot of blueprints whose class default objects have instanced subobjects (i.e. subobjects referenced via properties with the Instanced specifier). Sometimes these subobjects need to be recreated in PostLoad due to things like properties being deprecated, so in some cases we have a PostLoad function declared on the code class that the blueprint inherits from, which creates a new subobject using NewObject and sets it on an Instanced property.
The CDOs of these blueprints are used at runtime, as they are mostly used for storing designer-editable data, so we don’t want to have to create instances of them at runtime just to read off some default values.
The first issue I came across was that when cooking, if there was a blueprint class A that had a default property referencing another blueprint class B, and if class B’s CDO had subobjects, the cook would fail with this message:
Can't save X: Graph is linked to external private object Y
and if I let it find the referencers, it would show that A’s CDO was referencing B’s CDO, which was referencing the subobject of B’s CDO, which is the expected chain of references. I didn’t realise this wasn’t allowed, as this exact same content cooks fine with the EDL disabled.
After investigating a bit, I found out that where we have subobjects created from the code class’s constructor with CreateDefaultSubobject, they get the RF_Public flag which seems to prevent this error, but since we’re recreating these objects in PostLoad with just a standard NewObject call and no flags specified, many of our subobjects don’t have RF_Public.
I tried to fix this by adding some PostLoad code to call SetFlags(RF_Public) on all the subobjects (which in fact didn’t work because of this issue: https://issues.unrealengine.com/issue/UE-38234, so eventually I had to hack in a console command to call PostLoad on all the subobjects that had been missed). Setting the RF_Public flag allowed the content to cook successfully, but then when the game tried to load the content, I got this message:
"Could not find import X.Y in package Z, this is probably related to adding stuff we don't need to import map under the 'IsEventDrivenLoaderEnabledInCookedBuilds'."
So it seems that the necessary subobjects are still not being cooked, and the RF_Public flag just prevented the cooker from complaining about it. I noticed that CreateDefaultSubobject adds other flags as well, such as RF_DefaultSubObject, so it could be that adding those to all of our existing subobjects will fix it, but because of the diversity of the content (several code classes, 100+ blueprints based on them) and PostLoad not being reliable, it was such a huge effort just to add RF_Public to them I didn’t want to go any further just based on guesswork.
Do you have any ideas about what might be going wrong here and how we can fix it? Please let me know if there’s any more info you need.