Modular tree using HISM

I am creating a modular tree in Unreal Engine 5.7.4. Nanite is turned on.
I have several (approx. 10) trunks, branches and branchlets which should be used randomly. I have made them in Blender and I have their splines in a .CSV file. There is one CSV file per asset (trunk, branch) with position_x, position_y, position_z, SplineIndex and PointIndex. If the branches fork there are multiple splines with a spline ID in the .CSV file.
The modular tree shall be used in PCG with distance culling for an open world landscape. I want to make use of the Performance improvements that come with HISM.
The branches are only at the excentric top of the tree trunk and I truncated the splines accordingly already , branchlets are supposed to spawn off the branches. I also want to randomize the component (trunk, branch, branchlet) scale. The target is effectively to make the tree so random that in the open world it seems like all trees are individual trees.
I have already tried to implement the modular tree in the same PCG Graph that I use for spawning the tree many times in the open world and that failed for a multitude of reasons.
I tried to use Google AI to help me come up with a Blueprint that does what I want, but I fail really early in the process. It never comes up with a working solution. I played around with Construction scripts a little bit, but Google AI was very insistent that this would lead to too many calls and would not allow performance optimization that comes with HISM.
Is anyone able to provide good references to tutorials for such a problem or provide hints on how to build such a modular tree?

I’d split this into two separate problems — trying to do both in the same world-level PCG graph is usually what breaks:

  1. Build tree variants offline, not per instance. Make a small PCG graph (or Editor Utility Blueprint) that turns your CSV into points/splines, samples points along the branch splines (Spline Sampler), applies seeded random scale/rotation (Transform Points), and spawns trunk/branch/branchlet meshes with a Static Mesh Spawner. Generate e.g. 20–50 variants and save each as a Packed Level Actor or merge each into a single Nanite static mesh.
  2. Scatter the variants in your open-world graph with a Static Mesh Spawner using weighted random entries. PCG already outputs (H)ISM components, so you get instancing and culling; set the cull distance in the spawner’s mesh descriptor.

With 30–50 variants plus random yaw/scale per instance, players won’t notice repeats, while a truly unique tree per instance means thousands of unique components and loses the HISM benefit.

For the CSV: import it as a Data Table with a row struct (X, Y, Z, SplineIndex, PointIndex) and load it into PCG with the “Load Data Table” node, then group by SplineIndex to rebuild the splines (or build Spline Components in an editor BP from the same table). Epic’s PCG Electric Dreams sample shows this nested-graph / reusable-assembly pattern well.

1 Like

Hi @ChenDong ,
thank you very much for your insights.

I had tried using a Blueprint to load all data at once, storing the splines and accessing them later. That turned out to be a dead end or (probably) I did something wrong. The splines were not visible in the level.
But I tried using the data tables directly in PCG as you suggested. This yields points that I use for generation of splines which I then sample using a random number. This allows for great variability.
I am using a subgraph to organize and debug which works fine so far. And I havn’t run into problems generating every tree based on it’s world position. Of course, you are right most likely the player wouldn’t notice the repetition with 30-50 variants, but I wanted to try it. And it keeps the amount of data small.
Later I want to use the same concept for buildings, no two houses should look the same.