
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.
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.
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.
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.
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.
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 new PCG node in Unreal Engine 5, expose it as a custom PCG blueprint element, and define inputs, outputs, and a tunable point count.
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.
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.
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.
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.
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.
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.