Hi,
After upgrading to 5.8.2 from 5.7.3 we noticed that our runtime PCG was not working in-game but was still working perfectly in the Editor. Upon deeper investigation we found that the issue stemmed from the missing textures that we expected to come out of the GenerateLandscapeTextures node, this was returning nothing at all, no height, no grassmaps.
We managed to track it down to how it gets the landscape data, and the culprit at the end was the function ‘ULandscapeInfo::XYtoComponentMap’ which is commented to only work in editor, before in 5.7 the path taken was quite different and used to just loop over the landscape proxues and not use the ULandscapeInfo at all. We ahve added a workaround by implimenting the 5.7 logic after the new 5.8 logic if the returned data is empty, which results in the 5.8 path being used in the editor and only the 5.7 patched path in the build.
5.8
Plugins/PCG/Source/PCG/Private/Elements/PCGGenerateLandscapeTextures.cpp
// :612 one-shot guard, so any early-out below is terminal
if (!Context->bLandscapeComponentsFiltered)
// :708 new in 5.8
if (!Context->Landscape.Get() || !Context->Landscape->GetLandscapeInfo())
{
return true; // silent
}
// :720 new in 5.8, reads the editor-only map
Context->Landscape->GetLandscapeInfo()->GetOverlappedComponents(FTransform::Identity, Extent2D, OverlappingComponents, ComponentIndicesBoundingRect);
// :853 the exit actually taken in a game world
if (Context->LandscapeComponents.IsEmpty() || (Context->GrassNamesToOutput.IsEmpty() && !Settings->bGenerateHeightMap) || !Context->TotalLandscapeComponentBounds.IsValid)
{
return true; // silent
}
5.7
Plugins/PCG/Source/PCG/Private/Elements/PCGGenerateLandscapeTextures.cpp
// :289 looping over components to get data
for (ULandscapeComponent* LandscapeComponent : LandscapeProxy->LandscapeComponents)
.......
Question is, is this a regression or is there a new way grass maps are supposed to be fetched in 5.8? have we just hit a wierd combination of things that means this doesnt work in our current project. Looking at the vast amount of changes to the grass-map system in 5.8 make me wonder if we were happening to have things working well before by accident? I feel like maybe our landscape should be registering into the new 5.8 path but it isnt which could be why the whole thing fails, but considering it works perfectly in the Editor but not at all in PIE or the Build and adding the old 5.7 code path in fixes the issue, a regression also feels possible.
Some landscape specific context is we are 2x2km maps at 0.5m resolution, using the landscape patch plugin and as you can see we are in WP so streaming proxies and not a single landscape actor, one specific there is even though we are using WP we have disabled streaming.
Cheers,
Andre