← Digest

The making of Downstairs

A torch in the footer opens a full game: 961 hand-drawn frames, 29 minutes of music cut to fit, four friends with a world each, and a lab that had to be built before any of it could be drawn.

Ruben Cress17 min read

There is a small torch in the footer of this website, next to the RAWWW.® wordmark. It flickers. Nothing says what it is for.

Click it and the page shakes. A black circle closes in on the flame until the whole site is gone. Then a card opens in the dark.

The story card: a sunset over a dark mountain, the words Oh no, and Ruben standing in a glowing doorway next to a sign that says Rescue attempts.
The first thing you see after the torch. Every pixel of it is drawn by code.

That is Downstairs. It is hidden like an easter egg and built like a game: a turn-based pixel dungeon under the footer, with four playable friends, eleven kinds of monster, four layers of dungeon, a full score, a secret shop, saved runs, a scoreboard and an ending. This is how it was made.

What went into it

  • 163 drawings in 961 frames. Every one of them is drawn in code, pixel by pixel. Together that is 1.7 million pixels.
  • Four friends, each with eighteen frames across three directions, a large portrait with its own idle loop, a sigil, a banner and a painted world behind them.
  • Eleven monsters, each with twelve frames: a front, a side and a back, at rest and in motion.
  • Ninety props for walls and floors, different on every layer of the dungeon.
  • Six painted worlds of 128 by 128 pixels, animated.
  • A floor is a picture of a million pixels, 1,216 by 832, and every one of them is worked out when you arrive: stone, joints, dirt, rugs, shadows, cracks that glow.
  • 29 minutes of music: twelve songs cut into twenty parts that each belong to their own stretch of the descent, the tunes for the screens around it, and seven minutes of ambience in nine beds.
  • 117 sound effects, cut and layered from 38 recordings.
  • 48 notes on the walls, and fifteen things Yasmin says out loud while she walks.
  • Twelve versions of the rules, each one still able to replay every run played under the ones before it.
  • Almost 22,000 lines for the page that draws and plays it, 13,000 lines of art in 37 files, 1,300 lines of rules, and fourteen test scripts that play the game without a screen.
A tall sheet with every frame in the game: the painted worlds first, then the portraits, then hundreds of small sprites.
Every frame in the game at its real size. Six worlds, four portraits, and then everything that walks, burns, hangs on a wall or lies on a floor.

The rules I set before anything was drawn

A short list of rules came first, and it never changed:

  • It plays on a phone and on a desktop, with the same care on both.
  • No cookies, no tracking, no accounts, no popup.
  • Everything in it is my own. Other games are a quality bar, never a source.
  • The copy is English, short, and has no em dashes.

Most decisions later in this story come straight from that list. The scoreboard works with three initials because there are no accounts. Saving a run gives you a six-character code because there are no cookies. The fonts are served from this site, and the page refuses to build if a link to a font service is still in it.

From one file to a game

Downstairs started as one HTML file. It went through nineteen versions that way: a hooded figure, three kinds of monster, chests, a secret shop behind a cracked wall. Good enough to play, impossible to trust.

The problem was the scoreboard. If the browser decides what your score is, anyone can send any number. I did not want accounts, so I needed another way to know a score was real.

The answer was to split the game in two.

The rules are one file with no screen, no clock and no dice of its own. Hand it a seed and a list of moves and it plays the run, the same way every time. Every roll that decides a run comes from one stream that starts at the seed.

The view is everything you see and hear. It asks the rules what happened and turns that into pixels and sound. It can never change the outcome.

That split is the most important decision in the project. A run is now just a seed, a friend and a list of steps. When you put your initials on the board, the browser sends those three things and nothing else. The server plays the whole run again and takes the score from its own replay. A run of five hundred turns replays in about twenty milliseconds.

It also made the game testable without a browser. A small bot plays seventy-two runs to the death, and every one of them has to replay to exactly the same end. A forged score has to fail. A run claimed with the wrong friend has to fail too.

Four friends, four worlds

The hooded figure did not last. The people who go down after me are four of my real friends, drawn at their real height. Each of them got a class, their own numbers in the rules, a portrait, a sigil, banners in their colour and a world of their own behind them on the pick screen.

