Files
nexus/wiki/concepts/PCG.md
2026-04-26 12:02:53 +08:00

39 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "PCG"
type: concept
tags: ["unreal-engine", "procedural-generation", "open-world"]
sources: ["unreal-technical-artist", "unreal-world-builder"]
last_updated: 2026-04-26
---
## Definition
Procedural Content Generation程序化内容生成UE5 框架,通过图节点控制开放世界资产分布、地形采样、密度过滤和实例化放置。输出确定性:相同输入图和参数始终产生相同结果。
## Core Pipeline
1. **Input**Landscape Surface Sampler → 密度和坡度过滤
2. **Transform Points**Jitter 位置±1.5m XY、随机旋转仅 Yaw、缩放变化0.81.3
3. **Density Filter**Poisson Disk 最小间距防止重叠、Biome 密度纹理采样
4. **Exclusion Zones**道路缓冲5m、玩家路径缓冲3m、手动放置 Actor 排除半径10m
5. **Static Mesh Spawner**:权重分配(橡树 40%、松树 35%、桦树 20%、枯树 5%),全启用 Nanite
## Parameter Interface必须文档化
- GlobalDensityMultiplier0.02.0
- MinSeparationDistance1.05.0m
- EnableRoadExclusionbool
## Performance Constraints
- 最差情况下生成时间 < 3 秒
- 流式加载不得造成帧卡顿World Partition 配合)
- PCG 密度控制PCG → Nanite密度可扩展至数千实例
## Advanced Patterns
- Gameplay Tags 查询驱动环境分布规则
- 递归 PCG图 A 的输出作为图 B 的输入
- Runtime PCG几何体破坏后重新运行图
- PCG 调试工具:编辑器视口内可视化点密度、属性值、排除区边界
## Related
- [[Nanite]] — PCG 放置资产的首选渲染模式
- [[WorldPartition]] — 与 PCG 流式加载协同
- [[Procedural-Level-Design]] — 更广义的程序化关卡设计概念