Skip to content

Latest commit

 

History

History
211 lines (165 loc) · 6.78 KB

File metadata and controls

211 lines (165 loc) · 6.78 KB

Biomes

Source: Decompiled from HytaleServer.jar (pre-release 2026.02.05-9ce2783f7)

Biomes are the core building blocks of Hytale's V2 world generation. Each biome defines terrain shape, block materials, prop placement, environment settings, and color tinting. Biomes are loaded from HytaleGenerator/Biomes/ and referenced by World Structures.


BiomeAsset

Class: BiomeAsset Asset Store Path: HytaleGenerator/Biomes

CODEC Fields

Field Type Required Default Description
Name string No "" Display name for the biome
Terrain TerrainAsset Yes Terrain shape definition (density function)
FloatingFunctionNodes DensityAsset[] No [] Additional density functions (floating islands, etc.)
MaterialProvider MaterialProviderAsset Yes Block material selection strategy
Props PropRuntimeAsset[] No [] Prop placement configurations per runtime stage
EnvironmentProvider EnvironmentProviderAsset No Biome environment/atmosphere selection
TintProvider TintProviderAsset No Biome color tinting

JSON Example

{
  "Name": "Forest",
  "Terrain": {
    "Type": "DAOTerrain",
    "Density": {
      "Type": "Sum",
      "Inputs": [
        {
          "Type": "SimplexNoise2D",
          "Seed": "terrain_base",
          "Frequency": 0.005,
          "Amplitude": 40.0
        },
        {
          "Type": "Constant",
          "Value": 64.0
        }
      ]
    }
  },
  "MaterialProvider": {
    "Type": "SpaceAndDepth",
    "Layers": []
  },
  "Props": {
    "trees": {
      "Runtime": 0,
      "Positions": {
        "Type": "Mesh2D",
        "Spacing": 8,
        "Jitter": 0.4
      },
      "Assignments": {
        "Type": "Weighted",
        "Entries": []
      }
    }
  },
  "EnvironmentProvider": {
    "Type": "Constant",
    "Environment": "forest"
  },
  "TintProvider": {
    "Type": "Constant",
    "Color": "#4CAF50"
  }
}

Terrain

Type: DAOTerrain

Class: DensityTerrainAsset Type String: "DAOTerrain"

The only registered terrain type. It wraps a density function that defines the terrain shape.

Field Type Required Default Description
Density DensityAsset Yes Constant(0) The terrain density function graph

The terrain density function determines the 3D shape of the terrain. At each (x, y, z) position, the density value determines whether the position is solid (above threshold) or air (below threshold).

{
  "Type": "DAOTerrain",
  "Density": {
    "Type": "Pipeline",
    "Inputs": [
      { "Type": "SimplexNoise2D", "Seed": "height", "Frequency": 0.003 },
      { "Type": "Multiplier", "Inputs": [null, { "Type": "Constant", "Value": 50.0 }] }
    ]
  }
}

Biome Interface Hierarchy

The Biome interface extends four source interfaces:

Biome
├── extends MaterialSource    → getMaterialProvider()
├── extends PropsSource       → getPropFields(), getAllPropDistributions()
├── extends EnvironmentSource → getEnvironmentProvider()
└── extends TintSource        → getTintProvider()

Key methods:

  • getBiomeName() — returns the biome display name
  • getTerrainDensity() — returns the built Density function for terrain shape

The concrete implementation is SimpleBiome, which stores all providers as final fields.


PropRuntimeAsset

Props are defined per-biome through PropRuntimeAsset entries. Each entry configures prop placement at a specific runtime stage.

Field Type Required Default Description
Runtime int Yes 0 Runtime stage index — controls execution order
Positions PositionProviderAsset Yes List() Where to attempt prop placement
Assignments AssignmentsAsset Yes Constant() What props to place (distribution)
Skip boolean No false If true, this prop entry is disabled

Runtime Stages

The Runtime field controls when props are placed during chunk generation. Lower values execute first. This allows layered prop placement — e.g., place terrain features at stage 0, then vegetation at stage 1 that depends on the terrain.

Prop Placement Flow

graph LR
    A[PropRuntimeAsset] --> B[PositionProvider]
    B --> C[Generate candidate positions]
    C --> D[Assignments]
    D --> E[Select prop + scanner + pattern]
    E --> F[Scanner scans position]
    F --> G[Pattern validates placement]
    G --> H[Prop places blocks]
Loading
  1. The PositionProvider generates candidate positions (grid, random, etc.)
  2. The Assignments select which prop, scanner, and pattern to use at each position
  3. The Scanner examines the terrain at each position
  4. The Pattern validates whether placement conditions are met
  5. The Prop places blocks into the chunk

See: Props, Position Providers, Assignments, Scanners, Patterns


Build Pipeline

// BiomeAsset.build()
public SimpleBiome build(MaterialCache materialCache, SeedBox parentSeed,
                         ReferenceBundle referenceBundle, WorkerIndexer.Id workerId)

The build process:

  1. Terrain density is built from the TerrainAsset
  2. Floating function nodes are built (additional density functions)
  3. Material provider is built with the material cache
  4. Environment provider is built
  5. Tint provider is built
  6. A SimpleBiome is created with all providers
  7. Prop fields are built and added to the biome — each PropRuntimeAsset becomes a PropField

PropField Construction

For each non-skipped PropRuntimeAsset:

  1. A PositionProvider is built from the positions asset
  2. An Assignments (prop distribution) is built from the assignments asset
  3. A PropField is created combining them with the runtime stage index
  4. The field is added to the SimpleBiome's prop field list

SimpleBiome

The runtime biome implementation stores:

Field Type Description
biomeName String Display name
terrainDensity Density Terrain shape function
materialProvider MaterialProvider<Material> Block material selector
propFields List<PropField> Prop placement configurations
environmentProvider EnvironmentProvider Atmosphere settings
tintProvider TintProvider Color tinting

Source files: BiomeAsset.java, SimpleBiome.java, Biome.java, DensityTerrainAsset.java, TerrainAsset.java, PropRuntimeAsset.java, PropField.java