Burcu on the pick screen: an arch-sorcerer with a crystal staff and a flame, in front of a night skyline. Patrick on the pick screen: a paladin in plate armour with a golden hammer, in a hall of copper kettles, lightning striking beside him. Yasmin on the pick screen: a druid with antlers, her cat Mochi beside her, in a forest at night. Vedat on the pick screen: a stealth warrior with red shades and a straight blade, in a neon-lit room full of screens.
Who goes down? Each friend stands in their own painted world, with their own weather: sparks for Burcu, lightning for Patrick, leaves and fireflies for Yasmin, red slashes for Vedat.

Burcu is the Arch-Sorcerer. Fire in one hand, a crystal staff in the other. She sees three tiles further than anything down there can see back, and she lights torches from two tiles away.

Patrick is the Paladin. Plate armour, a holy hammer and a cap on backwards. More health, more damage, and every staircase heals him.

Yasmin is the Druid, with antlers in her hair and her cat Mochi one tile behind her. Mochi sits when she stands still and leaps when she strikes. Yasmin heals as she walks.

Vedat is the Stealth Warrior. Red shades, a straight blade, quiet feet. Monsters only notice him once he has stood right beside them, and a sleeping one takes double.

Each of them plays differently, and the server knows who went down. A run played as Vedat cannot be claimed as Patrick.

Later they got more of themselves. Every floor hides one readable note on the wall. Some are from the interns who went down before you. Some are for the friend you are playing, and those are inside jokes that still read fine if you are not in on them:

  • "Open until 4 AM. Not a minute earlier."
  • "It is kruidnoten. Not pepernoten. Someone will correct you anyway."
  • "Mochi has heard this story before. Mochi is still listening."
  • "Vedat does not read the docs. The docs read Vedat."

The rule for those notes is written at the top of the file that holds them: short and playful, real facts only, never sappy, ninety characters at most.

The lore panel of the lab: Burcu's nine notes as paper slips, each with its number of characters underneath.
Burcu's notes as the lab shows them, each one counted against its ninety characters.

Yasmin also talks while she walks. "This floor needs a rug. And a plant. And a lamp." Burcu finds a gin and tonic, in a big jar, and for one floor nothing can hurt her. The dialog that offers it has a Yes button and a No button, and the No button runs away.

Drawn in code

Almost nothing you see in Downstairs is an image file. The friends, the monsters, the walls, the lava, the sunset behind the story card: all of it is drawn by code when the page loads, on a grid of 32 by 32 pixels per tile.

A sprite is a list of shapes in a handful of colours. A second pass then gives every sprite the same light from the top left and a coloured outline, so the whole cast looks like it was drawn by one hand. A friend has a front, a side and a back, takes one step per tile with alternating legs, and breathes when standing still: everything above the waist goes up one pixel and comes back.

Three boards in the sprite lab: Burcu's blaze, her floating hair in god mode, and her portrait, each with all of its frames underneath.
Three of more than 150 boards. A sea of fire in tiles, the hair Burcu gets when she drinks her gin, and her portrait with its twelve frames.

The lab that had to exist first

Before most of the art existed, the project grew its own tool: the sprite lab. It is not part of the game, and it is well over a thousand lines of its own.

The sprite lab: a row of twelve designers at the top, a live tour through a lit dungeon floor, and a team chat on the right.
The top of the lab. Twelve seats, a tour that flies through a real floor with every torch lit, and the chat where each saved drawing reports how many pixels it changed.

I built Downstairs together with Claude, the AI model from Anthropic, working as coding agents on my machine. The lab was made for that way of working. Along the top are the twelve seats: a lead, and a designer each for Burcu, Patrick, Yasmin, Vedat, the lynx, the walls, the floor, the lore, the monsters, the heraldry and the hall. Several of them could draw at the same time, each on their own board, and every saved change appeared pixel by pixel under the coloured cursor of whoever drew it. Anything that rendered correctly was baked into the game on its own.

Below that the lab keeps going. Opened on a normal screen the page is more than 36,000 pixels tall and holds over 1,500 small canvases:

  • A board for every drawing, with all of its frames, the sprite at game size, an idle preview that breathes and flickers, and for everything that walks a small square where it goes right, down, left and up.
  • A room tour: the real game, on any layer, with every torch lit, drifting from room to room and reloading itself after every save.
  • Skills and auras: the real game again, with buttons to charge a friend's skill and ultimate on demand, so an aura can be judged where it will be seen.
  • Dishes: what I leave behind a note, whole and bitten.
  • Score: what every floor plays, with a button per part to hear it at the level the game plays it, over that floor's ambience if you want.
  • Lore: every note on the walls, with its length counted against the ninety characters it may have.
