
Set up a project for pcg in Unreal Engine 5, create a project and a level, and install plugins for the pcg framework.
Explore Unreal Engine 5.4 preview and the latest stable release, ensuring you work with the most reliable version for procedural content generation workflows.
Open Unreal Engine and create a blank project from scratch, selecting game, blueprint, default settings, save to a folder, and keep the project name PCG.
Explore adding the third person template to an Unreal Engine 5 project, organize assets, fix up the redirector, and enable the default third person game mode to control the character.
Install the pcg framework and pcg geometry script in Unreal Engine 5, restart the editor, and create a pcg graph, noting Unreal Engine marks the plugins as beta.
Create and drag a PCG graph into the level, adjust the PCG volume and use get landscape data to prepare for generating random points on the landscape.
Generate points on the landscape surface with the surface sampler in unreal engine 5 pcg to spawn trees or objects, and adjust seed, points per square meter, looseness, and extents.
Download and import megascan black alder trees, enable nanite, and configure a static mesh spawner in the pcg graph to place Pivot Painter trees at surface sampler points.
Adjust the selection rates for multiple static mesh entries by assigning weights, creating two more tree variations, and observing how weight values influence which trees appear more often.
Transform points using the transform points node in the pcg graph to adjust scale, rotation, and offset, then debug and regenerate points on landscape to influence tree placement.
Add rocks to the game environment in this section; I will add rocks to the game environment.
Download sandstone boulder from Megascan, enable nanite, set up a surface sampler, spawn rocks with a static mesh spawner, and transform points to vary rotation and scale.
Use the self pruning node to remove overlapping points and separate rocks. Choose a pruning type—large to small, small to large, or all equal—based on point and mesh sizes.
Adjust point bounds in Unreal Engine 5 PCG using the bounds modifier to scale point sizes before self-pruning, improving alignment with the mesh and enabling debugging.
Master the difference node in pcg to remove rocks overlapping with trees, convert spatial data to point data, use binary density, and prioritize tree points before the static mesh spawner.
Explore how node order in unreal engine 5 pcg shapes rock placement and overlap removal, demonstrating how swapping the self-pruning and difference nodes changes point counts and results.
Add foliage to the game environment in Unreal Engine 5 using PCG techniques to support procedural content generation.
Create foliage with a PCG graph using saplings, adjust extents and size, disable collision for performance, and apply transform points for random rotation and scale.
Unreal Engine 5 PCG demonstrates using a difference node before the static mesh spawner to keep foliage from spawning under rocks and trees, tuning density, looseness, and binary option.
Learn to use PCG parameters to scale foliage, trees, and rocks by multiplying the scale attribute with dedicated scale multiplier parameters, overrideable per actor, with visual-only final scale.
Create a parameter to switch meshes in Unreal Engine 5 PCG by attribute, using a mesh selector by attribute named tree meshes, and apply it to the static mesh spawner.
Create a mesh information structure with mesh and weight, then use match weight attribute and selector by attribute to control the selection rates of trees, rocks, and foliage.
Explore Unreal Engine 5 PCG techniques by adjusting amount and looseness in the surface sampler node, configuring tree, rock, and foliage parameters, and wiring them through the PCG component.
Explore graph instances in PCG for Unreal Engine 5, save and switch between forest and basic landscape presets, and set tree, rock, and foliage meshes.
Add a spline to the level and remove points on the spline to shape the path.
Create a spline actor with a spline component in a blueprint named BP path spline, tag it as path spline, place it in the level, and adjust its two points.
Extract spline data from the PCG graph within the PCG volume, select the target spline by tag, and use the spline sampler to debug and visualize its points.
Project spline points onto the landscape surface in the PCG graph using the projection node, with landscape data as the target, and compare before and after via debugging.
Apply the difference node to remove tree, rock, and foliage from the spline and output the final arrangement in Unreal Engine 5 PCG.
Learn how to duplicate and manage multiple splines in Unreal Engine 5 by using debug mode, accessing spline data, and selecting multiple splines to verify data in the level.
Create points on the static mesh to extend points on the surface of the landscape in this mesh sampler section, advancing procedural content generation.
Download Quixel assets such as the oak tree log and mushrooms for your Unreal Engine 5 project. Enable Nanite on the selected static meshes through the property matrix and save.
Create a pcg graph named tree log, get actor data to locate the center position, and spawn a static mesh at that point.
Set bounds min and max with the bounce modifier, then transform points with rotation and scale, and enable absolute scale to keep point size independent of the PCG volume.
Learn to spawn objects on a mesh surface using the mesh sampler, copy points, and the static mesh spawner in Unreal Engine 5 PCG, placing mushrooms across the model.
Use normal to density to assign upward-facing points a density of one and downward-facing points at zero, then spawn mushrooms with static mesh spawner and adjust z offset for placement.
Apply random selection to Unreal Engine 5 PCG by choosing 60% of points with the select points node, adjusting the ratio to 0.6.
Apply procedural content generation with subgraphs to spawn tree logs at surface points using a surface sampler, exposing the subgraph for reuse and configuring tree log point outputs.
Apply the difference node in the basic landscape graph to remove overlapping points, including tree logs and foliage, using a spatial difference mask.
Create a closed spline in spline component to form a circle with four points and a ten metre radius. Auto-create the circle with the Spline Generation Panel and adjust points.
Create a closed spline in Unreal Engine 5 PCG, sample interior points with a spline sampler, apply density attribute noise, then project points onto the landscape surface.
Use the difference node to remove points from the spline, creating a clean landscape, then spawn foliage and other meshes from the remaining points using a shared scale.
Create a custom pcg node and select the number of points you want for procedural content generation.
Create a new PCG node in Unreal Engine 5, expose it as a custom PCG blueprint element, and define inputs, outputs, and a tunable point count.
Explore Unreal Engine 5 pcg by implementing point data flows with a pcg node, retrieving data from surface and spline samplers, and iterating over point data for debugging.
Split the current points array into selected and discarded arrays after shuffling with a seed-based random stream, using in context and max integer to ensure at least one point.
Construct point data in Unreal Engine 5 PCG by creating two outputs, initializing from existing data, and setting selected and discarded points before returning results.
Construct a data collection by aggregating selected and discarded point data, promoting it to a local variable, and returning the collection.
Explore procedural content generation in Unreal Engine 5 by testing the PCG test node, adjusting the seed to generate points with the surface sampler, and monitoring selected and discarded outputs.
Learn how to override a node title in Unreal Engine 5 PCG by appending strings, compiling, and refreshing to display the number of points, such as three or one.
Create a tree stump and place points around it to demonstrate procedural content generation techniques.
Download and add a rotten tree stump from Megascans, enable Nanite on the static mesh, and place the stump using a PCG graph with a center-point seed.
Spawn and arrange points with a create points grid around a tree stump, apply density noise, rotate points, and spawn a single tree log while filtering collisions.
Learn procedural content generation in Unreal Engine 5 by building a tree log with mushrooms, duplicating node variants, and refining subgraph workflows to create varied tree logs.
Build and integrate a forest pcg graph by generating surface points, transforming them, and spawning tree stumps via a subgraph, then expose and wire the subtree stump into the forest.
Demonstrate how a subgraph loop processes ten points at once by splitting input into ten point data, running a subtree stump per point, and merging results with a union node.
Create a blueprint actor for pcg, attach a pcg component wired to the forest graph, and add a box collision to define level bounds with no collision.
Create tree stump mesh variations in unreal engine 5 pcg by downloading stumps from megascan, enabling nanite, and wiring a mesh information array to static mesh spawner with attribute-based selection.
Learn to use the get actor property node to fetch mesh information from a blueprint variable and adjust weights to control three tree stump meshes in the PCG graph.
Import Megascans tree branch assets into an Unreal Engine 5 project, organize them under a tree branch folder in Megascans and 3D assets, and enable Nanite on static meshes.
Learn how to add tree branches around a tree stump using Unreal Engine 5 PCG, including selecting points, setting seeds, and assigning branch meshes via attributes and static mesh spawner.
Adjust per-mesh bounds min and max in Unreal Engine 5 PCG to control branch placement, updating the mesh information data type and applying bounds across all tree parts.
Adjust tree stump bounds and weights in Unreal Engine 5 PCG, configure bound min and max, and use random points to generate multiple stumps.
Download megascan assets, enable nanite for static meshes, and use the mesh sampler to copy points to tree stumps by retrieving the mesh attribute from index.
Filter points by upward normals and density, keep 70%, and spawn foliage on a tree stump with absolute scale and 0–360 rotation; spawn forward/backward mushrooms with similar transforms.
Adjusts tree variety in Unreal Engine PCG by duplicating tree stumps into new trees, configuring mesh bounds and weights, and wiring attribute-based spawner logic in the blueprint.
Explore procedural content generation in Unreal Engine 5 by configuring a graph forest to generate tree stumps, branches, and logs, while removing overlaps with difference and union operations.
Demonstrates using the difference and self-pruning nodes to remove overlapping branches and logs with the tree stump, visualize adjustments, and align outputs in Unreal Engine 5 PCG.
Learn to use a blueprint class for PCG in Unreal Engine 5 to adjust tree stump generation by setting number of points and ratios.
Use the named reroute node to label and tidy outputs, normal tree, tree stump, and tree log, and route them into differences for cleaner PCG wiring.
Create a primary data asset to store PCG forest mesh information, then access it in the PCG forest blueprint to apply tree, tree stump, and branch mesh data.
This is the English version of the course "Unreal Engine 5.4 PCG - Tạo Môi Trường Game bằng PCG".
So, what is PCG or Procedural Content Generation?
Imagine you want to add trees to a level, you have to determine the quantity, the spacing between the trees, etc. This is very time-consuming if done manually. But with PCG, you can do it quickly and accurately.
In the initial sections:
Get familiar with the PCG framework
Learn how to use the nodes in the PCG Graph
Use the Surface Sampler node to create random points
Use the Static Mesh Spawner node to create meshes from points
In the "Rock" section, you will add rocks to the level. When the level has various objects like rocks and trees, you will define how they interact with each other. For instance, if a rock and a tree overlap, you will decide whether to remove the rock or the tree.
In the "Mesh Sampler" section, instead of creating points on the landscape surface, you will learn how to create points on any static mesh. For example, I will use the Mesh Sampler node to create mushrooms on tree logs.
Besides the existing/native PCG nodes, you will learn how to create new PCG nodes to suit your needs.
From an initial point, you can create surrounding points. For example, each tree stump can have branches or tree logs around it.
You might like the "Building" section. You will learn how to create a tool for generating buildings. Since a building has many parts, I have broken the section into multiple lectures for each part. You will learn various use cases of the nodes from the previous sections. You can learn and apply a lot after completing this section.