hex-world
    Preparing search index...

    Interface TerrainDescriptor

    Serializable description of one terrain type. Embed in map save files via MapSerializer. Does not hold Three.js objects.

    interface TerrainDescriptor {
        index: number;
        id: string;
        name: string;
        color: number;
        roadColor?: [number, number, number];
        liquidType?: string;
        isWater?: boolean;
        texture: TerrainTextureDescriptor;
        roadCost?: number;
    }
    Index

    Properties

    index: number

    uint8 value (0–255) stored in HexMap cell data. Must be unique per map.

    id: string

    Stable string key — used in save files to identify this type.

    name: string

    Display name for editors and HUDs.

    color: number

    Hex color for vertex blending and flat-color rendering.

    roadColor?: [number, number, number]

    Road color as linear RGB 0–1. If omitted, derived from color at resolve time.

    liquidType?: string

    ID of the LiquidTypeDescriptor this terrain belongs to (e.g. 'water', 'lava', 'acid'). When set, cells of this type receive liquid surface, shore foam, estuary, and river geometry for that liquid type. Also tells generators and scatter to treat this as liquid. Takes precedence over the legacy isWater flag.

    isWater?: boolean

    Legacy alias for liquidType: 'water'. Prefer liquidType for new descriptors. Ignored when liquidType is also set.

    How to build the texture atlas slice for this type.

    roadCost?: number

    Pathfinding cost multiplier for crossing this terrain on a road. Defaults to 1.0 (neutral cost). Higher values make the tile more expensive to traverse.