The skills panel of the lab: the game running inside it, Patrick glowing gold with his shield and heal both ready.
The skills panel. The game itself runs inside the lab, here with Patrick's shield up and his golden aura on.
Boards for a hanging lantern, the rat and the slime, each with their frames and a small walking square.
A lantern, the rat and the slime. Twelve frames for each monster: three sides, at rest and moving.

My part was the part that cannot be measured. What it should be, who is in it, what is funny, what looks wrong, which song is too Scandinavian for a dungeon. The agents wrote, measured and tested. The thirty commits of those first five days carry both names.

Four layers of dungeon

A whole floor is drawn once into one large picture, so dirt, rugs and shadows can run across tiles. After that a frame only copies the tiles you have seen and lays the dark over it, with holes burned in by your own light and by every torch you lit. Fire turns the cold stone warm around it.

The dungeon changes as you go down, and each layer has its own stone, its own props, its own flame and its own sound.

Floor one: pale sandstone, a red rug, two wall torches around an arched doorway, a shaft of daylight on the floor. Floor five: dark brick with rows of bones in the walls, a skull with a candle on it, mushrooms, a chest. Floor eight: black polished slabs with brass corners, a blue flame on the wall, crystals, a skeleton. Floor eleven: a room of dark brick on a sea of glowing, cracked lava.
The Drafts, The Kerning Catacombs, The Legacy Halls and The Scope's Maw. The same game, four different places.

The Drafts, floors one to three, are pale sandstone with daylight falling in through cracks in the ceiling. The Kerning Catacombs, four to six, are brown stone with courses of bones laid into the walls. The Legacy Halls, seven to nine, are cold black slabs with brass at the corners, and the torches there burn blue. From floor ten it is The Scope's Maw: basalt over a sea of lava that flows, crusts over and bubbles.

Sound, cut to fit the descent

The music is licensed from Artlist, and none of it plays the way it was delivered.

A dungeon that starts with a full band has nowhere to go. So every song was cut on the quiet moments between its sections, measured per quarter second on level, bass, treble and where the hits fall. Twelve songs became twenty parts, and each part went to the floor where it belongs.

The score panel of the lab: a column per floor listing the parts it plays, each marked calm, mid, full, rise or peak, with its length and loudness.
The score, floor by floor. Calm parts at the top of the dungeon, the full band in the middle, the rise on eight and nine, and the peaks from floor ten.

Floors one to four get the sparse openings, with no drums on the first floor at all. Floors five to seven get the full band of those same songs. Eight and nine get the stretch where the heavier songs build. And the hardest part of the hardest songs waits for floor ten, where hell begins. Each part is set to its own loudness, so the rise on the way down is the point and not an accident.

The effects have their own small stories:

  • Patrick walks in plate armour. The others walk on grit, and Vedat is nearly silent.
  • Mochi purrs when Yasmin has stood still for ten seconds. The recording is a tiger, played a little faster so it sounds like a cat.
  • The story card types itself out on an old typewriter, one key every third letter, never the same key twice in a row.
  • Monsters you can see and that are near make their own sound when they move. Far away, now and then, chains drag.
  • Some sounds do not exist as recordings at all. The rope shooting up is a breath played backwards with a wing beat on top.

All of it had to stay light. A visitor who clicks a torch out of curiosity should not download a film score. The sound comes down in groups, in the order a run needs it, and the deeper floors are only fetched once you are on your way there. Today the game ships 154 sound files in 22 megabytes, and eight of those are needed before a run can start.

The way in and the way out

The entrance was built before the game was finished. Only the torch loads with the home page. The game itself is fetched when your pointer gets near it, or on a phone when the footer scrolls into view, so the dark after the click is short.

Getting out took longer to invent. From floor ten a rope hangs in every floor. Step onto it and you are hauled up, through white, into a bright room that is the opposite of everything below.

The surface: a bright room where Ruben lies in a yellow beanbag with a coffee, surrounded by a camera, a laptop, a clapper board, a robot, colour swatches, a till and a neon sign that says RAWWW.
Found him. He was fine the whole time. Every object in the room is one of the things I make, and you can click all of them.

It is a tech shop where I sit in a beanbag with a coffee. Every service I offer stands in that room as an object you can click. The ending of the game is also the way to work with me.

