Claude
Skill
ue5-pcg-building
UE5.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
Virus-scanned
Reviewed automatically before listing.
Download
teixasalone-unrealengine5-skills-skills_ue5-pcg-building-397623a.zip · 7 KB
Install
skills CLI
npx skills add https://github.com/teixasalone/UnrealEngine5-Skills/tree/main/skills/ue5-pcg-building
Claude Code
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install teixasalone-unrealengine5-skills@llmmart
Git
git clone https://github.com/teixasalone/UnrealEngine5-Skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole teixasalone/unrealengine5-skills collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Quick Start
- Define generation target: blockout towers, modular facades, or lot-based building sets.
- Define deterministic inputs: lot splines/points, district tags, style preset, and seed.
- Define runtime mode: static bake, on-demand, or runtime scheduled generation.
- Define output mode: Static Mesh instances first, Spawn Actor only for interactive/stateful parts.
UE5.7 API Anchors
- Runtime trigger and radii live on
UPCGComponent:EPCGComponentGenerationTrigger::GenerateAtRuntimebOverrideGenerationRadii,GenerationRadii,SchedulingPolicyClass,SchedulingPolicyGenerateLocal(...),Cleanup(...)
- Runtime scheduler refresh lives on
UPCGSubsystem:RefreshRuntimeGenComponent(...)RefreshAllRuntimeGenComponents(...)CleanupLocalComponentsImmediate(...)
- Output selection anchor classes:
UPCGStaticMeshSpawnerSettingsfor high-count renderingUPCGSpawnActorSettingsfor interactive/stateful outputs
- Shape Grammar anchor classes:
UPCGSubdivisionBaseSettings::GrammarSelection- Do not rely on deprecated grammar fields (
bGrammarAsAttribute_DEPRECATED,Grammar_DEPRECATED)
Graph Stage Contract
- Every stage must explicitly declare:
- Input data type (
EPCGDataTypeor asset source) - Core node/classes (minimum two)
- Required parameters (seed, tags, ranges, radii, or style keys)
- Output data type
- Debug method (node-level checks, debug node, or log/assert path)
- Input data type (
- If a stage cannot satisfy these five items, treat the graph design as incomplete.
Workflow
1) Input
- Input data type: actor/spline/point sources.
- Core node/classes:
UPCGDataFromActorSettings,UPCGGetActorPropertySettings,UPCGCreatePointsSettings. - Required parameters: lot tag filters, district/style tags, seed source, source bounds.
- Output: normalized lot point or spline data with stable ordering.
- Debug method: run
UPCGDebugSettingsafter input stage and verify point count and bounds.
2) Filter
- Input data type: point/spline data from Input stage.
- Core node/classes:
UPCGAttributeFilteringSettings,UPCGDensityFilterSettings,UPCGFilterByTagSettings. - Required parameters: slope range, exclusion tags, min lot area/width, occupancy constraints.
- Output: only buildable lots/candidates.
- Debug method: compare candidate count before/after filter and inspect rejected tag distribution.
3) Transform
- Input data type: filtered buildable candidates.
- Core node/classes:
UPCGCopyPointsSettings,UPCGCreateSplineSettings,UPCGApplyScaleToBoundsSettings. - Required parameters: floor height, pivot convention, facade orientation basis, local axes.
- Output: footprint transforms and per-floor transforms.
- Debug method: inspect transform axes and floor index attributes on output points.
4) Grammar
- Input data type: segment/spline/point data from Transform stage.
- Core node/classes:
UPCGSubdivideSplineSettings,UPCGSubdivideSegmentSettings,UPCGSelectGrammarSettings. - Required parameters:
GrammarSelection, module size limits, style-based grammar key mapping. - Output: grammar-resolved module placements/attributes.
- Debug method: use
UPCGPrintGrammarSettingsfor grammar parse and token validation. - Rule: use
GrammarSelectiononly; avoid deprecated grammar fields.
5) Output
- Input data type: grammar-resolved placements.
- Core node/classes:
UPCGStaticMeshSpawnerSettings,UPCGSpawnActorSettings,UPCGCreateTargetActor. - Required parameters:
- Static path: mesh selector, instance packer, ISM/HISM policy.
- Actor path: actor class, spawn attributes, state/interaction requirements.
- Output: rendered buildings and optional interactive building elements.
- Debug method: split output by layer/tag and validate per-layer counts.
- Default policy: prefer Static Mesh Spawner; use Spawn Actor only when stateful behavior is required.
6) Validate
- Input data type: final spawned result and runtime generation state.
- Core node/classes:
UPCGDebugSettings,UPCGComponent,UPCGSubsystem. - Required parameters: expected cell bounds, max per-update spawn budget, nav/collision expectations.
- Output: pass/fail signals and fix actions.
- Debug method: run staged checks for overlap, navigation impact, per-cell generation time, and deterministic replay.
Constraints
- Keep the main pipeline compatible with both UE5.6 and UE5.7 unless a version-specific note is required.
- Runtime generation must explicitly set:
GenerationTrigger = GenerateAtRuntime- explicit
GenerationRadii(do not rely on implicit defaults) - explicit
SchedulingPolicyClassfor predictable scheduler behavior
- Prefer ISM/HISM style output for large counts; avoid spawning heavyweight actors for each small part.
- Keep runtime generation bounds explicit to avoid uncontrolled world-wide regeneration.
- Avoid hidden dependency on editor-only data when runtime generation is expected.
- Treat World Partition boundaries as hard constraints for runtime scopes.
Failure Handling
- Symptom: no buildings spawn.
- Locate: Input stage output count, source bounds, lot tags.
- Fix: verify source actor/spline ingestion and lot filter tags; confirm non-empty candidate set.
- Symptom: output exists in editor preview but not runtime.
- Locate:
GenerationTriggerand runtime radii/scheduling settings. - Fix: set
GenerateAtRuntime, radii override, and valid scheduling policy.
- Locate:
- Symptom: runtime update regenerates too wide an area.
- Locate: runtime radii and generation source movement.
- Fix: reduce generation/cleanup radii and tighten source bounds.
- Symptom: stale generated pieces remain after rules shrink.
- Locate: cleanup path and local component lifecycle.
- Fix: trigger cleanup with remove-components behavior and force local cleanup when needed.
- Symptom: heavy hitching during runtime generation.
- Locate: points-per-cell, actor spawn count, per-update workload.
- Fix: reduce per-cell complexity, cap actor spawns, move non-interactive parts to static mesh instances.
- Symptom: deterministic replay mismatch with same seed.
- Locate: unstable upstream point ordering or non-seeded random branch.
- Fix: normalize ordering before random selection and bind every stochastic path to explicit seed inputs.
- Symptom: facade grammar fails or produces empty modules.
- Locate: grammar parse logs and module token mapping.
- Fix: validate grammar string, module dictionary, and segment size constraints.
- Symptom: overlap and collision issues.
- Locate: filter thresholds and final placement constraints.
- Fix: add clearance/slope filters and occupancy rejection before output stage.
- Symptom: navmesh degradation around generated buildings.
- Locate: collision profile and nav-affecting flags on spawned outputs.
- Fix: split nav-affecting vs non-nav-affecting outputs and rebuild nav only where required.
- Symptom: runtime changes do not apply after parameter edits.
- Locate: scheduler refresh flow.
- Fix: request runtime scheduler refresh for the modified component or all runtime components.
Runtime Scheduler Ops
- Use component refresh when one runtime component changed style/radii/scheduling inputs.
- Use global refresh when style/global rules changed for many runtime components.
- Use immediate local cleanup when bounds shrink or partition ownership changed.
- After cleanup, trigger local regeneration only for affected runtime scope.
UE5.6 / UE5.7 Compatibility Notes
- Core runtime trigger and grammar APIs above are stable in UE5.6 and UE5.7.
- Header path difference for subsystem:
- UE5.6 commonly uses
Public/PCGSubsystem.h - UE5.7 commonly uses
Public/Subsystems/PCGSubsystem.h
- UE5.6 commonly uses
Escalation
- Escalate when architecture requires custom C++ PCG elements or engine plugin extension.
- Escalate when city-scale generation must be integrated with World Partition streaming policy.
- Escalate when generated layout must be synchronized with save/load or multiplayer authority rules.
Files (unrealengine5-skills)
-
agents
-
openai.yaml 309 B
display_name: UE5.6/UE5.7 PCG Building short_description: Build modular and rule-driven building generation pipelines with UE PCG and Shape Grammar. default_prompt: Implement this UE5.6/UE5.7 PCG building feature using deterministic graph stages, shape grammar rules, and performance-safe runtime generation.
-
-
references
-
pcg-building-graph-patterns.md 2.8 KB
# PCG Building Graph Patterns ## Pattern 1: Lot To Building Footprint - Input lot points or splines. - Filter invalid areas by slope, bounds, and exclusion tags. - Derive footprint transforms for each accepted lot. ## Pattern 2: Vertical Stack - Convert each footprint into floor-level points. - Apply floor count rules by district tag or density tier. - Offset transforms per floor height and pivot convention. ## Pattern 3: Facade Dressing - Use side/corner classification from footprint edges. - Sample facade modules by rule set and weighted randomness. - Add conditional meshes (balcony, signage, trim) via tags. ## Pattern 4: Rooftop Pass - Add rooftop modules only for top floor points. - Validate clearance before large rooftop props. - Keep rooftop spawn optional by style preset. ## Pattern 5: Output Selection - Prefer Static Mesh Spawner with ISM/HISM for high counts. - Use Spawn Actor only for interactive or stateful building parts. - Keep output split by layer for easier debug and culling. ## Minimal Runnable Template Graph (UE5.7) - Goal: build a deterministic lot-to-building graph that runs in editor and runtime. - Stage chain: - Input: `UPCGDataFromActorSettings` -> `UPCGGetActorPropertySettings` - Filter: `UPCGFilterByTagSettings` -> `UPCGAttributeFilteringSettings` - Transform: `UPCGCopyPointsSettings` -> `UPCGApplyScaleToBoundsSettings` - Grammar: `UPCGSubdivideSplineSettings` -> `UPCGSelectGrammarSettings` - Output: `UPCGStaticMeshSpawnerSettings` (default), optional `UPCGSpawnActorSettings` - Validate: `UPCGDebugSettings` - Minimal required attributes: - `LotId` (stable lot identity) - `DistrictTag` (style routing) - `Seed` (deterministic random) - `FloorCount` (vertical expansion) - `GrammarKey` (rule selection) - Determinism rules: - Normalize point ordering before any random branch. - Use explicit seed attributes for all weighted or stochastic decisions. - Keep style and grammar keys immutable inside one generation pass. ## Performance Threshold Suggestions - Treat these as starting budgets, not hard engine limits. - Runtime update budget targets: - PCG generation time per update (game thread visible cost): p95 <= 4 ms - Actor spawns per update (interactive/stateful only): <= 50 - Static mesh instance creations per update: <= 2000 - Candidate points per active cell before output: <= 10000 - Escalate optimization if any target is exceeded for more than 5 consecutive updates. - When over budget: - reduce candidate points before output stage; - move non-interactive outputs from actor spawn to static mesh instancing; - split heavy grammar branches into lower-frequency passes. ## UE5.6 / UE5.7 Note - Patterns above are valid in both versions. - Runtime scheduler include paths differ between versions; keep include usage version-aware in C++ helpers. -
project-adapter.md 569 B
# Project Adapter Use this file to map generic PCG building workflow to a concrete project. ## Fill-in Items - PCG graph assets under `/Game/...` and owning map(s) - Building module mesh sets and pivot conventions - Lot, district, or biome tags used by filters - Runtime generation trigger source (volume, player source, subsystem) - Target output mode (ISM/HISM, actor spawn, dynamic mesh) - Save/load and replication requirements for generated results ## Current Default - Keep this skill generic by default. - Add project-specific mappings here only when needed. -
runtime-generation-validation.md 2.9 KB
# Runtime Generation Validation ## Functional Checks - Verify generation source moves correctly and updates target bounds. - Verify graph regenerates only required cells or regions. - Verify seed and style settings produce reproducible output. ## Performance Checks - Measure generation spikes in PIE and standalone. - Confirm high-count outputs use instance-based rendering. - Limit per-update spawned element count to avoid frame hitches. ## World Integration Checks - Validate navigation behavior for generated collision. - Validate streaming boundaries with World Partition. - Validate interaction actors are spawned only where needed. ## Safety Checks - Ensure runtime path does not call editor-only logic. - Ensure cleanup path removes stale generated instances. - Ensure save/load or network authority rules are explicit. ## Minimal Runnable Runtime Template - Component setup: - `GenerationTrigger = GenerateAtRuntime` - `bOverrideGenerationRadii = true` - explicit `GenerationRadii` set for generate/cleanup behavior - explicit `SchedulingPolicyClass` selection - Runtime control flow: - update source bounds -> refresh runtime component scheduling -> generate affected cells only - when bounds or rules shrink -> cleanup stale local components -> regenerate affected region - API anchors for C++/tooling integration: - `UPCGComponent::GenerateLocal(...)` - `UPCGComponent::Cleanup(...)` - `UPCGSubsystem::RefreshRuntimeGenComponent(...)` - `UPCGSubsystem::RefreshAllRuntimeGenComponents(...)` - `UPCGSubsystem::CleanupLocalComponentsImmediate(...)` ## Performance Threshold Suggestions - Treat these as baseline targets for regression checks: - Runtime refresh-to-visible-output latency: p95 <= 150 ms - Runtime generation frame hitch: no single frame > 8 ms caused by PCG update - Partition/cell regeneration scope: changed cells only (no full-map re-run) - Per-update interactive actor spawns: <= 50 - Per-update static mesh instance creations: <= 2000 - If thresholds are exceeded: - reduce active generation radii; - simplify per-cell graph branch depth; - split expensive grammar/output branches into deferred passes. ## Validation Scenarios - Scenario 1: fixed-seed replay. - Action: run generation twice with same inputs/seed. - Pass: output transforms/modules match. - Scenario 2: source movement locality. - Action: move generation source by one cell. - Pass: only overlapping cells regenerate. - Scenario 3: radius shrink cleanup. - Action: reduce generation/cleanup radii. - Pass: out-of-scope generated results are removed. - Scenario 4: output strategy swap. - Action: switch a subgraph from Spawn Actor to Static Mesh Spawner. - Pass: hitch decreases and functional state remains correct for non-interactive parts. - Scenario 5: grammar swap. - Action: change `GrammarKey` or grammar string for one district. - Pass: only target district modules change; other districts remain stable. -
shape-grammar-building-pattern.md 905 B
# Shape Grammar Building Pattern ## Use Cases - Rule-driven facade variation with deterministic output. - District style switching without rebuilding full graphs. - Fast iteration on floor and facade composition rules. ## Rule Design Checklist - Define atomic modules first: base, mid, corner, top, roof. - Keep grammar symbols readable and style-scoped. - Isolate random choices behind explicit seeded selectors. - Add hard constraints for min/max height and facade continuity. ## Integration Pattern - Generate candidate points/transforms in PCG graph. - Apply shape grammar stage for module sequence decisions. - Emit final symbol-resolved meshes to output spawner. - Record style/seed metadata tags for debug and replay. ## Common Pitfalls - Mixing unit scales across module sets. - Unstable rule order causing non-deterministic variation. - Overly deep grammar chains causing heavy runtime cost.
-
-
SKILL.md 8.2 KB
--- name: ue5-pcg-building description: UE5.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 converting designer constraints into reusable PCG graphs. --- # Quick Start - Define generation target: blockout towers, modular facades, or lot-based building sets. - Define deterministic inputs: lot splines/points, district tags, style preset, and seed. - Define runtime mode: static bake, on-demand, or runtime scheduled generation. - Define output mode: Static Mesh instances first, Spawn Actor only for interactive/stateful parts. # UE5.7 API Anchors - Runtime trigger and radii live on `UPCGComponent`: - `EPCGComponentGenerationTrigger::GenerateAtRuntime` - `bOverrideGenerationRadii`, `GenerationRadii`, `SchedulingPolicyClass`, `SchedulingPolicy` - `GenerateLocal(...)`, `Cleanup(...)` - Runtime scheduler refresh lives on `UPCGSubsystem`: - `RefreshRuntimeGenComponent(...)` - `RefreshAllRuntimeGenComponents(...)` - `CleanupLocalComponentsImmediate(...)` - Output selection anchor classes: - `UPCGStaticMeshSpawnerSettings` for high-count rendering - `UPCGSpawnActorSettings` for interactive/stateful outputs - Shape Grammar anchor classes: - `UPCGSubdivisionBaseSettings::GrammarSelection` - Do not rely on deprecated grammar fields (`bGrammarAsAttribute_DEPRECATED`, `Grammar_DEPRECATED`) # Graph Stage Contract - Every stage must explicitly declare: - Input data type (`EPCGDataType` or asset source) - Core node/classes (minimum two) - Required parameters (seed, tags, ranges, radii, or style keys) - Output data type - Debug method (node-level checks, debug node, or log/assert path) - If a stage cannot satisfy these five items, treat the graph design as incomplete. # Workflow ## 1) Input - Input data type: actor/spline/point sources. - Core node/classes: `UPCGDataFromActorSettings`, `UPCGGetActorPropertySettings`, `UPCGCreatePointsSettings`. - Required parameters: lot tag filters, district/style tags, seed source, source bounds. - Output: normalized lot point or spline data with stable ordering. - Debug method: run `UPCGDebugSettings` after input stage and verify point count and bounds. ## 2) Filter - Input data type: point/spline data from Input stage. - Core node/classes: `UPCGAttributeFilteringSettings`, `UPCGDensityFilterSettings`, `UPCGFilterByTagSettings`. - Required parameters: slope range, exclusion tags, min lot area/width, occupancy constraints. - Output: only buildable lots/candidates. - Debug method: compare candidate count before/after filter and inspect rejected tag distribution. ## 3) Transform - Input data type: filtered buildable candidates. - Core node/classes: `UPCGCopyPointsSettings`, `UPCGCreateSplineSettings`, `UPCGApplyScaleToBoundsSettings`. - Required parameters: floor height, pivot convention, facade orientation basis, local axes. - Output: footprint transforms and per-floor transforms. - Debug method: inspect transform axes and floor index attributes on output points. ## 4) Grammar - Input data type: segment/spline/point data from Transform stage. - Core node/classes: `UPCGSubdivideSplineSettings`, `UPCGSubdivideSegmentSettings`, `UPCGSelectGrammarSettings`. - Required parameters: `GrammarSelection`, module size limits, style-based grammar key mapping. - Output: grammar-resolved module placements/attributes. - Debug method: use `UPCGPrintGrammarSettings` for grammar parse and token validation. - Rule: use `GrammarSelection` only; avoid deprecated grammar fields. ## 5) Output - Input data type: grammar-resolved placements. - Core node/classes: `UPCGStaticMeshSpawnerSettings`, `UPCGSpawnActorSettings`, `UPCGCreateTargetActor`. - Required parameters: - Static path: mesh selector, instance packer, ISM/HISM policy. - Actor path: actor class, spawn attributes, state/interaction requirements. - Output: rendered buildings and optional interactive building elements. - Debug method: split output by layer/tag and validate per-layer counts. - Default policy: prefer Static Mesh Spawner; use Spawn Actor only when stateful behavior is required. ## 6) Validate - Input data type: final spawned result and runtime generation state. - Core node/classes: `UPCGDebugSettings`, `UPCGComponent`, `UPCGSubsystem`. - Required parameters: expected cell bounds, max per-update spawn budget, nav/collision expectations. - Output: pass/fail signals and fix actions. - Debug method: run staged checks for overlap, navigation impact, per-cell generation time, and deterministic replay. # Constraints - Keep the main pipeline compatible with both UE5.6 and UE5.7 unless a version-specific note is required. - Runtime generation must explicitly set: - `GenerationTrigger = GenerateAtRuntime` - explicit `GenerationRadii` (do not rely on implicit defaults) - explicit `SchedulingPolicyClass` for predictable scheduler behavior - Prefer ISM/HISM style output for large counts; avoid spawning heavyweight actors for each small part. - Keep runtime generation bounds explicit to avoid uncontrolled world-wide regeneration. - Avoid hidden dependency on editor-only data when runtime generation is expected. - Treat World Partition boundaries as hard constraints for runtime scopes. # Failure Handling - Symptom: no buildings spawn. - Locate: Input stage output count, source bounds, lot tags. - Fix: verify source actor/spline ingestion and lot filter tags; confirm non-empty candidate set. - Symptom: output exists in editor preview but not runtime. - Locate: `GenerationTrigger` and runtime radii/scheduling settings. - Fix: set `GenerateAtRuntime`, radii override, and valid scheduling policy. - Symptom: runtime update regenerates too wide an area. - Locate: runtime radii and generation source movement. - Fix: reduce generation/cleanup radii and tighten source bounds. - Symptom: stale generated pieces remain after rules shrink. - Locate: cleanup path and local component lifecycle. - Fix: trigger cleanup with remove-components behavior and force local cleanup when needed. - Symptom: heavy hitching during runtime generation. - Locate: points-per-cell, actor spawn count, per-update workload. - Fix: reduce per-cell complexity, cap actor spawns, move non-interactive parts to static mesh instances. - Symptom: deterministic replay mismatch with same seed. - Locate: unstable upstream point ordering or non-seeded random branch. - Fix: normalize ordering before random selection and bind every stochastic path to explicit seed inputs. - Symptom: facade grammar fails or produces empty modules. - Locate: grammar parse logs and module token mapping. - Fix: validate grammar string, module dictionary, and segment size constraints. - Symptom: overlap and collision issues. - Locate: filter thresholds and final placement constraints. - Fix: add clearance/slope filters and occupancy rejection before output stage. - Symptom: navmesh degradation around generated buildings. - Locate: collision profile and nav-affecting flags on spawned outputs. - Fix: split nav-affecting vs non-nav-affecting outputs and rebuild nav only where required. - Symptom: runtime changes do not apply after parameter edits. - Locate: scheduler refresh flow. - Fix: request runtime scheduler refresh for the modified component or all runtime components. # Runtime Scheduler Ops - Use component refresh when one runtime component changed style/radii/scheduling inputs. - Use global refresh when style/global rules changed for many runtime components. - Use immediate local cleanup when bounds shrink or partition ownership changed. - After cleanup, trigger local regeneration only for affected runtime scope. # UE5.6 / UE5.7 Compatibility Notes - Core runtime trigger and grammar APIs above are stable in UE5.6 and UE5.7. - Header path difference for subsystem: - UE5.6 commonly uses `Public/PCGSubsystem.h` - UE5.7 commonly uses `Public/Subsystems/PCGSubsystem.h` # Escalation - Escalate when architecture requires custom C++ PCG elements or engine plugin extension. - Escalate when city-scale generation must be integrated with World Partition streaming policy. - Escalate when generated layout must be synchronized with save/load or multiplayer authority rules.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.