HytaleDocs
WorldGen

PrefabPatterns

Asset path: Server/WorldGen/PrefabPatterns/*.json

Parent

When set this asset will inherit properties from the named asset.

When inheriting from another PrefabPatternAsset most properties will simply be copied from the parent asset to this asset. In the case where both child and parent provide a field the child field will simply replace the value provided by the parent, in the case of nested structures this will apply to the fields within the structure. In some cases the field may decide to act differently, for example: by merging the parent and child fields together.

Type information: String

Tags

Tags are a general way to describe an asset that can be interpreted by other systems in a way they see fit.

For example you could tag something with a Material tag with the values Solid and Stone, And another single tag Ore.

Tags will be expanded into a single list of tags automatically. Using the above example with Material and Ore the end result would be the following list of tags: Ore, Material, Solid, Stone, Material=Solid and Material=Stone.

Type information:

(Nullable) Map of the following:

KeyType
any StringArray of String

Biomes

The inherited biome placements. An explicit array replaces all inherited memberships. Repeated parents declare separate occurrences.

Type information:

(Nullable) Array of the type:

PrefabBiomeMembership with the following properties:

KeyTypeDescription
SeedIndexInteger

The nonnegative legacy seed index. It is honored only when ConvertedPin is true.

Prefabs(Nullable) Array of the type:
WeightedPrefabValue

WeightedPrefabValue with the following properties:

KeyTypeDescription
SeedIndex(Nullable) Integer

The preserved index used to replay the legacy prefab seed. Keep converted values unique and nonnegative.

Prefab(Nullable) String defaults to:

The prefab reference or pattern resolved by this entry.

WeightNumber

The relative selection weight before resolved suppliers are divided. The default is 1.

The weighted prefab references available to this group.

MaskCacheKey(Nullable) String

The optional cache key shared by equivalent placement masks.

Environment(Nullable) String

The optional environment key assigned around placed prefabs.

Biome(Nullable) String that matches the pattern: [^\s] and is at least 1 characters long defaults to:

Reference to a WorldGenBiomeAsset asset

The required exact WorldGenBiomeAsset key for this placement.

OrderInteger

The nonnegative converter position within this parent. It is honored only when ConvertedPin is true.

ConvertedPinBoolean defaults to: false

Whether Order and SeedIndex preserve converted placement identities. The default is false.

GridGenerator

The point generator that supplies candidate prefab locations.

Type information:

(Nullable)

PointGeneratorValue with the following properties:

KeyTypeDescription
Seed(Nullable) String

The seed label for candidate-point generation. If absent, the parent seed is used.

ScaleNumber

The coordinate scale of the point grid. If absent, the grid is not scaled.

Randomizer(Nullable)
CoordinateRandomizerValue

CoordinateRandomizerValue with the following properties:

KeyTypeDescription
Generators(Nullable) Array of the type: RandomizerGeneratorValue

The ordered noise generators that displace world coordinates.

Rotate(Nullable) CoordinateRotatorValue

The optional rotation applied after coordinate displacement.

The optional noise-based displacement of candidate points.

OffsetNumber

The common coordinate offset for all axes. The default is zero.

OffsetXNumber

The X-coordinate offset, overriding Offset for the X axis.

OffsetYNumber

The Y-coordinate offset, overriding Offset for the Y axis.

OffsetZNumber

The Z-coordinate offset, overriding Offset for the Z axis.

Rotate(Nullable)
CoordinateRotatorValue

CoordinateRotatorValue with the following properties:

KeyTypeDescription
PitchNumber defaults to: 0.0

The coordinate pitch in degrees. The default is zero.

YawNumber defaults to: 0.0

The coordinate yaw in degrees. The default is zero.

OriginXNumber defaults to: 0.0

The world X coordinate of the rotation pivot. The default is zero.

OriginYNumber defaults to: 0.0

The world Y coordinate of the rotation pivot. The default is zero.

OriginZNumber defaults to: 0.0

The world Z coordinate of the rotation pivot. The default is zero.

The optional coordinate rotation applied to the point grid.

CellType(Nullable) String

The point-grid cell geometry. The default is SQUARE.

DistanceMode(Nullable) String

The point-distance formula. The default is EUCLIDEAN.

Density(Nullable) Type 0

The optional condition controlling which candidate points remain active.

DistanceRange(Nullable) Type 1

The optional random modifier added to candidate-point distances.

Skip(Nullable) Integer

The number of nearer candidate points skipped. The default is zero.

SkipMode(Nullable) String

The strategy used to skip candidate points. The default is CHECKERBOARD.

JitterNumber

The common candidate-point jitter for all axes. The default is 1.

JitterXNumber

The X-axis point jitter, overriding Jitter.

JitterYNumber

The Y-axis point jitter, overriding Jitter.

JitterZNumber

The Z-axis point jitter, overriding Jitter.

Category

The prefab category used for placement rules. Missing or unresolved categories use NONE.

Type information: (Nullable) String

HeightThreshold

The optional world-height condition for candidate locations.

Type information:

(Nullable) Either

BasicHeightThresholdValue with the following properties:

KeyTypeDescription
TypeConstant value: Basic

This field controls the type, it must be set to the constant value "Basic" to function as this type.

Positions(Nullable) Array of Integer

The ordered world Y coordinates for height interpolation. The array must match Values in length.

Values(Nullable) Array of Number

The condition values at corresponding Positions entries. The array must match Positions in length.

or

NoiseHeightThresholdValue with the following properties:

KeyTypeDescription
TypeConstant value: Noise

This field controls the type, it must be set to the constant value "Noise" to function as this type.

Noise(Nullable) Either String or NoiseAsset

Reference to a NoiseAsset asset

The noise that selects a nested height threshold.

Keys(Nullable) Array of Number

The ordered noise values mapped to Thresholds entries. The array must match Thresholds in length.

Thresholds(Nullable) Array of the type:
IndexedHeightThresholdValue

IndexedHeightThresholdValue with the following properties:

KeyTypeDescription
SeedIndex(Nullable) Integer

The preserved index used to replay the legacy height-threshold seed. Keep converted values unique and nonnegative.

Threshold(Nullable) Either BasicHeightThresholdValue or NoiseHeightThresholdValue

The height threshold selected at this noise key.

The height thresholds corresponding by index to Keys entries.

NoiseMask

The optional noise condition for candidate locations.

Type information:

(Nullable)

NoiseConditionValue with the following properties:

KeyTypeDescription
Noise(Nullable) Either String or NoiseAsset

Reference to a NoiseAsset asset

The noise evaluated by this condition.

Threshold(Nullable) Type 2

The accepted noise value or ranges.

Mask

The optional Replacement block mask key or inline asset used for prefab placement.

Type information:

(Nullable) Either String or BlockMask

Reference to a BlockMask asset

ParentBlocks

The optional Blocks mask key or inline asset that selects blocks and fluids below a candidate location.

Type information:

(Nullable) Either String or BlockMask

Reference to a BlockMask asset

Rotations

The allowed prefab rotations. If absent, all rotations are allowed.

Type information: (Nullable) Array of String

Displacement

The random vertical placement displacement in blocks. The default is zero.

Type information:

(Nullable) Any of these:

Type
Number
Array of Number
Map of the following:
Map
KeyType
any Stringanything

FitHeightmap

Whether placement follows the terrain heightmap. The default is false.

Type information: Boolean

OnWater

Whether placement anchors to water surfaces. The default is false.

Type information: Boolean

DeepSearch

Whether placement searches below the surface. It requires HeightThreshold and defaults to false.

Type information: Boolean

Submerge

Whether placement can extend below its surface anchor. The default is false.

Type information: Boolean

MaxSize

The maximum prefab size considered during placement. The default is the height-threshold maximum radius.

Type information: (Nullable) Integer

ExclusionRadius

The minimum distance from other placed prefabs, in blocks. The default is zero.

Type information: (Nullable) Integer

BaseChecks

The base-height checks applied in descending PrefabSize order.

Type information:

(Nullable) Array of the type:

BaseCheckValue with the following properties:

KeyTypeDescription
BaseScale(Nullable) Either Number defaults to: 1.0 or String that matches the pattern: ^(-?Infinity|NaN)$

The fraction of the prefab base sampled by this check, from zero through one. The default is 1.

PrefabSize(Nullable) Integer

The minimum prefab size that uses this check, in blocks. The default is 20.

HeightTolerance(Nullable) Integer

The allowed terrain-height difference across the sampled base, in blocks. The default is 2.

Notes:

Types referenced by this type

Type 0

Any of these:

Type
Number
Array of Number
Array of Array of Number

Type 1

Any of these:

Type
Number
Array of Number
Map of the following:
Map
KeyType
any Stringanything

Type 2

Any of these:

Type
Number
Array of Number
Type 0

On this page