landscape-and-foliage

Implements terrain, instanced foliage, and PCG procedural generation in Unreal Engine C++.

1|Updated Sep 6, 2026
One-click install
npx skills add https://github.com/ziyarduc/Baran-bk-game --skill landscape-and-foliage-ziyarduc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: landscape-and-foliage
Source: https://github.com/ziyarduc/Baran-bk-game/tree/main/.agents/skills/landscape-and-foliage
Command: npx skills add https://github.com/ziyarduc/Baran-bk-game --skill landscape-and-foliage-ziyarduc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building outdoor environments in Unreal Engine requires coordinating three distinct systems — Landscape terrain, instanced foliage (HISM), and the PCG framework — each with non-obvious dimension rules, class hierarchies, and performance pitfalls that cause silent failures like unpaintable layers or stale cluster trees. ## Core Features & Use Cases - Landscape Terrain: Create and sculpt heightmap landscapes with correct component/section math, material weight layers via ULandscapeLayerInfoObject, edit layers, splines, and Nanite rendering. - Instanced Foliage & HISM: Paint and batch-manage vegetation through UFoliageType assets and UHierarchicalInstancedStaticMeshComponent, including cluster tree rebuilds, cull distances, and World Partition cell behavior. - PCG Procedural Generation: Author and extend PCG graphs from C++ (UPCGSettings/UPCGElement subclassing), sample landscape data, and trigger runtime or partitioned generation via UPCGComponent. - Use Case: Populate a 1:1 scale city map with roadside trees by sampling landscape slope and layer weights in a PCG graph, then batch-spawning HISM instances with a single BuildTreeIfOutdated call. ## Quick Start Ask the assistant to create a Nanite-enabled landscape with painted grass layers and procedurally scattered trees using a PCG graph in Unreal Engine 5.

Frequently Asked Questions about landscape-and-foliage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a landscape with correct dimensions in Unreal Engine?▼

Landscape dimensions must follow the formula (NumComponents × ComponentSizeQuads) + 1 heightmap vertices per axis, with section sizes as power-of-two quads minus one (63 or 127). A common valid setup is 32×32 components with 4 sections of 63 quads, producing a 4033×4033 vertex heightmap.

How do I add foliage instances from C++ in Unreal Engine?▼

Create a UHierarchicalInstancedStaticMeshComponent, set its static mesh, register it, then call AddInstances with a batch of FTransforms. After bulk edits, call BuildTreeIfOutdated(false, true) to force a synchronous BVH cluster tree rebuild.

Why can't I paint a landscape layer in Unreal Engine?▼

Painting fails when the layer lacks an assigned ULandscapeLayerInfoObject asset. Each LandscapeLayerBlend node layer in the material needs a matching layer info asset assigned in the Target Layers panel, otherwise the layer appears in the UI but receives zero weight.

What is the difference between UFoliageType_InstancedStaticMesh and UFoliageType_Actor?▼

UFoliageType_InstancedStaticMesh batches all instances into HISM components with one draw call per cluster, while UFoliageType_Actor spawns a full actor per instance. Actor foliage is a performance cliff at high density and should only be used when per-instance Blueprint logic is required.

Can PCG generate content at runtime in Unreal Engine?▼

Yes, set UPCGComponent's GenerationTrigger to GenerateAtRuntime and enable bIsComponentPartitioned so the UPCGSubsystem scheduler generates content per World Partition cell as the player moves. Avoid calling Generate() synchronously on large volumes, as it can hitch the game thread.

Does Nanite work with landscapes and foliage in UE5?▼

Yes, set bEnableNanite on the ALandscapeProxy to render terrain as a Nanite mesh, and Nanite-enabled foliage meshes ignore cull distances since Nanite manages LOD internally. Note that PerLODOverrideMaterials do not apply to the Nanite landscape mesh.