[VERSE] Child classes does not save editables if not mentioning @editable keyword again

Summary

Modified properties on child classes does not get saved. This includes scenarios such as compiling/building verse, pushing changes (only verse and full), reopening project and so on.

Please select what you are reporting on:

Unreal Editor for Fortnite

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

Assume the following structure:

parent_class := class {
    @editable
    MyValue : int = 4
}

child_class := class(parent_class) {
    MyValue<override> : int = 12
}

some_device := class(creative_device) {
    @editable
    Thing1 : parent_class = parent_class{}

    @editable
    Thing2 : child_class = child_class{}

    OnBegin<override>():void = {
        Print("Thing1 value is: {Thing1.MyValue}") # Works correctly with the expected value even after changing it on editor
        Print("Thing2 value is: {Thing2.MyValue}") # Will ignore any overriden value in code or editor and always shows "4"
    }
}
  • On “Thing1”, it will work properly, will show “4” on editor, and after changing the value to anything else, will properly save the updated/new value as expected without any issues.

  • On “Thing2”, it will show “4” on editor (already wrong since was supposed to be “12”). And, even if we change the value to anything else (ex. to “50”), it will not be saved. The next time that verse is compiled, project opened, or even pushing changes/launching session, that will be reverted back to being “4”.

This problem is not exclusive to this example scenario: It also happens on interfaces, on fields with unitialized values, optionals and so on… All gets reverted to the original state of closest parent with the “@editable” keyword.

On some places it can even leads to crashes (ex. unitialized properties being reseted to none). Before I discovered how to isolate and replicate the issue, this caused a lot of confusion during the development of some projects and infrastructures.

Expected Result

Overriden values (both internally on code or edited in editor) should be saved properly on devices inside the editor.

Observed Result

Overriden values does not get saved, and revert back to the initial state of the “closest” parent that implements “@editable” keyword again.

Platform(s)

UEFN/Editor

Windows 11 (v26100.4770)

Additional Notes

For additional info, as mentioned earlier on this post, it gets reverted to the closest parent that has the “@editable” keyword, such as on this example:

parent_class := class {
    @editable
    MyValue : int = 4
}

middle_class := class(parent_class) {
    @editable # note the editable keyword here
    MyValue<override> : int = 37
}

child_class := class(middle_class) {
    MyValue<override> : int = 16 # no editable keyword here
}

some_device := class(creative_device) {
    @editable
    Thing : child_class = child_class{}

    OnBegin<override>():void = {
        Print("Thing value is: {Thing.MyValue}") # Will always show "37"
    }
}

On the example above, the value shown in the editor will always revert back to the “37” of the “middle_class”, and not the “4” of the “parent_class”, since it is the closest parent that has the “@editable” keyword on that property.

Also note that this only happens with exposed classes as editables on the editor (such as on Creative Devices, NPC Behaviors and SceneGraph Components). If we instantiate the class only inside the code without ever exposing it to the editor, it will work properly as expected:

parent_class := class {
    @editable
    MyValue : int = 4
}

child_class := class(parent_class) {
    MyValue<override> : int = 12
}

####

MyFunction():void = {
    Thing := child_class{} # not editor exposed
    Print("Value is: {Thing.MyValue}") # Prints 12 as expected
}

Quick extra info: I discovered this bug a while ago (about ~2 seasons I think), idk exactly since what version this is happening, but it is not something caused by recent updates.

I only reported it now because I did not had much free time to do it before :sweat_smile:

FORT-951171 has been added to our ‘To Do’ list. Someone’s been assigned this task.