And there is a way back. On the floor of that last room stands a burning torch, the only thing there that belongs to the website. Click it and the way down plays backwards. It is blown out, the dark closes around it, and you are back at the footer with the torch cold in its place. Then it catches, and the page opens around it as if nothing happened.

The day it went live

Friday 20 November was the day the full game went to the live site in one push, and it is the day I learned the most.

Before that push I asked for a full review of the game's code: bugs, speed, sound. It found thirteen things. Props on a floor reshuffled when you broke the secret wall. A monster you killed could follow you down the stairs as a ghost. Holding a key against a wall filled the list of moves the server has to replay. The German sharp s slipped through the initials filter as two letters.

It also made the game lighter. The sound you wait for before a run went from 13.9 to 7.3 megabytes. The page made 2,036 small canvases for its sprites and now makes 563. Drawing a floor got about a quarter faster, with every pixel the same as before, checked by comparing them.

Then it went live, and saving was broken.

Not on my machine. On the live site, every save and every score answered with an error. I found it on my phone. The review had tested the server and reported nineteen checks out of nineteen passing.

The cause was small. The rules are one file that has to work in a browser and on a server. The development server loaded it one way, the production build wrapped it another way, and the code that looked for the rules only looked in the first place. The test had handed the rules over by hand, and so it skipped the one step that was broken.

The fix was a few lines and it was live the same afternoon, this time tested on the built server and not on the source.

After launch: a game that kept growing

In the three days after that push the rules went from version 3 to version 12.

Each friend got a skill and an ultimate, with an aura to match. Burcu throws a fireball and can set the whole floor in view on fire, as a wave that rolls out from her. Patrick raises a shield, heals to full, and glows gold while he can. Yasmin roots every monster on the floor, and covers every wall and floor in sight in moss. Vedat vanishes, and later learned Shadow Strike: he steps out of smoke beside a monster, then the next, four in one breath.

Yasmin cleans every tile she walks on, and when a whole floor is spotless her attack goes up. Patrick maps. Vedat gets a bonus for taking the stairs without anything ever noticing him. Behind some notes is a dish I left for whoever came down: a T-bone for Vedat, a kumpir for Burcu.

Finding me became worth ten thousand points, with a bonus for speed. And when you reach the surface, the game makes you a share card: a ten second video of your friend in their aura with the score counting up, encoded by your own device in a few seconds.

Changing the rules of a game whose scores are checked by replay is dangerous. A run played under version 8 has to give the same score forever. So every run remembers the version it was played under, and the server replays it by those rules. Every change came with a test that old runs still end the same way.

The last change of those days shows why it matters. Version 11 could place the rope on the only path to the stairs, on about three in a hundred of the deep floors. The rope takes you up the moment you step on it, so on those floors you could not go deeper even if you wanted to. Version 12 fixed it. Runs from version 11 still replay with the rope where it was.

In numbers

  • 163 drawings, 961 frames, 1.7 million pixels of art
  • Four friends, one cat, eleven kinds of monster and one merchant
  • Ninety props, six painted worlds, four layers of dungeon
  • A million pixels worked out for every floor you enter
  • 29 minutes of music in twenty parts, seven minutes of ambience, 117 effects
  • 48 notes on the walls
  • Twelve versions of the rules, fourteen test scripts
  • Almost 22,000 lines for the page, 13,000 lines of art, 1,300 lines of rules
  • A lab of its own, more than 36,000 pixels tall
  • Thirty commits in the first five days, nineteen versions as a single file before that
  • No cookies, no accounts, no tracking

As I write this the sign by the door counts 23 rescue attempts this season. Twelve of them found me. The deepest anyone has gone is floor 28.

What I would keep

Two things, if I built another one.

Separate the rules from the picture on day one. Everything good that came later, from the scoreboard to saved runs to tests that run in a second, came from that split.

Build the tool before the thing. The lab cost days. Without it there would be a tenth of the art, and none of it would match.

Music and effects are licensed from Artlist. Among them: "Lost Kingdom" by Jamie Wright, "Into the Forest" by Folia Soundstudio, "Peasants Courtyard" by Alon Peretz and "Super Secret Spy" by Mark Fabian and Alexander Smith.

Go downstairs

What's the project?

Project

What's your budget?

Budget

When should it be done?

Timing

Tell me about it

Details

Nothing is stored here: your answers only reach me if you send the mail yourself. Privacy

Ready to send

Your project