Skip to main content

Neighbourhood Check

The Spatial Inspector. Checks if a specific tile type (Logical ID) or semantic tag exists within a certain radius of each tile.

Ports

PortTypeDescription
Input IntUsually the Logical ID map from the Output node or a middle-stream generator.
Mask Bool MaskA mask where 1.0 means the target was found nearby, and 0.0 means it was not.

Details

This node is essential for "contextual" generation. It allows nodes to know what's happening around them, rather than just knowing their own value.

Parameters

  • Match By ID: If checked, the node looks for a specific Logical ID (e.g., ID 5 for "Wall").
  • Tag Name: If "Match By ID" is unchecked, it looks for any tile that has this semantic tag (e.g., "Liquid," "Hazard," "Interactive").
  • Radius: How many tiles away to look.
  • Distance Mode:
    • Chebyshev: Square radius (includes diagonals).
    • Manhattan: Diamond radius (taxicab distance).
    • Euclidean: Circular radius.

Potential Use Cases

  • Shoreline Detection: Check for "Water" tiles within a radius of 2. If found, mark the tile as "Sand" or "Wetland."
  • Hazard Buffers: Find all "Lava" tiles and use a Neighbourhood Check with a radius of 3 to create a "Heat" mask, then use that mask to prevent delicate foliage from spawning nearby.
  • Wall Decorations: Check for "Wall" tiles. If a tile is within radius 1 of a wall, it's a good candidate for placing "Cobwebs" or "Wall Sconces."