Unreal pcg prefab variants


Unreal’s PCG allows you to populate easily vast open worlds, scatter vegetation or props, but it also can be very useful for more local behavior.
It is in this mindset that I’m working on a PCG prefab variant system. It take as input a PCG data asset, created from a level instance, which is injected into a PCG graph, with, as parameter, a list of data asset called “variants”, all wrapped in a blueprint actor.


Those variants allows you to randomly tweak the static mesh instances, swap them for another model, or change their transform ( scale, rotation or translation ), they will be applied to the meshes according to the actor tags the user set.
This allows the artists to have variation on the layout they put in place but with good control on what will change and how.


Those variants include:

  • List of static mesh to change the mesh randomly to (with an optional weight).
  • Xforms
  • Material list to override from (with an optional weight).
  • A post process pcg graph to be applied on the instances ( for instance, to snap the elements on the terrain or apply any more complex logic ).
  • A “removal” probability float to remove a given mesh from the layout.


Here is an overview of the data asset which defines the variants:


More to come:
More flexibility on the data assets.
UI widget helper to create and manage complex variant setups

GuillaumeJ