🎲Variant Definition

The variant definition is where the user can define what properties to randomize.


Enable: Enable / disable this variant completely from evaluation.

Debug Color: Color applied on bounds debug view in the Random assembly editor utility widget.

Direct Spawn: If True that any valid actor for this variant will be spawned during the variant evaluation itself. Otherwise all the variants with direct spawn False will be spawned at the end of all the variant evaluations. This means any actor set as direct spawned will be available as collision data for other next variants.

circle-exclamation
circle-info

The variants order evaluation is the same as the order they are saved in the variant dictionary:


Removal Probability: From 0 to 1.0, a % of change to get the target actor removed from the generated result.

Mesh Variants: A weighted list of static meshes to pick a target actor's mesh replacement from. Higher weight means higher chance to get picked.

circle-info

You can create a Variant from a selection of meshes (actors or assets) using the provided Scripted Right Click Action.

Self Pruning: A self pruning node (removing the overlapping actors) will be applied on the target actors.


XForm variant: Min / Max values for offset (translation), rotation and scale to be randomly applied on target actors.


Project On Landscape: If True, the target actor will be projected on the landscape (if there is no landscape, it will be ignored).

Project Rotation: If True the rotation from the landscape hit point will be fetched.

Project On World Static: If True, the target actor will be projected on any static actor's complex collision.

circle-info

If you need a specific projection behavior (use simple collision, filter on actor's tags, etc.) you can use the Post Variant Graph parameter to have your own custom projection / randomization graph.

Warning:

To make the projection work properly, you might need to had a xform Z offset as the points are projected from their initial positions (pivot position), it might be "under" the world static elements you're trying to project on, for example here:

No Z offset on the table variant, the projection failed as the pivot point of the table was under the world static

With a min / max Z offset set to 200.0, the projection now work properly as it made the pivot point of the table above the world static elements.


Static Mesh Spawner: A PCG static mesh spawner proxy node (also called settings), to be used only for the target actors of this variant. This can be used to achieve more complex randomization for instance on materials using the Extra Floats parameter.

Extra Floats: A list of min / max float which will be injected on the target actors as PerInstanceCustomData, to be functional, a custom Static Mesh Spawner node must be provided as well.

chevron-rightExample of use of extra float on materialhashtag

For example, to randomize the benches color, the bench Variant has an "Extra Float" random parameter called "ExtraFloat1":

And the static mesh spawner setting node has a Instance Data Packer which use this "ExtraFloat1" as attribute selector:

This random float will be used as Custom data on the instances generated:

This can be used in a material using the "PerInstanceCustomData" node, for instance here, to lerp the albedo tint between a white and a red-ish color:

Example:

/Game/PCGRandomAssembly/ExampleData/3DAssets/Materials/MSPresets/M_MS_Default_Material_VT/Functions/MF_ObjAdjustmentsRandom


Use Post Variant Graph: Enable / disable the custom post variant graph execution.

Post Variant Graph: A custom graph which will be executed after all the variant parameters (xform, removal probability, mesh variants, etc.) This is useful to have a tailored projection system, or a more complex set of randomization rules.

circle-info

A PCG Graph template is available: TPL_VariantCustomPostProcess

Last updated