Duplicate APCGWorldActor while using ULevelStreamingDynamic::LoadLevelInstance

Hi,

We’re using ULevelStreamingDynamic::LoadLevelInstance to load between a ‘world map’ map and individual smaller maps, we also make use of Data Layers to separate the two types of maps and use this to make sure while we stream the other map in that we only have the visual elements from the current map activated until we have fully loaded the streamed map which we then swap Data Layers being active and unload the last map.

With this setup looks like it might be affecting how Partitioned PCG is behaving as we are getting some crashes and errors and we have tracked down to a possible cause of there being 2 PCGWorldActor Actors being present and active at the same time during map streaming(since the PCGWolrdActor cannot have a data layer assigned it seems to not be designed to be used like this), one of the main issues we have seen is a crash to do with UPCGLandscapeData::ProjectPoint and the fact that the PCGWorldActor is the owner of the landscape cache makes us think that PCG is not liking the fact that there are two of these actors when there should only be 1?

Again this is mostly just guess work atm, but in general would be good to know how level streaming/map loading/unloading should deal with partitioned PCG content.

Cheers,

Andre

Steps to Reproduce
If needed we can look to try get a small repo project, but for now we are after insight more so than a fix to a specific issue, but when using partitioned PCG with a map>map streaming setup using data layers for delayed activation/deactivation and ULevelStramingDynamic::LoadLevelInstance it seems that we are getting some weird behavior(including crashes) related to PCG and the guess so far is that it might stem from multiple APCGWorldActor actors being loaded and activated at the same time, does this seem like it could be an issue?

Hi André,

It is true that we PCG supports only a single PCGWorldActor but we do support “merging” of the Landscape caches when a second PCGWorldActor registers. (APCGWorldActor:MergeFrom)

Looking at the code we are merging the newly streamed in actor into the existing one and if that one eventually gets unloaded then maybe the cache is lost at that point?

If you could craft and share a small repro of your use case, we could check it out and provide more insight and potential fixes.

Cheers,

Patrick