Scene Graph - Editor behavior that easily becomes the source of bugs

Summary

The editor behavior of components is somewhat incorrect compared to what you would normally get statically flagged at compile time in code.

Some of it was mentioned in the following report but none of it was actually addressed: [Major] Many `@editable` values cannot be set any more (Scene Graph)

Please select what you are reporting on:

Unreal Editor for Fortnite

What Type of Bug are you experiencing?

UI/Tools

Steps to Reproduce

Here’s the code to reproduce the behaviors.

vz_test_non_concrete_editables_component := class<final><final_super>(component) {
  @editable
  ENonConcrete: vz_non_concrete_class

  @editable
  ESetNonConcrete: vz_non_concrete_class = vz_non_concrete_class { Number := 42 }

  @editable
  EOptionalNonConcrete: ?vz_non_concrete_class

  @editable
  ESetOptionalNonConcrete: ?vz_non_concrete_class = false

  @editable
  ENonConcreteArray: []vz_non_concrete_class
}

vz_non_concrete_class := class {
  @editable
  Number: int
}

Expected Result

  • NonConcrete field should say Set to Value
  • EOptionalNonConcrete field’s drop down options should present None as an option
  • ESetOptionalNonConcrete should be set to None
  • All fields that have no default value in code should have NO default value assigned by the editor, regardless of the type being concrete (source of bugs). Therefore the Number field should say Set to Value instead of 0.
  • Index [...] element of ENonConcreteArray should not default to the base class.
  • When a value is not set, it should say Set to Value instead of None. None should be reserved for representing false of an optional type of if potentially an enum with an explicit None case.

Observed Result

  • ENonConcrete field says None, but it really should be saying Set to Value
  • EOptionalNonConcrete field correctly says Set to Value but the drop down menu does not provide the None as an option. The type is ?vz_non_concrete_class so false aka None should be an option
  • ESetOptionalNonConcrete incorrectly says Set to Value, but it really should say None as the value is explicitly set in code to false
  • ENonConcreteArray automatically assumes we want to use the vz_non_concrete_class class as its new element even if there could be more subclasses. Additionally if we set the the type to the class, all concrete fields are automatically initialized with a default value, this is a source of bugs. In code initialization process is explicit for a good reason and types without a value, even if they are concrete cannot be omitted from the explicit user written initialization process. The editor circumvents this by giving types that are concrete a sort of “convenience”, but in reality this will lead to wrongly / unintentionally set values when using the editor workflow.

Platform(s)

PC / UEFN

cc @Vath

1 Like

FORT-901741 has been created and its status is ‘Unconfirmed’. This is now in a queue to be reproduced and confirmed.