PCG Biomes v2 partitioning for local biome graphs

Hi, I was playing around with the PCG Biome v2 plugin that was released with UE 5.6, and I was wondering how to make it fully partitioned.

Let me demonstrate what I have in mind on the PCG Biome Sample level. I’ve enabled the partitioning on the main PCGBiomeCore graph, so far, everything works fine. I’m working on a large-scale map (much bigger than the sample scene), and I want to have some Biomes spread across the whole level. Let’s use the BroadleafForest as an example. Having one huge non-partitioned graph is not the greatest idea(when I make changes in one area, I don’t want to run the graph for the whole region - even the LandscpaStreamingRegion is too big).

[Image Removed]

[Image Removed]

So, I also want to make BroadleafForest partitioned. Once the partitioning option is selected, the biome disappears completely.

[Image Removed]

This makes sense since I can no longer access the data generated from the LocalCore graphs because it is no longer stored in the BiomeActor(BroadleafForest) PCG component, but instead is stored inside the PCGPartitionGridActors.

[Image Removed]

I tried accessing the PCGPartitionGridActors and retrieving the PCG component data from there, but in the end, I think some recursion is occurring from time to time. Since everything seems to be calculated, but for some reason, more and more tasks are being added to the PCG queue, and it seems like the same objects are being spawned again and again.

[Image Removed]

[Image Removed]

How can I achieve something like this and eliminate the recursion? Or is there any other (better way) to do this?

Edit:

I found out that I can just remove the Component Selection Tag on the get Actor node in BiomeCore graph. But is that the right way to implement this?

[Image Removed]

Steps to Reproduce

  • Enable PCG Biome Sample plugin
  • Open the Sample scene
  • Enable Partitioning on PCGBiomeCore
  • Enable Partitioning on BroadleafForest
  • Now BroadleafForest dissapeared

Hi Adam,

I’ll have a chat with JS that did the biome plugin, but if I recall correctly, the goal in biome core (v2) is to have local biomes that you can also partition, but I might be wrong - so there might be something wrong here.

Cheers,

Julien

Thank you. Looking forward to your answer.

Have a good one,

Adam

On the topic of partitioned graphs interacting with each other. What is the best way to transfer data between 2 partitioned graphs that are dependent on each other/having two partitioned graphs dependent on each other in general?

Example: Let’s say I have an actor in the level with graphs A and B that are partitioned and completely independent of each other. There is also a third partitioned actor with graph C, which is dependent on the output from graph A. What is the most efficient way to get data from graph A in graph C (without also sampling data from graph B)?

Hi Adam,

I had a quick chat with the owner of the biome plugin, so:

  • Currently only partitioning (+ opt. Hierarchical generation) is supported on the global biome core.
  • Partitioning on local biomes isn’t supported (unfortunately) at this point, and will not be before at least 5.8.
    • There’s no technical limitation to do it as far as I know, but we have not had the time to implement this (data side).
  • Runtime biome core might not work with a partitioned global biome core (this I wasn’t aware of) so YMMV, but you might not need it.

For these reasons, you probably want to use smaller biomes/multiple biomes instead of very big/complex biomes at this point in time.

Or you can modify Biome Core to support it, though it’s not going to be trivial.

Sorry again for that.

Cheers,

Julien

With respect to graphs interacting with each other, there are a few things that are possible:

  • What’s done in biome core:
    • A partitioned ‘C’ takes data from non-partitioned data and affects only what’s in this partition actor’s bounds
  • In C you should be able to get the PCG component data for specific grids.
    • Use the ‘Get PCG Component Data’ (or the Get Actor Data) node, go in the ‘Data Retrieval Settings’, uncheck ‘Get Data on all Grids’ and select the grids you’d be interested in.
    • Preferably, you don’t get data from downstream (I would assume you’d get warnings but if you don’t you might just get not great performance).

There are more approaches - writing data to specific places, etc., but these two should work out of the box with little effort.

Hope this helps,

Julien

Hi Julien,

First, thank you for your answer.

I’ve already noticed that when you enable partitioning on the global core, unless you disable the runtime generation, the engine starts lagging a lot and becomes quite unstable.

So, if I were to go with the route of modifying the Biome Core, could you give me some pointers on where to start and what I should be mindful of?

While I was waiting for your response, I’ve figured out a way to make it run with both the local and global cores being partitioned. I found out that I can just remove the Component Selection Tag on the get Actor node in the BiomeCore graph, and the system starts working again. Maybe this is a bad idea to do it this way, if it is the case, could you explain why? So far, I’ve tested this solution on my test map that is about 12x8km in size, and it seems to be working fine.

Also, regarding the data interaction between the two graphs. Correct me if I’m missing something or not understanding this properly, but there is currently no out-of-the-box method to send data from one partitioned graph to another partitioned graph?

Thanks once again for your answer and your time.

Have a great rest of the day,

Adam

Hi Adam,

If you wanted to partition the local biomes, basically you’d need to make sure that the global core gathers everything properly (should be easy), and for performance reasons, probably make sure you’re not applying priority operations between them (since they won’t overlap, really you don’t need to do anything).

Otherwise, for runtime gen, I am not quite sure what’s needed but I would assume what happens is that there might be work that’s just not needed at a local level - which is going to be a bit tricky, basically you might need places where you update data to the GPU but it shouldn’t be at a small grid size.

However, it might not work well if you’re using the unbounded grid size because that might be too much data and so on.

I would start there, but let us know if you have more precise questions.

About the partitioning - I will have a look, but I would assume the component tags were there so that only the relevant data is queried from the actors.

I’m 90% sure in this case that the issue is that the tags from the original component (your local biome) isn’t propagated to the local components (on the partition actors) which is the reason why the query was failing.

In this case I think you’ll be fine removing that limitation, but you might need to do some filtering in some cases if your biome actors have other things on top.

Finally, about data interaction between graphs - you’re partially right -

  • There is nothing to support data transfer between graphs on a per-grid basis (e.g. hierarchical generation)
  • However, you can transfer data on partitioned (not hi-gen) actors by virtue of passing the data to the output node + querying it from another graph w/ Get PCG data.

Hopefully that answers your questions.

Cheers,

Julien

Oh, just randomly ran into this because you’re not the only one looking into this it seems (on Unreal Source discord, on the pcg channel) -

It seems like the runtime gen isn’t efficient because the ground scatter graph gets one ‘weighted asset’ data entry per 25600 cell, on each of the 6400 grids, so it will loop a lot while it’s not needed, instead of getting a single data only for the 25600 cell that overlaps.

The solution in this case is to make sure that the data retrieval happens at the ‘right’ level only with a Set Grid Size node at 6400 prior to the Get Actor Data node that retrieves that.

Hope this helps,

Cheers,

Julien

I’ve implemented the changes you recommended, and it seems to be working just fine. Thank you!

As for the issue with the tags, is there any ETA for when it might get fixed?

Thanks again,

Have a good weekend,

Adam

It’s not fixed yet (I’ll create a jira on our end - expect a fix in 5.8), but if it’s just a question of propagating the tags from the original component to the local components, I think you could do it quick like this -

In PCGComponent.cpp, in the UPCGComponent::SetPropertiesFromOriginal method, add this line:

ComponentTags = Original->ComponentTags;That is called in every instance where we’re updating partition actors and their local components so that might be fine.