The Connect Generator window (pair puzzles)
Open it from Window ▸ Living Failure ▸ Simple Connect ▸ Connect Generator
(also under right-click Create ▸ Simple Connect). Settings on the left, a
paged preview of results on the right. Pair boards drive both the draw mode and the
pipe-rotate mode.
- Generate / Batch count — make one or many; results append to the set.
- Clear on generate — replace the set each click instead of appending.
- Presets / Reset — recommended combos, or back to defaults.
- Require unique — hunt for and keep only verified single-solution boards.
- Save Current / Save Pack — write a puzzle or the set to disk.
Verify & Re-roll saved assets
Select a saved ConnectPuzzle or ConnectPuzzlePack in the Project
window. The inspector shows a grid preview, a solution-count + difficulty badge
(One / Multiple / Unknown, 1–5 stars), and action buttons:
- Verify (single) · Verify Current / Verify All (pack) — re-run the solver and update the stored verdict. A dialog reports the result; Verify All lists any puzzles whose stored verdict changed (a discrepancy report), so re-imported or hand-edited boards are easy to audit.
- Re-roll (single) · Re-roll Current / Re-roll Unverified (pack) — regenerate a slot from its own settings (size, shape, fill, coverage, pairs) until it comes back verified, then replace it. It prefers a unique board and falls back to any verified result. Re-roll Unverified fixes every "Not verified" entry in a pack in one click.
- Undo / Redo — every verify and re-roll is undoable (buttons, or Ctrl+Z / Ctrl+Y).
Every setting (pair puzzles)
| Field | Range | Meaning |
|---|---|---|
Width / Height | 3–20 | Grid size (capped at 20 — the path search is recursive). |
Shape | Square / Hex | 4-neighbor or 6-neighbor (pointy-top, odd-r). |
Strict lines (Fill) | off / on | Off = fill the board (self-touch allowed). On = clean lines, no self-touch, gaps allowed. (In code: FillRule.CoverAll / Connect.) |
TargetCoverage | 0.4–1.0 | Fraction of the board the lines aim to fill; the rest become walls. |
PairCount | 0…cells/2 | Number of endpoint pairs. 0 = auto-pick for the grid size; also sets average line length. |
MinPairLength | 2… | Reject lines shorter than this (kills trivial adjacent pairs). |
MinSeparation | 0…W+H | Smallest allowed distance between a pair's two endpoints. 0 = auto (spreads them for traversal). |
RequireUnique | bool | Hunt for and verify a single-solution board. |
TargetDifficulty | 0–5 | Roll until a board reaches this star rating (0 = ignore, rank by quality). Needs a big enough grid. |
Seed | string | Empty = random; any string reproduces the board exactly. |
QualityAttempts | 1–50 | Unique candidates to generate and rank; the nicest is kept. |
UniquenessNodeBudget | 1k–5M | Solver node cap per uniqueness check. |
UniquenessSeconds | 0.2–20 | Wall-clock budget for the verified-generation step. |
UniqueSearchAttempts | 1–5000 | Fresh candidate boards tried when hunting for a unique one. |
GenerationSettings.Clamp() coerces every field into its valid range, so you can pass anything safely.
Fill vs Strict lines
By default the lines fill the whole board and may run beside themselves — the friendly, dense look. Turn on Strict lines and no line may touch itself: routes stay clean and some cells are left empty. Both are generated the same way and both are verified for a single solution; Strict just changes which moves are legal and how the board is checked.
Square vs Hex
Square is a 4-neighbor grid (up/down/left/right). Hex is a 6-neighbor pointy-top grid using odd-r offset coordinates. The generator, solver, and rules are all topology-aware, so the same settings and API produce correct boards for either.
The Network Generator window (rotate puzzles)
Open it from Window ▸ Living Failure ▸ Simple Connect ▸ Network Generator.
It generates one connected pipe network — straights, corners, T-junctions, crosses —
that the player rotates back together. Every board is verified: the bounded board is
what makes rotation puzzles uniquely solvable. Square grids only.
- Coverage — fraction of the grid the network uses; the rest become scattered walls/holes it weaves around. 1 = a full grid.
- Branchiness — network shape: 0 = long winding corridors, 1 = bushy with many junctions and endpoints.
- Junction bias — extra appetite for junctions on top of Branchiness: the generator keeps feeding the same cell until it becomes a T or cross. 0 = off (classic boards); 1 = as junction-dense as the math allows (junctions can never exceed about a third of the cells — every extra arm must be paid for elsewhere).
- Allow loops + Loop count — weld extra edges so the network has cycles (redundant routes). 0 = auto, about one loop per 20 cells.
- Limit dead ends + Max dead ends — cap the degree-1 tips by welding loops onto them. 0 seals the network completely: closed plumbing where every pipe connects at both ends, no terminals. Wall layouts are chosen so sealing can always finish.
- Require unique / Target difficulty / Batch / Presets — same workflow as the Connect Generator, including a junction-dense preset.
Saved NetworkPuzzle / NetworkPuzzlePack assets get the same
inspector treatment as pair puzzles: grid preview, verdict badge, Verify (single / all,
with a discrepancy report), Re-roll, and full undo.
Fountains (pinned cells)
A fountain is a cell you pin to an exact number of pipe connections — a landmark the network must feed with precisely 2, 3, or 4 pipes. Pins are satisfied during generation (the network grows around them, never patched in afterwards) and checked before a board is accepted.
- Click-to-pin — open the Fountains foldout and click
cells in the mini-grid. Each click cycles the cell's required count:
·→2→3→4→?→·. The cycle is capped by what the cell can physically take — a corner tops out at 2, an edge at 3 — so an impossible pin can't even be authored. ?pins — the cell is guaranteed to be a junction, but the generator rolls how many pipes feed it (2–4, leaning junction-heavy) fresh per board. Saved boards carry the resolved number.- Random fountains — scatter N extra pins per board, placement and counts from the seed. Pins land spread out (never side by side) and only where they can be satisfied. Stacks with clicked pins.
In previews, pinned cells show a blue frame and the facts panel reports "N pinned — all satisfied". Orange dots are something else entirely: ordinary dead-end terminals, the natural tips every network has (always exactly one connection).
Every setting (network)
| Field | Range | Meaning |
|---|---|---|
Width / Height | 2–30 (window: 3–20) | Grid size. Square only. |
Coverage | 0.4–1.0 | Fraction of the grid the network covers; the rest are walls/holes. |
Branchiness | 0–1 | 0 = corridors, 1 = bushy. Default 0.35. |
DegreeBias | 0–1 | Junction appetite on top of Branchiness. 0 = off (default), 1 = maximum junction density. |
AllowLoops | bool | Weld cycle edges (redundant routes). Off = the network is a tree. |
LoopCount | 0–99 | Loop edges to weld when AllowLoops is on. 0 = auto (~1 per 20 cells). |
MaxDeadEnds | -1 / 0–99 | -1 = off (default). 0..N = seal degree-1 tips down to at most N. 0 = fully closed plumbing. |
Fountains | list | Authored pins: new Fountain(x, y, degree), degree 1–4 or Fountain.RandomDegree (0) for a ? pin. |
RandomFountains | 0–12 | Extra random pins per board (0 = off). Adds on top of authored pins; re-rolled per attempt. |
MaxAttempts | 1–500 | Fresh boards tried when hunting for a verified, fountain-satisfied one. Default 40. |
Seed | string | Empty = random; any string reproduces the board exactly. |
NetworkGenerationSettings.Clamp() coerces every field into its
valid range, and the generator works on a private copy — your settings object is never
mutated. Statically impossible pins (out of bounds, more pipes than the cell has
neighbours, conflicting duplicates) fail in a single attempt and the board honestly
reports FountainsSatisfied() == false.
Seeds & determinism
Generation is fully deterministic per seed on the same machine (a custom SplitMix64 RNG).
Leave Seed empty for a fresh random board, or set a string to reproduce one
exactly. Share the seed string instead of the puzzle data — it's tiny and regenerates the
same board. Batches derive per-puzzle seeds from the root, so a batch reproduces too.
This holds for both engines — including random fountain placement and loop welds, which
all come from the seed.
Async & batches
For runtime generation behind a loading screen, use the async helpers so the main thread never blocks:
// background thread, reports 1..count for a progress bar
var levels = await ConnectGenerator.GenerateBatchAsync(settings, 20,
new System.Progress<int>(done => bar.value = done / 20f));
// the network engine mirrors the same five entry points
var nets = await NetworkGenerator.GenerateBatchAsync(networkSettings, 20,
new System.Progress<int>(done => bar.value = done / 20f));
Both generators are pure C# with no Unity API calls, so they are safe to run on a thread
pool; the await resumes on Unity's main thread automatically.