BP Subclass of a BP blows away array of BP asset references inherited from parent

My guest would be that you are missing the UPROPERTY() macro. If you don’t have that, the garbage collection can pass on that and think it,s not referenced anywhere and delete those. Always use UPROPERTY() !

UPROPERTY()
TArray<TSubclassOf<AIsland>> Islands
UPROPERTY()
TArray<TSubclassOf<AIsland>> Shores

This is driving me utterly bananas.

I have a actor class in C++, ABiome. This is intended as a configuration class for a section of gameplay.
In this class are a couple members

UClass(...)
class ABiome : public AActor
{
    GENERATED_UCLASS_BODY()

    ...

     UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Islands")
    TArray<TSubclassOf<AIsland>> Islands
    UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Islands")
    TArray<TSubclassOf<AIsland>> Shores

    ...

}

i.e. this class contains an array of actor BP references (there are actually several such arrays for different types of actor BP references).

In content I have a Master_biome which inherits from ABiome. In Master_biome, I populate these arrays with maybe 20 entries and 4 entries respectively.

Then I create a child. Intro_biome.

When first created, the Intro_biome correctly shows all the entries in the inherited list. However, after a few shut-downs and re-starting of the engine, the list in the child gets blown away. In some cases the array is truncated to zero length, in other cases, the entries in the list themselves are cleared – but often not all of them.

One hint: this only seems to happen once the Master_biome and Intro_biome are actually referenced by another asset. When unreferenced, everything works fine. When referenced. all hell breaks loose.

This might sound like a complicated setup, but it really isn’t. I need the child BP, intro_Biome to override a small subset of the params in the Master_biome but not the various lists of islands. However, I cannot find any way to preserve the inheritance of those BP references reliably.

No, the UPROPERTY macros are there (just added them to the post). Sorry I forgot to include them in my hasty copy-pasting into this thread.

Hum, ok. Have you tried not using SubclassOf and only using AIsland* ? I have no real reason to think it would change anything, but maybe something to try. It will show all subclass anyway.

It looks like this is a cyclic dependency issue, causing the properties to be erased because of load order issues. These should be fixed in 4.7, which is coming very soon. Give it a shot there, and if it doesn’t work, we can investigate further!

Awesome, thank you so much for the update, Nick. I will look forward to 4.7.