PGC Saving world state?

Hi All,

Ok so I have been messing around with the new PGC tools for the first time. I have managed to get a lovely island filled with various trees, limited to a splines interior, got to say, very very cool.

I have additionally at run time managed to get removal of individual trees, I.e. chopping a tree down for a survival game.

I am trying save the pgc state. I found how to get the seed from the pgc volume → pgcComponent, so I can save and restore that seed no problem, but all the trees I removed respawn (as expected)

My question is, how do i get the pgc graph data or instance data, save it using the game slots and restore it as it was?

Kind regards
Saragan

OK so as no one replied (like with every one of my posts, at this time 63 posts)
I spent quite a bit of time of trial and error.

ClearPCGLink doesnt seem to work at runtime at the moment (UE5.4.3), just crashes the game/editor which is a bummer really at the end of the day so, work around

→ get all classes of PCGVolume
→ get components by class (instanced static mesh component)
→ get class name of static mesh set for each instance
→ for each of these get instance count and loop over instances
→ store transform for each instance in an array for each static mesh component
→ save those transforms

On load I suppose spawn actor that has a HSIM, set the mesh, then add the instances and just cleanup the pcg at runtime so it is empty.

Not pretty and a lot of work given Clear PCGLink should work at runtime but hey, bugs happen.

So hope this helps anyone looking for something similar, as clearly people never respond to any of my questions and I always have to spend days or weeks figuring stuff out when someone could probably answer my query in a few minutes. It is very demoralizing and quite upsetting so I will not be asking any more questions on this forum.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.