Blueprints derived from c++ classes not updating properly

toilari
Thu, 26 Nov 2015 17:25:59 +0000
Editor Scripting

Branch: Binary

Build Version: 4.10.0-2758231

Description:
It seems that in some cases blueprints are not getting updated after hot-reloads (or their variables are not initialized to accommodate new variables or changes in existing ones) This is mostly noticeable when adding methods to OnComponentBeginOverlap via AddDynamic(…) (and I believe this is true for other events too), and I’ve got some weird behavior with default subobjects a few times too. I haven’t been able to come up with any reliable way of reproduce described behavior, even though I’ve come across this issue multiple times during past few days.

In the case with subobjects becoming null, output log had something about serialized properties being NULLed during hot-reload. However, even while log stated that object was re-instantiated successfully, ubobject was null without any way of recovering. Bug seems to be similar to this bug report: link

As a workaround, issue can be fixed/avoided by simply renaming the variable each time the class is changed, but it gets annoying quite quickly.

Bug with the AddDynamic(…) is described here: link. However, the strange part is how this seems to happen seemingly at random, thus making debugging these issues a horrifying mess, especially if large quantities of newly written code is involved.

**EDIT: **

Further trying to investigate this issue, I still haven’t been able to find a reliable way of reproducing the behavior, at least not in a fresh project. In existing project however, every time a new UPROPERTY is added (or removed) to certain classes, existing references to those classes are getting NULLed during hot-reload, and new instances are not getting instantiated. The only way to generate a new instance is either re-create the blueprint or to rename the property containing the reference to the NULLed component.

According to logs, it seems that serialization is treating the class as a new class after adding/removing the UPROPERTY.

LogClass: Could not find existing class ProjectileSpawnerComponent in package /Script/coOP for HotReload, assuming new class

After which hot-reload proceeds as expected, until:

LogHotReload: Re-instancing coOPCharacter after hot-reload.
LogProperty:Warning: Serialized Class /Script/coOP.ProjectileSpawnerComponent for a property of Class /Engine/Transient.HOTRELOADED_ProjectileSpawnerComponent_2. Reference will be NULLed.
    Property = ObjectProperty /Script/coOP.coOPCharacter:ProjectileSpawnerComponent
    Item = ProjectileSpawnerComponent /Game/coOP/Blueprints/Characters/BP_coOPCharacter.Default__SKEL_BP_coOPCharacter_C:ProjectileSpawner
LogProperty:Warning: Serialized Class /Script/coOP.ProjectileSpawnerComponent for a property of Class /Engine/Transient.HOTRELOADED_ProjectileSpawnerComponent_2. Reference will be NULLed.
    Property = ObjectProperty /Script/coOP.coOPCharacter:ProjectileSpawnerComponent
    Item = ProjectileSpawnerComponent /Game/coOP/Blueprints/Characters/BP_coOPCharacter.Default__BP_coOPCharacter_C:ProjectileSpawner
LogHotReload: Re-instancing ProjectileSpawnerComponent after hot-reload.

As additional notes, UProjectileSpawnerComponent is a UActorComponent and is added via CreateDefaultSubobject<>(…) to the AcoOPCharacter. Nothing special, that is.

What comes to the other part of the issue (Events and AddDynamic(…)), it seems to have vanished, as I haven’t been been able to reproduce it anymore.

4 posts - 1 participant