hex-world
    Preparing search index...

    Interface ResourcePlacementRule

    Where a resource is allowed to appear. Consumed by generateResources; the renderer ignores it, so hand-placed resources can break any of these rules.

    interface ResourcePlacementRule {
        allowedTerrains?: number[];
        minElevation?: number;
        maxElevation?: number;
        requiresRiver?: boolean;
        requiresCoast?: boolean;
        requiresLiquid?: boolean;
        minFeatureLevel?: { layer: number; level: number };
        minTemperature?: number;
        maxTemperature?: number;
        minMoisture?: number;
        maxMoisture?: number;
        frequency?: number;
        minSpacing?: number;
    }
    Index

    Properties

    allowedTerrains?: number[]

    Terrain indices this resource can sit on. Omit to allow every terrain.

    minElevation?: number

    Inclusive elevation window.

    maxElevation?: number
    requiresRiver?: boolean

    Require a river through the cell (river fish, mill sites).

    requiresCoast?: boolean

    Require a land cell touching a liquid cell (shellfish, salt, ports). Mutually sensible with requiresLiquid, which is the open-water case.

    requiresLiquid?: boolean

    Require the cell itself to be liquid (ocean fish, whales).

    minFeatureLevel?: { layer: number; level: number }

    Require a scatter layer's density level at or above level — how "forest yield" attaches itself to cells that actually have trees.

    minTemperature?: number

    Climate window, matched against the temperature/moisture fields ClimateSimulator produces (both 0–1). Terrain already encodes the biome coarsely; these narrow a resource to part of one — cotton in the warm, damp end of grassland rather than all of it.

    Ignored unless the corresponding field is handed to generateResources.

    maxTemperature?: number
    minMoisture?: number
    maxMoisture?: number
    frequency?: number

    Chance of spawning on an otherwise eligible cell, 0–1. Default 0.05.

    minSpacing?: number

    Minimum hex distance between two deposits of this resource. Default 0 (no spacing). Raise it to break up the clumps that pure per-cell chance produces — 2–3 reads as "scattered deposits" rather than "ore country".