Hytale Modding
Hytale Modding
World GenerationTechnical Hytale Generator

Material Providers

Determines which Material to use where.

Material Providers

Constant

Provides a constant Material.

Parameters:

NameDescription
Material

Transparent

The lack of any Material.

Parameters: None.


Solidity

Separates terrain into Solid and Empty blocks. Provides a Material Provider slot for each selection.

Parameters:

NameDescription
SolidWhere the terrain's Density value is greater than 0.
EmptyWhere the terrain's Density value is smaller or equal to 0.

Queue

Goes through a queue of Material Provider slots from highest to lowest priority. If a Material Provider in the queue doesn’t provide a block type, then the next one in the queue is queried. If no slot provides a block, then the Queue Material Provider will not provide a block. The query stops at the first slot that provides a block.

Parameters:

NameDescription
QueueSlots are queried from top to bottom.

SimpleHorizontal

Applies the child Material Provider to a vertical range.

If a BaseHeight is provided, the TopY and BottomY values are relative to the referenced DecimalConstant. Otherwise, they’re relative to the world’s Y coordinate.

Parameters:

NameDescription
TopYY coordinate. Defines the vertical top <strong>exclusive</strong> limit of the region.
Top BaseHeightDecimalConstant name.
BottomYY coordinate. Defines the vertical bottom <strong>inclusive</strong> limit of the region.
Bottom BaseHeightDecimalConstant name.
MaterialSlot to query for the selected region.

Striped

Applies a Material Provider slot to a set of horizontal stripes of blocks of varying thickness and position. Below is an example of basalt stripes in a stone cliff.

Parameters:

NameDescription
StripesEach stripe contains <code>TopY</code> and <code>BottomY</code>.
Stripes[].TopYWorld Y value. Inclusive.
Stripes[].BottomYWorld Y value. Inclusive.
MaterialSlot to query for the selected region.

Weighted

Picks the Material Provider slot to query from a list. Each slot has a weight that determines the likelihood of being picked.

Parameters:

NameDescription
Seed
SkipChancePercentage of blocks to skip. When skipped, this provider returns no block and does not pick a slot.
WeightedMaterials
WeightedMaterials[].WeightHigher value increases likelihood of being picked.
WeightedMaterials[].Material

FieldFunction

Selects a 3D region using a noise function and value delimiters. The delimiters link a Material Provider slot to a specific range of values in the noise function.

Parameters:

NameDescription
FieldFunctionDefines the field value for each block. Same asset type used by DAOTerrain density.
DelimitersHigher entries have higher priority.
Delimiters[].FromMinimum limit of the delimiter’s range.
Delimiters[].ToMaximum limit of the delimiter’s range.
Delimiters[].MaterialSlot linked to this delimiter.

SpaceAndDepth

Allows placing layers of blocks on a terrain’s floor or ceiling surfaces. Layers of Material are piled on top of each other inside the surface (floor or ceiling), like a cake. There are multiple Layer types, each providing a unique way to define thickness. Below is an example with two layers in the floor of our terrain.

Conditions let you skip this Material Provider when they’re not met. An example could be a Condition that only places grass if there are at least 5 empty blocks above the surface.

Parameters:

NameDescription
LayerContextContext the layers are applied on. Values: <code>DEPTH_INTO_FLOOR</code>, <code>DEPTH_INTO_CEILING</code>.
MaxExpectedDepthOptimization hint. Set to max expected combined layer depth. Too small can cut off layers. Too large can hurt performance.
ConditionProvider returns no block if the Condition fails.
LayersStacked top-to-bottom as depth increases into the context.

Condition

A Condition object checks whether the environment is valid to determine whether the Material Provider should run for the current block. If the Condition fails for a block, the Material Provider returns no block.

An example Condition could check if there are at least 5 blocks of empty space above the floor. This is useful if you want dirt in tight spaces instead of grass. An example is shown below.

The Condition’s ContextToCheck parameter selects which context value the Condition queries. In the example above, we’re checking the SPACE_ABOVE_FLOOR context, which is the number of blocks above the floor. There are currently two possible context values you can use:

  • SPACE_ABOVE_FLOOR
  • SPACE_BELOW_CEILING

There are multiple Condition types that allow you to compose more complex Conditions from simpler ones. Below are the different types.

EqualsCondition

Validates only if a context value is equal to the Condition’s configured value.

Parameters:

NameDescription
ContextToCheckWhich context value the Condition queries.
ValueCondition passes only if the context value equals this.

GreaterThanCondition

Validates only if a context value is greater than the Condition’s configured threshold.

Parameters:

NameDescription
ContextToCheckWhich context value the Condition queries.
ThresholdCondition passes only if the context value is greater than this.

SmallerThanCondition

Validates only if a context value is smaller than the Condition’s configured threshold.

Parameters:

NameDescription
ContextToCheckWhich context value the Condition queries.
ThresholdCondition passes only if the context value is smaller than this.

AndCondition

Logical AND Condition. Validates only if all child Conditions validate.

Parameters:

NameDescription
ConditionsCondition passes only if all child Conditions pass.

OrCondition

Logical OR Condition. Validates if any child Condition validates.

Parameters:

NameDescription
ConditionsCondition passes if any child Condition passes.

NotCondition

Logical NOT Condition. Validates only if its child Condition does not validate.

Parameters:

NameDescription
ConditionSingle slot (not a list). Condition passes if the child Condition fails.

AlwaysTrueCondition

This Condition type always validates.


Layer

In the SpaceAndDepth Material Provider type, Layers are stacked into the depth of the floor or ceiling. Layers have a thickness and a Material Provider.

Below are some examples that illustrate how layers work.

Example 1:

  • Layer 1: grass of thickness 1.

Example 2:

  • Layer 1: grass of thickness 1.
  • Layer 2: dirt of thickness ranging from 2 to 3.

Example 3:

  • Layer 1: mud of thickness 1 to 5 defined by a 2D simplex noise function.
  • Layer 2: dirt of thickness ranging from 2 to 3.

Example 4: This example shows how this can work not only on floors but also on ceilings by changing the LayerContext value to DEPTH_INTO_CEILING.

  • Layer 1: dirt of thickness in range 2 to 3.

End of examples.

Below are the supported Layer types.

ConstantThickness

Has the same thickness everywhere.

Parameters:

NameDescription
Material
ThicknessThickness in blocks.

RangeThickness

The thickness varies per XZ coordinate and is defined by a range of possible values.

Parameters:

NameDescription
Material
RangeMinMinimum thickness in blocks.
RangeMaxMaximum thickness in blocks (inclusive).
Seed

WeightedThickness

The thickness varies per XZ coordinate and is picked from a list of weighted thickness values.

Parameters:

NameDescription
Material
PossibleThicknessesUsed to pick a thickness per XZ.
SeedSeed used when picking the thickness.

NoiseThickness

The thickness varies per XZ coordinate and is determined by a noise function tree. The thickness value comes from the function output. In the example below, the output is normalized from 0 to 5. This makes the thickest points about 5 blocks.

Parameters:

NameDescription
Material
ThicknessFunctionXZSampled as a 2D function on the XZ plane (Y is always <code>0</code>).

Imported

Imports an exported Material Provider.

Parameters:

NameDescription
NameThe exported Material Provider.