Procedural Placement Tool
Procedural Placement Tool
Advanced rule-based scatter system for foliage, props, and buildings in Unreal Engine 5.7.
The Procedural Placement Tool automates the placement of static mesh instances and Blueprint actors across terrain using configurable rules for density, slope filtering, height ranges, biome zones, exclusion volumes, landscape layer sampling, clustering, and spacing constraints. It uses Hierarchical Instanced Static Mesh Components (HISM) for efficient rendering of hundreds of thousands of instances.
Version: 2.0.0 | Engine: UE 5.7 | Author: StraySpark
Core Features
- Multi-layer scatter -- Configure independent placement layers, each with its own mesh set, density, and filter rules
- Density modes -- Uniform, Perlin noise modulation, radial falloff, or texture mask sampling
- Surface filtering -- Filter by slope angle range and world height range
- Weighted mesh selection -- Assign probability weights to multiple meshes per layer
- Surface alignment -- Align instances to world up, surface normal, or random rotation
- Minimum spacing -- O(1) spatial hash grid enforces distance between placed instances
- Deterministic generation -- Seed-based random stream for reproducible results
- Reusable rule assets -- Save placement configurations as UDataAsset for sharing across actors
- Per-layer seed override -- Independent randomization per layer
V2.0 Features
- Exclusion zone volumes -- Box volumes that prevent placement, with optional soft falloff edges
- Spline scatter -- Scatter along spline paths for roads, rivers, fences, and trails
- Blueprint actor spawning -- Spawn full Blueprint actors (not just meshes) with proper cleanup
- Texture density masks -- Use grayscale textures to modulate density with contrast control
- Landscape layer sampling -- Filter placement based on landscape paint layer weights
- Cluster/grouping system -- Generate natural-looking clumps with configurable count, radius, and spacing
- Object-aware collision -- Sphere overlap test prevents placement where existing actors are present
- Non-uniform scale -- Independent per-axis scale ranges (X, Y, Z)
- Debug visualization -- 6 modes: None, PointCloud, DensityHeatmap, SlopeOverlay, RejectedPoints, AllPoints
- Undo/redo support -- FScopedTransaction wraps all editor operations
- Generation statistics -- Per-layer breakdown of placed/filtered instances with timing data
- Progress feedback -- FScopedSlowTask progress bar with cancellation support
- 10 themed presets -- Dense Forest, Desert, Snowy Forest, Urban Park, Swamp, Roadside, River Bank, Cliff Face, Tropical Beach, Mixed Biome Transition
Plugin Structure
Plugins/ProceduralPlacement/
ProceduralPlacement.uplugin
Source/
ProceduralPlacementRuntime/ Core placement logic (12 source files)
Public/
ProceduralPlacementTypes.h Enums, structs, delegates
ProceduralPlacementRule.h Reusable rule data asset
ProceduralScatterActor.h Main box-based scatter actor
SplineScatterActor.h Spline-based scatter actor
BiomeZoneVolume.h Biome zone definition volume
ExclusionZoneVolume.h Exclusion zone volume
PlacementQuerySubsystem.h World subsystem for queries
PlacementPresets.h 10 themed preset factories
SpatialHashGrid.h O(1) proximity utility (header-only)
ProceduralPlacementRuntimeModule.h
Private/
(matching .cpp files)
ProceduralPlacementEditor/ Detail panel customization (4 source files)
Public/
ProceduralScatterDetailCustomization.h
ProceduralPlacementEditorModule.h
Private/
(matching .cpp files)
Runtime Classes
| Class | Type | Purpose |
|---|---|---|
AProceduralScatterActor | Actor | Main scatter actor -- box bounds, layers, HISM + actor spawning, debug viz |
ASplineScatterActor | Actor | Spline-based scatter -- scatter along/around spline paths |
UProceduralPlacementRule | DataAsset | Reusable rule set containing an array of placement layers |
ABiomeZoneVolume | Actor | Box volume defining a biome region with type, priority, and blend radius |
AExclusionZoneVolume | Actor | Box volume preventing placement with optional falloff edge |
UPlacementQuerySubsystem | WorldSubsystem | Surface traces, biome detection, exclusion checks, landscape layers, collision |
UPlacementPresets | FunctionLibrary | 10 preset factory functions for common placement scenarios |
FSpatialHashGrid | Utility | Header-only O(1) spatial hash grid for min-spacing enforcement |
Key Types
| Type | Description |
|---|---|
FPlacementLayer | Full layer config: meshes/actors, density, filters, spacing, scale, alignment, biome, clustering, seed |
FWeightedMeshEntry | Mesh soft reference with probability weight |
FSurfaceQueryResult | Hit location, surface normal, slope degrees, biome type |
FScatterResult | Generation stats: placed, filtered, time, per-layer breakdown |
FLayerScatterStats | Per-layer filter breakdown (surface, slope, height, biome, spacing, exclusion, collision, landscape) |
EBiomeType | Default, Forest, Desert, Grassland, Mountain, Swamp, Snow, Urban, Custom |
EDensityMode | Uniform, PerlinNoise, RadialFalloff, TextureMask |
ESurfaceAlignMode | AlignToWorldUp, AlignToSurfaceNormal, RandomRotation |
EPlacementObjectType | StaticMesh (HISM), BlueprintActor (SpawnActor) |
EDebugVisMode | None, PointCloud, DensityHeatmap, SlopeOverlay, RejectedPoints, AllPoints |
Generation Pipeline
The scatter algorithm follows this sequence for each generation pass:
- Collect active layers from the rule asset or inline configuration
- Initialize spatial hash grid and refresh biome/exclusion caches
- For each layer:
- Generate sample points within bounds (box or spline band) using density mode
- For clustered layers, generate cluster centers first, then scatter within each cluster
- For each sample point: raycast downward to find the surface, filter by slope angle range, filter by world height range, check biome zone compatibility, check exclusion zone volumes, check landscape layer weight threshold, check actor collision (sphere overlap), enforce minimum spacing via spatial hash, calculate transform (position + height offset, rotation with alignment, scale), spawn mesh instance (HISM) or Blueprint actor
- Record per-layer statistics
- Broadcast
OnScatterCompletedelegate with results
Editor Features
Custom details panel on AProceduralScatterActor with:
- Generate button -- Run the scatter algorithm (with undo support)
- Clear button -- Remove all generated instances (with undo support)
- Randomize Seed button -- Set a new random seed and regenerate
- Generation Statistics -- Total placed/filtered, generation time, per-layer breakdown with filter reasons
Requirements
- Unreal Engine 5.7
- DX12 / SM6
- Windows (Win64)
Dependencies
- Runtime: Core, CoreUObject, Engine, Foliage, Landscape, RenderCore
- Editor: UnrealEd, PropertyEditor, InputCore, LevelEditor, LandscapeEditor
- No third-party dependencies
Next Steps
- Getting Started -- Installation and first scatter tutorial
- Configuration -- All placement layer settings
- Density Modes -- Uniform, Perlin, Radial, Texture
- Biome Zones -- Regional vegetation control
- Spline Scatter -- Scatter along paths
- Exclusion Zones -- Prevent placement in areas
- Presets -- 10 built-in placement presets
- Examples -- Practical recipes and patterns
- API Reference -- Complete API documentation
- Changelog -- Version history