$npx -y skills add teixasalone/UnrealEngine5-Skills --skill ue5-pcg-buildingUE5.6/UE5.7 PCG building generation workflow for modular buildings, blockouts, facade rules, and runtime generation. Use when requests involve Procedural Content Generation (PCG), Shape Grammar, lot-based building spawn, deterministic random seeds, density/filter pipelines, or co
| 1 | # Quick Start |
| 2 | - Define generation target: blockout towers, modular facades, or lot-based building sets. |
| 3 | - Define deterministic inputs: lot splines/points, district tags, style preset, and seed. |
| 4 | - Define runtime mode: static bake, on-demand, or runtime scheduled generation. |
| 5 | - Define output mode: Static Mesh instances first, Spawn Actor only for interactive/stateful parts. |
| 6 | |
| 7 | # UE5.7 API Anchors |
| 8 | - Runtime trigger and radii live on `UPCGComponent`: |
| 9 | - `EPCGComponentGenerationTrigger::GenerateAtRuntime` |
| 10 | - `bOverrideGenerationRadii`, `GenerationRadii`, `SchedulingPolicyClass`, `SchedulingPolicy` |
| 11 | - `GenerateLocal(...)`, `Cleanup(...)` |
| 12 | - Runtime scheduler refresh lives on `UPCGSubsystem`: |
| 13 | - `RefreshRuntimeGenComponent(...)` |
| 14 | - `RefreshAllRuntimeGenComponents(...)` |
| 15 | - `CleanupLocalComponentsImmediate(...)` |
| 16 | - Output selection anchor classes: |
| 17 | - `UPCGStaticMeshSpawnerSettings` for high-count rendering |
| 18 | - `UPCGSpawnActorSettings` for interactive/stateful outputs |
| 19 | - Shape Grammar anchor classes: |
| 20 | - `UPCGSubdivisionBaseSettings::GrammarSelection` |
| 21 | - Do not rely on deprecated grammar fields (`bGrammarAsAttribute_DEPRECATED`, `Grammar_DEPRECATED`) |
| 22 | |
| 23 | # Graph Stage Contract |
| 24 | - Every stage must explicitly declare: |
| 25 | - Input data type (`EPCGDataType` or asset source) |
| 26 | - Core node/classes (minimum two) |
| 27 | - Required parameters (seed, tags, ranges, radii, or style keys) |
| 28 | - Output data type |
| 29 | - Debug method (node-level checks, debug node, or log/assert path) |
| 30 | - If a stage cannot satisfy these five items, treat the graph design as incomplete. |
| 31 | |
| 32 | # Workflow |
| 33 | ## 1) Input |
| 34 | - Input data type: actor/spline/point sources. |
| 35 | - Core node/classes: `UPCGDataFromActorSettings`, `UPCGGetActorPropertySettings`, `UPCGCreatePointsSettings`. |
| 36 | - Required parameters: lot tag filters, district/style tags, seed source, source bounds. |
| 37 | - Output: normalized lot point or spline data with stable ordering. |
| 38 | - Debug method: run `UPCGDebugSettings` after input stage and verify point count and bounds. |
| 39 | |
| 40 | ## 2) Filter |
| 41 | - Input data type: point/spline data from Input stage. |
| 42 | - Core node/classes: `UPCGAttributeFilteringSettings`, `UPCGDensityFilterSettings`, `UPCGFilterByTagSettings`. |
| 43 | - Required parameters: slope range, exclusion tags, min lot area/width, occupancy constraints. |
| 44 | - Output: only buildable lots/candidates. |
| 45 | - Debug method: compare candidate count before/after filter and inspect rejected tag distribution. |
| 46 | |
| 47 | ## 3) Transform |
| 48 | - Input data type: filtered buildable candidates. |
| 49 | - Core node/classes: `UPCGCopyPointsSettings`, `UPCGCreateSplineSettings`, `UPCGApplyScaleToBoundsSettings`. |
| 50 | - Required parameters: floor height, pivot convention, facade orientation basis, local axes. |
| 51 | - Output: footprint transforms and per-floor transforms. |
| 52 | - Debug method: inspect transform axes and floor index attributes on output points. |
| 53 | |
| 54 | ## 4) Grammar |
| 55 | - Input data type: segment/spline/point data from Transform stage. |
| 56 | - Core node/classes: `UPCGSubdivideSplineSettings`, `UPCGSubdivideSegmentSettings`, `UPCGSelectGrammarSettings`. |
| 57 | - Required parameters: `GrammarSelection`, module size limits, style-based grammar key mapping. |
| 58 | - Output: grammar-resolved module placements/attributes. |
| 59 | - Debug method: use `UPCGPrintGrammarSettings` for grammar parse and token validation. |
| 60 | - Rule: use `GrammarSelection` only; avoid deprecated grammar fields. |
| 61 | |
| 62 | ## 5) Output |
| 63 | - Input data type: grammar-resolved placements. |
| 64 | - Core node/classes: `UPCGStaticMeshSpawnerSettings`, `UPCGSpawnActorSettings`, `UPCGCreateTargetActor`. |
| 65 | - Required parameters: |
| 66 | - Static path: mesh selector, instance packer, ISM/HISM policy. |
| 67 | - Actor path: actor class, spawn attributes, state/interaction requirements. |
| 68 | - Output: rendered buildings and optional interactive building elements. |
| 69 | - Debug method: split output by layer/tag and validate per-layer counts. |
| 70 | - Default policy: prefer Static Mesh Spawner; use Spawn Actor only when stateful behavior is required. |
| 71 | |
| 72 | ## 6) Validate |
| 73 | - Input data type: final spawned result and runtime generation state. |
| 74 | - Core node/classes: `UPCGDebugSettings`, `UPCGComponent`, `UPCGSubsystem`. |
| 75 | - Required parameters: expected cell bounds, max per-update spawn budget, nav/collision expectations. |
| 76 | - Output: pass/fail signals and fix actions. |
| 77 | - Debug method: run staged checks for overlap, navigation impact, per-cell generation time, and deterministic replay. |
| 78 | |
| 79 | # Constraints |
| 80 | - Keep the main pipeline compatible with both UE5.6 and UE5.7 unless a version-specific note is required. |
| 81 | - Runtime generation must explicitly set: |
| 82 | - `GenerationTrigger = GenerateAtRuntime` |
| 83 | - explicit `GenerationRadii` (do not rely on implicit defaults) |
| 84 | - explicit `Sched |