Skip to main content

edge_exists

Function edge_exists 

Source
pub fn edge_exists(a: TreeCoord, b: TreeCoord) -> bool
Expand description

Procgen decision: does an edge exist between two neighboring lots? Returns false for non-neighbors. Both lots must actually contain a node — call node_at first.

Three sources of edges, OR’d together:

  1. Anchor edges — every non-origin populated lot has a guaranteed edge to its anchor_of neighbor. Keeps every node reachable from origin transitively even when the random rolls come up empty.
  2. Orthogonal procgen edges — random roll with probability driven by a low-frequency density-noise field. Probability ranges from ~50% in “sinuous” regions to ~95% in “dense” pockets. Adjacent boxes might NOT be connected in sinuous zones, which is the explorational variety the player wants.
  3. Diagonal procgen edges — same noise-driven probability scaled to a lower band (~8% sparse, ~28% dense), plus the hard suppression when both L-bend corner lots are occupied (the visual line would otherwise cross an unrelated box).