Prevent PCG partition despawning

Hello,

when using PCG´s generation trigger “Generate At Runtime”, is there a way to prevent partitions from beeing despawned again when going further away?

[Attachment Removed]

Steps to Reproduce[Attachment Removed]

Hi Maximilian!

So ‘Generate At Runtime’ means ‘fully taken care of by the runtime generation system’ which manages generation & cleanup based on the distances in the graph settings, but this is of course dependent on the actor having the PCG component being loaded (which we’ll call the original here).

I’ll do a quick side-trip on your potential issue here that’s not really PCG related:

If the original is unloaded because of world partition, then of course it will be despawned - this is based on the size of the actor, your streaming settings and so on. It is possible to mark an actor as ‘always loaded’ though.

Otherwise, here’s how it works in PCG:

If your PCG component is set to ‘Generate At Runtime’ then, it will be generated & cleaned up based on the presence & absence of generation sources ‘near’ it.

If:

  • the PCG component is not partitioned
    • this is equivalent to generating at the unbounded level (so will be generated once as soon as it is streamed in + will be cleaned only when streamed out)
  • the PCG component is partitioned but the graph is not using Hierarchical Generation
    • this will use the same generation radius (& cleanup radius) as the smallest greater or equal generation radius as defined in the graph settings.
  • the PCG component is partitioned & uses hierarchical generation
    • this will use the appropriate grid based on how you’ve built the graph - note that nodes that aren’t “after” a grid size node will be running at the default level (as defined in the graph settings).

The cleanup radius is the generation radius multiplied by some value (to prevent aliasing based on distance).

So to go back to your question:

By design/definition the ‘Generate at runtime’ will manage cleanup based on distance to generation sources.

However, generation can be done at runtime (.. just not using the distanced based generation directly) with the other triggers - either manually with the ‘On Demand’ or based on streaming with the ‘Generate On Load’ options. In both cases, the actors (and their partitioned actors, if any) will be despawned on streaming - this is just the way it works. If you don’t want anything to be unloaded, then it should be marked as always loaded.

Hope this clears out the situation, but let me know if you need clarification.

Cheers,

Julien

[Attachment Removed]