Map build data ids (and anything else derived from FActorInstanceGuid) end up incorrect upon loading, unloading, and reloading a world partition cell without a garbage collection in-between.

In the scenario where world partition reuses a previously-loaded cell, this issue can occur. My understanding is that FActorInstanceGuid::GetActorGuids only works until an actor has finished registering, at which point the actor guid structure for that actor is thrown out. The problem with this is that since a level can get unloaded (but not deleted) and then reused later by world partition, any initialization logic for an actor and its components can end up calling GetActorGuids again despite the annotation having been thrown out on the original load.

This causes a problem in UStaticMeshComponent::UpdateMapBuildDataId (and possibly elsewhere) where map build data ids get updated from FActorInstanceGuid - on the second activation of the world partition cell the actor instance guid will be completely different from the first activation.

Our current solution is to modify UpdateMapBuildDataId to check if the actor guid is invalid before trying to update the build data ids, but it seems like there should be a better solution.

Steps to Reproduce

  1. Create a statically lit world partition scene
  2. Package the project (this issue is cooked-only).
  3. Enter, exit, then quickly re-enter a world partition cell.
  4. Observe that static lighting data is lost.

We’ll have a look at fixing this.