// TECH //

Light against the dark: how Deepwick's light works

One number is health, fuel and eyesight

Deepwick drops a living flame down a shaft in the dark. Everything you can see, you can see because of it. Everything you cannot see is out there anyway.

The unusual thing about the game is that this is not a metaphor stretched over three separate systems. There is one number, called flame, running from 0 to 100. It is your health, in that the run ends when it reaches zero. It is your fuel, in that it drains constantly. And it is your eyesight, because the size of the light is worked out directly from it.

Burn bright, die sooner

At full flame the light reaches a long way out. As the flame fades the circle shrinks with it, so the world visibly closes in on you as you weaken. You do not need a health bar to know you are in trouble. The walls tell you.

The clever cruelty is in the burn rate, which is not constant. Part of it is fixed, and the rest scales with how big the flame currently is. A flame at full strength burns down much faster than a dying one.

So being bright costs more than being dim, and the cost arrives exactly when you are enjoying the light. A big flame also melts a wider path through the wax, which means burning hard is your vision, your dig speed and your countdown all at once. Every choice in the game is really a choice about that one number.

How the darkness is actually drawn

And this is the part that surprises people. There is no lighting engine here. Deepwick is drawn on a plain 2D canvas, and the light is a trick with layers that would work equally well with paper and a rubber.

Each frame the game paints the rock near you, skipping anything further out than the flame could possibly reach. Then it takes a second, hidden canvas the size of the screen, fills it completely black, and erases a soft circle out of that black sheet at the flame's position. Then it stamps the sheet over the finished picture.

The erasing is done with something browsers call a composite operation, which is a rule for how new paint interacts with paint already there. The normal rule is "cover it up". The one used here means "wherever I paint, remove what was underneath". Painting a soft circular gradient with that rule set does not add a light. It subtracts a hole.

The hole has a hard centre and a soft edge, fading back to solid black at its rim, which is what gives the pool of light its rolled-off edge instead of a cut-out circle.

What the light does not do

To be straight about it: walls do not block the light. The hole is one circle, painted without asking what is in the way, so a rock between you and a cave does not put that cave in shadow. Proper shadow casting means working out a visibility shape every frame, and at this scale the cost buys you almost nothing.

What the game does instead is cheaper and reads almost the same. Every rock face that touches open air gets a bright edge drawn along it. How bright depends on whether that face is turned toward the flame, and how far away it is. Faces pointing at you glow. Faces pointing away stay dull. Your eye reads that as light falling on rock, and the effect holds up because you never see far enough to catch it out.

The candles in the wall alcoves are the one other thing that punches through the darkness, and they get a slightly weaker hole, so they always stay a little veiled. Embers, wax and the flame body itself glow, but they are painted before the black sheet goes down, which means they can only shine where the flame already reaches. A pickup in the dark stays dark until you get close.

Keeping it lit

The flame is spent by five things and refilled by two, and the exchange rates are the whole economy of the game:

Put two of those side by side and the design snaps into focus. A single drip costs about as much as melting dozens of cells of wax. Getting rained on is the most expensive thing that can happen to you that is not a wall, and the deeper you go the wetter it gets.

Where the darkness lives

The shaft is generated as you fall, and its character is set by a handful of bands with names like the waxfields, the dripstone and galewound. The values are not switched at the boundaries. They are blended from one band into the next, so the world hardens and narrows gradually and there is never a visible seam where one place becomes another.

Drips peak in the dripstone band. Gusts peak in galewound. The safe channel down the middle tightens the deeper you go, without ever quite pinching shut, and the rock keeps getting harder long after the last named band runs out.

All of which loops back to the light. Because you only ever see a flame-sized pool of the world, the game can build that world out of a few simple rules and repeat itself freely. You never notice, because you never see enough at once to spot the pattern. The darkness is not an effect layered on top of Deepwick. It is the reason the whole game fits in about twenty kilobytes with no art files in it at all.

When a run ends you keep an ember for every stretch of depth you made it down. Those go to the chandlery, which sells a bigger starting flame, a slower burn, better resistance to drips, and a faster melt. Four upgrades, all of them arguments with the same number.

▶ Play Deepwick