Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Other skills

ue-procedural-generation

Use when generating world content or geometry procedurally in Unreal Engine: PCG graphs, custom PCG nodes in C++, runtime mesh building, instancing and seeded noise. Also use when the user mentions 'PCG', 'UPCGComponent', 'UPCGSettings', 'IPCGElement', 'UPCGBasePointData', 'surface sampler', 'static mesh spawner', 'runtime generation', 'CreateMeshSection', 'UProceduralMeshComponent', 'UDynamicMeshComponent', 'Geometry Script', 'AddInstance', 'HISM', 'spline mesh', 'PerlinNoise', 'FRandomStream', 'scatter foliage' or 'marching cubes'. For collision on generated geometry, see ue-physics-collision; for instance materials, see ue-materials-rendering; for background work, see ue-async-threading.

quodsoler · Static checks on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add quodsoler/unreal-engine-skills --skill ue-procedural-generation

About this skill


name: ue-procedural-generation description: "Use when generating world content or geometry procedurally in Unreal Engine: PCG graphs, custom PCG nodes in C++, runtime mesh building, instancing and seeded noise. Also use when the user mentions 'PCG', 'UPCGComponent', 'UPCGSettings', 'IPCGElement', 'UPCGBasePointData', 'surface sampler', 'static mesh spawner', 'runtime generation', 'CreateMeshSection', 'UProceduralMeshComponent', 'UDynamicMeshComponent', 'Geometry Script', 'AddInstance', 'HISM', 'spline mesh', 'PerlinNoise', 'FRandomStream', 'scatter foliage' or 'marching cubes'. For collision on generated geometry, see ue-physics-collision; for instance materials, see ue-materials-rendering; for background work, see ue-async-threading." metadata: version: "2.0.0" engine: "5.8"

UE Procedural Generation

Target engine: UE 5.8. APIs below are verified against the 5.8 headers; older forms are listed under "Deprecated — do not use".

Covers the PCG framework (plugin PCG at Engine/Plugins/PCG, enabled by default, Build.cs module PCG), runtime mesh building with UProceduralMeshComponent (plugin ProceduralMeshComponent, module ProceduralMeshComponent) and UDynamicMeshComponent + Geometry Script (modules GeometryFramework and GeometryScriptingCore), instancing with UInstancedStaticMeshComponent/UHierarchicalInstancedStaticMeshComponent, spline-driven placement, and deterministic noise/random from Core.

Context

Read .agents/ue-project-context.md if it exists (module names, conventions, enabled plugins, GAS/networking setup). Do not stop if it is missing.

Identify the area from the request and the codebase. Ask only when two plausible readings would produce different code.

Request is about…Go to
Enabling PCG, module/plugin wiringPCG setup
Driving generation from an actor, runtime generation, partitioningPCG component and runtime generation
Reading/writing points inside a graphPoint data
Writing a new PCG node in C++Custom PCG node in C++
Which node does X, pin labels, node settings fieldsPCG node reference
Building triangles at runtimeProceduralMeshComponent
Boolean ops, primitives, baking to a static meshDynamic Mesh and Geometry Script
Thousands of repeated meshesInstanced static meshes
Roads, rivers, fences, cablesSplines
Heightfields, scatter, reproducible resultsNoise and deterministic random
Marching cubes, BSP dungeons, WFC, Poisson discProcedural mesh patterns

PCG setup

// MyGame.Build.cs
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "PCG" });
{ "Name": "PCG", "Enabled": true }
ClassHeaderRole
UPCGComponentPCGComponent.hActor component that owns a graph and drives generation
UPCGGraphPCGGraph.hGraph asset: nodes, edges, UserParameters
UPCGGraphInstancePCGGraph.hGraph instance with per-instance parameter overrides
UPCGGraphInterfacePCGGraph.hCommon base of graph and graph instance
UPCGSettingsPCGSettings.hNode settings base class
IPCGElementPCGElement.hThe executable half of a node
FPCGContextPCGContext.hPer-execution state: InputData, OutputData, Node, ExecutionSource
UPCGBasePointDataData/PCGBasePointData.hAbstract point collection
UPCGPointArrayDataData/PCGPointArrayData.hStructure-of-arrays point data
UPCGSubsystemSubsystems/PCGSubsystem.hScheduling, partitioning, runtime generation
APCGVolumePCGVolume.hVolume actor carrying a UPCGComponent

PCG component and runtime generation

#include "PCGComponent.h"
#include "PCGGraph.h"

void AMyGenerator::StartGeneration(UPCGGraphInterface* Graph, int32 InSeed)
{
    UPCGComponent* PCG = FindComponentByClass<UPCGComponent>();
    if (!PCG)
    {
        return;
    }

    PCG->Seed = InSeed;
    PCG->bActivated = true;
    PCG->SetGraph(Graph);      // NetMulticast, Reliable
    PCG->Generate(/*bForce=*/true);  // NetMulticast, Reliable
}
CallReplicationUse for
Generate(bool bForce) / Cleanup(bool bRemoveComponents)NetMulticast, ReliableServer-driven generation that must appear on clients
GenerateLocal(bool bForce) / CleanupLocal(bool bRemoveComponents)noneClient-side or single-player generation
NotifyPropertiesChangedFromBlueprint()noneMark dirty and conditionally regenerate after editing exposed properties
CancelGeneration()noneAbort an in-flight generation
GetGeneratedGraphOutput()noneRead back the FPCGDataCollection the graph produced

EPCGComponentGenerationTrigger (PCGComponent.h:77): GenerateOnLoad, GenerateOnDemand, GenerateAtRuntime.

Partitioning and runtime generation:

  • SetIsPartitioned(bool) / IsPartitioned() back the bIsComponentPartitioned property; partitioned components dispatch work to local components on a grid.
  • GenerateAtRuntime hands the component to the runtime-gen scheduler. Tune it with SchedulingPolicyClass / SchedulingPolicy (UPCGSchedulingPolicyBase) and bOverrideGenerationRadii + GenerationRadii (FPCGRuntimeGenerationRadii).
  • Scheduler CVars: pcg.RuntimeGeneration.Enable, pcg.RuntimeGeneration.NumGeneratingComponents, pcg.RuntimeGeneration.GlobalRadiusMultiplier, pcg.RuntimeGeneration.EnablePooling, pcg.RuntimeGeneration.BasePoolSize, `pcg.RuntimeGeneration.FramesBeforeFirs
Read the complete source ↗