Part 6 of 13 in Ghostveil
A pool you can drain
Ghostveil's rune pool is water Fantasma can wade until something weighs its drain plate, and then an open pit with live runes at the bottom.
Ghostveil is a puzzle game set in a machine buried under a castle. You play Fantasma, and inside a puzzle room the only thing you do is walk: stones slide when she pushes them, plates sink under weight, and a blue fire runs from a brazier along rune channels and through stones to open the door. Water was already in the game. She wades a pool, a stone pushed into one slides across to the far side, and the fire stops at the water's edge.
On 10th October 2026 I gave the water a second state. A rune pool is a pool with rune stones lying under the water, and somewhere in the room there's a drain plate. While anything weighs the plate, every rune pool in the room drains down its grate. Take the weight off and it fills again.
That's The Drain, the smallest of three test rooms I built round the idea. The brazier's fire reaches the channel at the pool's left edge and stops there. Fantasma wades up through the full pool, steps out onto the dark channel on the far side and pushes the stone onto the drain plate. The water goes, the runes at the bottom of the basin carry the fire across to the channel she just left, and the door above it opens.
Floor first, then a pit
The first version drained a rune pool into a rune channel, which Fantasma could walk on as floor. Full, the pool let her through and stopped the fire; drained, it let her through and carried the fire. Her own route was the same either way, so holding the pool drained for good cost her nothing, and the full pool only mattered when a stone had to slide across it.
So I changed it the same day. Drained, a rune pool is an open pit. She can't step into it, a stone pushed in sinks and fills that cell for good, and the runes at the bottom carry the fire. The rules ask one question about every cell she might step on:
/// Spike pits: open until a stone fills them. Water is never a pit:
/// she wades through it. A drained rune pool is: its basin stands empty,
/// runes at the bottom, until a stone fills a cell of it for good.
bool isPitOpen(PuzzleState s, Pos p) {
if (s.filled.contains(p)) return false;
if (level.at(p) == Terrain.pit) return true;
return level.runes.contains(p) && drained(s);
}
Here is the state of the room, is a cell, is the set of cells stones have filled, is the room's ordinary pits, is the cells of its rune pools, and is true while Fantasma, a stone or a crate stands on a drain plate.
The fire's side is one line in the function that works out what carries it:
// Drained, a rune pool is a rune channel; full, it is water, which
// never carries the fire
if (drained(s)) conductive.addAll(level.runes);
A cell a stone has filled is already in that set through s.filled, so it carries the fire full or drained, and a stone slides across it no more, since it's floor now. The drain plate itself never carries the fire. It only works the water.
That leaves what happens to anything in the pool when it drains. A stone standing in the water drops in and fills its cell. Fantasma can't be standing in it: a move that would drain the pool under her is refused, the same way a step into a pit is. In The Drain the fire's way to the door runs from the brazier along the channel at the pool's left edge, through the grate cell she waded across, and on to the channel in front of the door. Full, the grate cell breaks that line. Drained, it closes it.
Three rooms that need the water both ways
A piece earns a place only if a room needs both of its states, so the test rooms were found by search rather than drawn. The tool builds small rooms round a rune pool on the fire's road and keeps a room only if every piece in it is used and it's impossible with the pool held full for good, held drained for good, with the drain plate frozen as plain floor, with the pool turned into ordinary water, or with the brazier walled up. It found three, and all three fail with their stones frozen in place or taken away as well. The Drain solves in 6 steps. In Crossflow (29 steps) she wades the pool while it's full and much later stands on the plate herself so the fire can cross it drained, with a stone filling one cell on the way. Sunken Stone (23 steps) slides a stone across the full pool and later pushes one into the drained basin, where it fills a cell that carries the fire from then on.
The solver can also count how many positions a room has and how many of them are dead ends, positions from which the room can no longer be solved without undoing. The Drain has 12 positions and no dead ends. Crossflow has 749, and 424 of them are dead ends. Sunken Stone has 3,702, with 1,489 dead ends. Against the same rooms with plain water and no drain plate, the counts are 19, 699 and 3,690, so a pool that changes state hardly grows what the solver has to search, and in the smallest room it shrinks it. Nothing new goes in the solver's key either: whether the pools are drained follows from what stands on the plate, and filled cells were already part of every state.
Filling for good was the part I wasn't sure of, since a stone that turns a basin cell into floor could be a way round the water as easily as a use of it. So I ran the three rooms again under a variant rule where a stone sunk in the basin is lost and the cell stays basin. The Drain still solves in 6, because it never fills anything. Crossflow and Sunken Stone become impossible, and their solutions walk over the filled cell or send the fire through it, so in those two the fill is part of the puzzle.
All of that is about the rules as written. Whether a player reads an empty basin as a drop is a question about pixels.
Making it read as a drop
Full, the pool has the same wavy rim as the game's other shallow water, with a whole rune stone under the water in every cell, its pixels tinted the water's blue as light as the stone beneath. I tried straight masonry basins first and went back to the wavy rim the same afternoon. The drained pool took longer. I drew nine versions side by side: darkened stones, a black pit, shade with no wall, a lit lip on the near side, the stones sunk three pixels under the far edge, and so on. Sinking the stones put them out of line with the rune channels beside the pool. Keeping every rune whole where the far wall crossed it made the wall look as if you could see through it. The one I kept puts three rows of the dungeon's brick pit wall under the far edge, going down into the dark, with the stones three greys darker on the floor below and the wall hiding the tops of the runes just behind it, as a real wall would. The fire lights the cut runes by the same colour swap as any channel.
The water going down the grate
The drain takes 1.2 seconds and the fill 1.0. A value runs from 1 (full) to 0 (drained), stepped 40 times a second, and is eased before it's used:
_fill = _drained
? max(0.0, _fill - dt / _drainTime)
: min(1.0, _fill + dt / _fillTime);
final k = _fill * _fill * (3 - 2 * _fill);
The water is a blob closing on a point near the grate. Every pixel of the pool tests itself against the blob's edge each step:
final cx = d.grate.x + _drift.x * k, cy = d.grate.y + _drift.y * k;
final dx = _x0 + i % _w + 0.5 - cx, dy = (_y0 + i ~/ _w + 0.5 - cy) * 2;
final at = atan2(dy, dx);
final radius = k * (d.reach + _drift.length * 2);
// The bulges scale with the water, at least a pixel and a half
// while it is big enough to show them, so the last of it is still
// round about the grate
final size = max(radius, min(radius * 3, 12.0));
final wob = moving
? size *
(_bulge * sin(at * _lobes + _phase + turn) +
_ripple * sin(at * _ripples + _phase2 - turn * 0.6))
: 0.0;
inside = sqrt(dx * dx + dy * dy) + wob < radius;
Here is the share of water left, is that share eased, is the blob's radius in art pixels, is the distance from the grate to the furthest pixel of the full pool, plus 3, is the offset of the point the water closes on, is how big the bulges are allowed to be, and are the pixel's distance and angle from the blob's centre (the grate moved by ), with distances north and south counted double because the floor is seen foreshortened, is the number of bulges, the number of finer ripples, and their depths, and their starting angles, how fast the edge turns, and is time in seconds.
Every drain and every fill picks its own shape, so no two look alike: three to six bulges, from two to four more than that, between 0.06 and 0.13 and between 0.02 and 0.045, turning either way at 6 to 11 radians a second as the water goes and 3 to 5 as it comes back, closing on a point that starts up to a quarter of the pool's reach off the grate and comes back to it. A drain also leaves a puddle or two behind on the rune stones that soaks away a moment later, and the grate gulps every fifth of a second while the water moves. As the edge passes, each pixel stays wet for a short while and then dries in one step, so the wet ground is a band with a clean edge following the water down.
By the end of the day the generator could place rune pools and a drain plate as well, and it holds every room with them to the same proofs: impossible with the pools held full or held drained for good, with any one pool turned into plain water, or with the fire walled up. The three test rooms sit outside the campaign on a build switch of their own, and no campaign room has a rune pool.
The tiles, rune stones and Fantasma are from SnowHex's Dungeon Gathering. The rooms, the rules and the moving water are Ghostveil's.