Overview
A Randomizer allows you to place a random asset at a specific location.
These assets are chosen from a pre-defined list of possible assets, allowing you to use a single asset to spawn a variety of objects instead of searching for and placing each object individually.
This can be an easy and fast way to create variance when placing objects such as bushes, rubble, or other elements that look more natural when placed randomly.
Randomizers are often used in conjunction with Transformers and Splines.
This guide covers what randomizers are and how to use them.
How Randomizers Work
A Randomizer asset exists only within the Scenario Tree, and acts as the parent of a variable number of Probability assets.
To create a randomly-generated object, a Randomizer must be used in conjunction with a Replicator.
In the example below, a replicator has been set up to spawn either a cauldron, rope coil, or a chicken.
Creating a Randomizer
To create a randomizer, click and drag the Randomizer asset from the Object Browser into your Map File in the Scenario Tree.
Once created, the randomizer will automatically spawn two Probability assets beneath it.
To add a new Probability asset to a Randomizer, Right-Click the Randomizer and select Add.
To attach an Object to a Probability asset, drag it onto the Probability asset from the Object Browser.
The only function of a Randomizer is to randomly choose one of its Probability assets.
To make actually it spawn an object, it needs to be attached to a Replicator.
Randomizer Properties
Randomizers possess a number of unique Properties, detailed below.
Editor
- Comment: Allows you to add a comment to the randomizer. Visible to anyone working in the editor.
- Display Name: A custom name you can add to this randomizer for easy tracking/finding in the Scenario Tree.
- Locked: cannot be edited if locked.
- Visible: If checked, the randomizer be seen in editor if visible
Instancing
- Seed: This will determine which Probability to chose from.
Probabilities
Probabilities control the chance of each asset being chosen by a Randomizer.
Each Probability entity is attached to a single Object asset and controls the probability of that asset spawning at the Randomizer's location.
Two randomizer assets are automatically created whenever you create a Randomizer asset, as a minimum of two probabilities (at least two possibilities) are needed for a randomizer to function.
Probability Properties
Probability assets possess a number of unique Properties, detailed below.
Editor
- Locked: cannot be edited if locked.
- Visible: If checked, the randomizer be seen in editor if visible
Instancing
- Probability: The percentage chance of this probability will be chosen vs the others.
The probability values of all Probability assets under a single Randomizer should add up to 100%.
Adding a Randomizer to a Replicator
A Replicator asset determines the location where a randomizer can spawn one of its assets, and is needed to spawn an object using a Randomizer.
To add a Randomizer to a Replicator:
- Prepare your Randomizer with an object in each of its Probability assets.
- Create a Replicator asset by dragging it onto the map from the Object Browser. A Replica and a Template asset are automatically created beneath it.
- Click and drag your prepared Randomizer (and its Probability asserts) onto the Template asset beneath the Replicator.
- The Replicator will now generate one of the possible assets whenever it is created.
You may spawn this new Replicator any number of times onto your map.
In the example below, you can see the "+Add" function being used to spawn new versions of the randomizer to the map, with each new asset choosing a random asset from its probabilities.
Adding a Randomizer to a Spline
Another way to use a randomizer is in conjunction with a Spline, which can create a randomized set of objects along the path of the spline.
Create the probabilities that you'd like to have and drag the randomizer to an instance component of a spline.
Randomizing a Transformer
The random Transformer will allow to randomly rotate or shift an object from it's initial location.
A common use for adding Randomizers to Transformers is to cause a randomly-spawned cluster of rocks, bushes, trees, or similar objects to not all look all the same.