create wiggly paths between any set of landmarks. It takes https://www.boristhebrave.com/2022/03/20/chiseled-paths-revisited/ and the previous post (https://www.boristhebrave.com/2018/04/28/random-paths-via-chiseling/) and merging them to allow a chiseled tree.


full code: https://github.com/hellochar/godot-sketches/tree/main/feb_24_2026-chiseledpaths and https://github.com/hellochar/godot-sketches/blob/main/_common/chiseled_paths.gd


Here's what the AI implementor described: 

2018 (original): Uses DFS articulation point detection to find cells whose removal would disconnect endpoints. Naturally handles N points — just check if a removal separates any pair.

2022 (revised, what we implemented): Uses a "witness path" optimization. Instead of checking every cell for articulation, it maintains one BFS path between start and end. Only re-runs BFS when the removed cell is on the witness. Much faster because most removals don't hit the witness.

Multi-point adaptation of the 2022 algorithm:

The witness path generalizes to a witness tree — a Steiner-tree-like structure connecting all required points. The logic stays the same:

  1. Find a witness tree spanning all required points (BFS from one point, trace paths back to each other point, union the paths)
  2. Remove a random open cell
  3. If the cell is not on the witness tree → skip connectivity check (same optimization)
  4. If the cell is on the witness tree → BFS from any required point, check all others are reachable
    • All reachable → build new witness tree
    • Some unreachable → cell is FORCED

The core optimization (only re-check on witness hits) still works. _find_path(start, end) becomes _find_witness_tree(points) — BFS from points[0], trace paths back to every other point, return their union as a CellSet. The rest of the algorithm is unchanged.

Published 11 hours ago
StatusPrototype
CategoryTool
PlatformsHTML5
Authorhellochar
Made withGodot

Leave a comment

Log in with itch.io to leave a comment.