Non-deterministic actor names created by ChildActorComponent if level uses OFPA

When cooking a level, if actor is in OFPA level, UChildActorComponent::CreateChildActor sets Params.OverridePackage to non-null value (a UPackage in ExternalActors subdir that contains the owner actor) and calls UWorld::SpawnActor. Since SpawnParameters.OverridePackage is non-null, this function sets bNeedGloballyUniqueName flag and passes it to FActorSpawnUtils::MakeUniqueActorName - which uses FActorGUIDGenerator to generate a name for a new actor, which builds a GUID using machine’s MAC address (bad news for deterministic cooks) and current timestamp (complete disaster for deterministic cooks).

[Attachment Removed]

Steps to Reproduce

  1. Create a blueprint and add ChildActorComponent
  2. Create a level, enable OPFA and add an instance of the blueprint
  3. Cook the level twice (normally and then with -diffonly)
  4. Observe diffs in actor names
    [Attachment Removed]

Hello,

We are having a hard time to reproduce the problem with the steps you provided. Can you share a project that demonstrate the problem?

Regards,

Martin

[Attachment Removed]

Hi,

Sure - please see attachment - it contains a simple level and two actors. Actually, given that it’s an OFPA level, I’m not sure how helpful it would be - some part of the level is stored somewhere in external-actors dir with unknown hashed name.

While preparing this repro case, I’ve realized that a critical thing missing in my original steps was to ensure that level is saved *without child actor*, so more specific steps to reproduce would be:

  1. Create two empty actor blueprints (Test_ActorChild and Test_ActorParent in my example)
  2. Create new level, save (call it Test_Map), then enable OFPA (confirm conversion to external actors), drag an instance of Test_ActorParent, save again and close (load some other level instead)
  3. Open Test_ActorParent, add ChildActorComponent and assign Test_ActorChild as an actor to spawn.
  4. Cook normally (-run=Cook -TargetPlatform=Windows -Unversioned -cooksinglepackagenorefs -package=/Game/Test_Map)
  5. Cook in diff-only mode (-run=Cook -TargetPlatform=Windows -Unversioned -diffonly -cooksinglepackagenorefs -package=/Game/Test_Map)
  6. Observe the diffs.

If you set up the actor blueprint before adding to the level, it would be stored with an instance of Test_ActorChild, so on cook it would try to preserve the name.

[Attachment Removed]

Hello!

Thanks for sharing the extra details. I logged an internal bug report for the team to review this problem. You will be able to follow its evolution here: https://issues.unrealengine.com/issue/UE\-365939

Regards,

Martin1

[Attachment Removed]