Sluice
Plan the water’s route. See how the day unfolds.
Make water scheduling understandable as a turn-based puzzle of supply, timing and consequence.
- 3
- days from spec to play-test
- 59
- commits
- 142
- tests
- 3
- rule variants played on one map
As of 2026-09-06, from the repository and releases
How it works
Arrange the system
The player changes the allowed controls before resolving a day.
Run the day
The core advances scheduled units of water through a defined tick order.
Read the outcome
The simulator records deliveries, releases, flooding and unmet needs.
Adjust & retry
The UI animates the recorded moves and exposes the resulting state for the next decision.
The hard parts, and what I did
Plan the water. Understand the consequences.
Turn supply and timing into a puzzle that can be planned, played through and inspected one step at a time.
Know a level is fair before anyone plays it
- The problem
- In a water-routing puzzle it is easy to ship a level that cannot be won, or one that can be won by accident.
- What I did
- A pure-Swift core with a uniform-cost solver. It keeps “unreachable” (a design problem) separate from “gave up” (a budget problem), and reports the cheapest winning plan day by day.
- Result
- Every level file can be checked from the command line before it reaches the app.
Find the fun before polishing
- The problem
- A correct simulation is not the same as a good game.
- What I did
- A lab menu runs three rule sets on the same map: the baseline, a planning variant with a preview, and a real-time variant where you drag canals.
- Result
- Which version continues is decided by play-testing, not by the spec.
Playable prototypePlayable prototype with deterministic simulation and recorded playback.
Stack
Swift · SluiceCoreSwiftUI CanvasDiscrete tick simulationEvent/trace recordsJSON level codecBounded solverLocal progress store
Implementation details
A deterministic game simulation, not a real-world fluid solver.
- Your layout
- Arrange a level’s supported control points.
- Canal board
- Show the layout and the unfolding daily outcome.
- Tick simulation
- Advance the game’s explicit water and production rules.
- Event trace
- Record what happened before animating it.
- Level data
- Load and validate authored maps and constraints.
- Day playback
- Play the recorded outcome without recomputing the rules.