# Save PCG worlds

> Seeds, graphs and graph parameters of PCG components come back after a load, and the changes players make to the meshes PCG generated, such as trees felled in...

Product: Rolly Save 1.0.0 | Sheet: guide | Updated: 2026-10-31 | HTML: https://rolly-docs.pages.dev/save/guides/procedural-content/

## Save seeds and graph parameters

**PCG Values** sits beside the actor's other saving settings: Project Settings > Plugins > Rolly Save > Actor Defaults, a Save Rule, or the actor's Rolly Save component (see [Choose what saves](https://rolly-docs.pages.dev/save/guides/choose-what-saves/)). It takes every PCG component of the actor.

| PCG Values | A save holds |
|---|---|
| Off | Nothing: PCG components start with the values placed in the editor |
| Changed Values (the default) | The values that differ from those placed in the editor, or for an actor spawned during play from its class's, so an update that changes a placed seed reaches old saves and values your game gives a spawned actor come back as the load spawns it again |
| All Values | Every value |

The values are the component's **Seed**, **Activated**, its graph, the graph parameters it overrides, and for a component set to **Generate On Demand**, whether it was generated. They save in a record of their own under the PCG component and are set with the actor's other values, before Begin Play at the default Apply Timing, so a **Generate On Load** component generates once, with them, at its Begin Play. The local components of partitioned output take their original component's values: only the original saves. Values a graph reads elsewhere, such as an actor's properties or a data asset, are not PCG values: save them as variables of their own.

## Choose when PCG generates again after a load

**Regenerate PCG**, in the same places, decides whether the actor's PCG components generate again after a load, at most once per component and load:

| Regenerate PCG | After a load |
|---|---|
| When Values Changed (the default) | A component generates again when the load set one of its values and its output was made with another seed or graph, or when the save holds a Generate On Demand component as generated and it is not generated now |
| Always | Every PCG component of the actor generates again, whether or not the save holds values for it and with PCG Values Off too, for graphs that read your saved variables |
| Never | None does: call **Generate Local** yourself, such as in On Rolly Save Loaded |

A component that generates on its own after the load set its values, as a Generate On Load component does at its Begin Play, uses them and is not generated a second time under either value; so does a generation already under way as the load sets them, which reads them as its graph runs, such as one Begin Play started for an actor whose Apply Timing is After Begin Play. A second load with the same values generates nothing. Rolly Save generates on the server or in a standalone game only, and refreshes a **Generate At Runtime** component through PCG's run-time generation, since PCG takes no other request for one. It never cleans up output: a component the save holds with Activated off, and a Generate On Demand component the save holds as not generated, keep the output they show, and a component that did not generate again says why in the Message Log (RegenerateFailed). The saved changes to its output then apply to the output as it is.

An actor a load spawns again gets its values once the load finished its spawn, after its Begin Play: a component that has not generated by then generates once, with the saved values, and one whose class gives it its graph uses them in the generation its Begin Play started.

Partitioned output generated in the editor generates again only in the cells loaded at the load. A cell that loads later takes its original's values and generates once with them, and its saved changes are set as that generation ends.

## Keep changes to generated meshes

Changes to the meshes a PCG component generates save through the **Instances** settings of the actor that holds the PCG component, for partitioned output that of the original component, never the partition actor's (see [Save harvested foliage and instanced meshes](https://rolly-docs.pages.dev/save/guides/harvest-and-instances/)): Mode Off, the default, saves none; Changes and Whole List both save the changes; both Components values take PCG output, and **Meshes** takes it by mesh. Match Tolerance, Save Custom Data, Keep Unmatched and Regrow After are that actor's. Harvest generated instances with the engine's instance functions, as any other instances.

A save holds the changes per PCG component and mesh, and for partitioned and run-time output per cell. Their places count from the PCG component's actor, or for a cell from the cell's centre, so a forest moved in an update keeps its harvest. When they are set:

| Output | Its changes are set |
|---|---|
| Generated in play: Generate On Load at Begin Play, Generate On Demand, each generation after a load | As the generation ends |
| Generated in the editor and saved with the level | With the level's other instanced components, unless the load generates it again; then as that generation ends |
| A run-time generation cell | Each time the cell generates, whichever pooled partition actor PCG gives it |
| A cell of partitioned output generated in the editor, whose partition actor streams in after the load | As its level streams in |

A generation that leaves an output component as it was, as PCG does when a spawner's inputs and settings match its last run, keeps the harvest on it. A cell the player leaves keeps its changes, and the save writes back the changes of cells not generated in the session. A cell of editor output keeps its changes as its partition actor's level streams out, and takes them again as it streams back in, also when it comes back as the objects it was after a load; with Remember Streamed Levels off, a cell whose level unloads comes back as designed, as the level's other actors do. One mesh that PCG spreads over several output components keeps its changes as one; instances your game adds come back in the first of them. Output a spawner sends to another **Target Actor** saves the same way, also when the target's level streams out and back while the PCG component stays: the output that comes back takes its changes, and the output that stayed keeps those made since. A PCG component in a streamed level takes its output's changes from that level's records as the level streams in, with Remember Streamed Levels off as designed; a level shown again as the objects it was keeps them as they stand, groups kept from an earlier load included, and changes that wait for **Apply Saved Values** stay with the level until your game asks. A part load sets the output of the PCG components in its groups as its save holds it, cells away from the player included, and output the save holds no changes for stands as designed.

**Get Rolly Instance Key** works on generated instances: a key names the PCG component, the cell and the mesh, so it finds its instance again after a generation with the same values, while a changed seed or grid size gives other keys. Removed instances regrow under Regrow After as generated output: those due come back when their output generates or by the timer, and On Instances Regrown gives their keys. A Reset Area with Reset Instances resets the changes whose place in the world lies inside its shapes. Output **Clear PCG Link** stamped in the editor, or during play, is no longer PCG output: it saves as an ordinary instanced component, which Every Instanced Mesh takes and Foliage and PCG Output does not.

With several players, the server or a standalone game saves and sets PCG values and output changes. Clients generate the output with the values placed in the editor and show the design; Get and Find Rolly Instance Key are false on a client.

## Change a PCG value during play

Set the value on the PCG component, then generate it again; the next save holds the value under PCG Values. **Generate Local** generates on the machine that calls it; **Generate**, called on the server, generates on every machine.

### Blueprint

On the PCG component, set **Seed**, or call **Get Graph Instance** and then a graph parameter setter of the **PCG | Graph Parameters** category, such as **Set Float Parameter** with the parameter's name. Then call **Generate Local** with **Force** ticked.

### C++

```cpp
#include "Helpers/PCGGraphParametersHelpers.h"
#include "PCGComponent.h"
#include "PCGGraph.h"

// After the player chose another planting for the field: Field is the PCG component.
Field->Seed = NewSeed;
UPCGGraphParametersHelpers::SetFloatParameter(Field->GetGraphInstance(), TEXT("Density"), 0.5f);
Field->GenerateLocal(/*bForce*/ true);
```

## Keep saves working when you change a graph

Saved graph parameters the graph no longer has with their saved types are not set, and of a saved graph that does not load none of the saved values is; the Message Log says so (GraphChanged), and the next save writes the values the component holds then. A graph your game cleared is cleared again by the load, which sets the saved seed and Activated and generates nothing. A parameter override your game removes during play saves too: the load takes the placed override away. A seed you change in the level reaches saves that hold none for it, under Changed Values.

Saved changes match the generated instances by place within Match Tolerance, so an update to the graph, its seed or its inputs keeps the changes whose instances stay where they were. Changes that match nothing, and those of a mesh the graph no longer spawns, are listed once in the load's Issues (PCGOutputNotMatched): with Keep Unmatched on, the default, saves write them back, so undoing the update brings them back; off, the next save drops them. A mesh whose every instance players removed is kept silently whatever Keep Unmatched says, since PCG may destroy an output component left empty at its next generation; so is the mesh of an output component past Max Instances per Component, which TooManyInstances reports. A changed grid size, or a change between a 2D and a 3D grid, names other cells, and the old cells' changes stay in the save unused.

## What is not saved

- Output a graph spawns on the GPU (Execute on GPU), which has no instances on the CPU: the Message Log says so once per PCG component, not again at each cell of its grid (GpuInstancesNotSaved).
- Run-time generation without output components, which PCG offers as experimental.
- Run-time cells whose output is only Instanced Skinned Mesh components: their changes are not saved, and the save writes back what it holds for them.
- Output generated in the editor whose original PCG component is not loaded, as in a cooked build that keeps such partition actors loaded: it is not tracked, not even as instanced meshes of its partition actor, until its original loads, so changes made to it before then are lost, and the save writes back what it holds for it.
- Moves and recolours made while a generation runs, to a component PCG then resets; removals made then are kept.
- Output that differs at each generation, such as a graph that reads actors your game moves or a landscape changed during play: saved changes match by place, whatever stands there.

## See PCG state while you test

On the actor holding the PCG component, **Effective Settings** shows PCG Values and Regenerate PCG with where they come from, and its Takes line under Instances adds the output of the actor's PCG components, such as "Takes the output of 1 PCG component as they generate." The Rolly Save column reads PCG for an actor that saves only through Actor Defaults' PCG Values. While playing, the Gameplay Debugger's RollySave category names each PCG component's seed, how many values a save would hold and whether Rolly Save had it generate again after the last load, and each output component's changes (see [See what an actor saves while you play](https://rolly-docs.pages.dev/save/guides/debug-while-playing/)).

![DA_Foliage in the rule editor](https://rolly-docs.pages.dev/save/_files/Images/RuleEditor_Foliage.png "A Save Rule for Instanced Foliage Actors and PCG Volumes with PCG Values at All Values and Instances of Foliage and PCG Output.")

In the Save Inspector (see [Inspect, compare and edit saves](https://rolly-docs.pages.dev/save/guides/inspect-saves/)), Contents names a PCG component's records after it, such as "/Game/Maps/Forest:PCG_Forest_1 › PCG › PCG values", "… › PCG output" and, for a cell, "… › PCG cell -1, 3, 0 of grid 25,600". The values record shows its values as Properties. An output record's **PCG Output** group lists a row per mesh, such as "SM_Pine · 3 removed, 0 changed, 1 added", which opens as the Instances group does (see [Save harvested foliage and instanced meshes](https://rolly-docs.pages.dev/save/guides/harvest-and-instances/#see-saved-instances-while-you-test)). The rows are read only.

With a generated instance selected, **Frame Instance** on the record line moves the editor camera to it in the editor world: from the PCG component's actor, or for a cell from the cell's centre, where its partition actor stands. A cell generated while playing has no output there. For output outside cells the button is disabled while the actor is not loaded, is in another map or exists only while playing.
