All guides
#games#stacker#real-time#nostr#kind-2390

Stacker: real-time falling blocks over Nostr

Six players, one shared piece order, and every line you clear buries somebody else. Stacker runs its board locally at sixty frames a second and publishes only the consequences: attacks, top-outs, and checkpoints anyone can replay.

4 min read
Two Stacker wells trading garbage linesTwo ten-column wells of falling coloured blocks side by side. A completed line in the left well sends grey garbage rows into the right one: the only thing that crosses the Nostr relay in a real-time Obelisk Stacker match.Clear a line……and somebody else digsop: attack lines 3 · hole 6 Every board runs locally at sixty frames a second; only the consequences are published.

The game

Blocks fall. You fit them into rows. A completed row clears, and instead of scoring you points, it drops garbage lines into an opponent's well, with a single hole punched through them for them to dig out. Last player standing wins. One to six players; the solo table is a perfectly good way to practise.

A Stacker playfield in Obelisk: a ten-column well part-filled with coloured tetromino blocks and the ghost outline of the falling piece near the top.
A well mid-match, with the ghost of the falling piece showing where it lands.

Everyone in the match starts from the same seed, so everyone gets the same pieces in the same order. A match is a race, not a lottery. The seed comes from the table options, or from the table id itself: a hash, so it is unpredictable before the table exists and identical for everybody after.

Why it can't work the way the other games do

Chain Reaction and Vesta are turn-based: one player moves, everybody replays the move, the board advances. Stacker has no seat "to move" (six boards are running at once), and a relay round-trip per keypress would feel like playing through treacle.

So it splits in half:

Where it runs
Board, gravity, input, the 60 Hz loopYour machine, locally
Attacks, top-outs, checkpointsThe relay, as kind 2390 events

Your well never leaves your computer. What leaves is what happened because of it.

A live three-player Stacker match in Obelisk: the player’s own well with grey garbage lines at the bottom, hold and next-piece rails, and two opponents shown as miniature boards with their attack and line counts.
A three-way match. Your well at full speed; opponents as miniature boards updated from their checkpoints, with attack and line counts.

Opponents are drawn coarsely on purpose. Their real boards are running on their own machines and only reach you every few seconds, so painting a detailed board would be painting a lie. What you get instead is the thing that stays true between updates: how buried they are.

The three events

opcontentmeaning
attack{seat, target, lines, hole, nonce}garbage from one seat to another
topout{seat}that player is out
checkpoint{seat, frame, attacksSent, linesCleared, stackHeight, inputs, board}progress, plus the input log that produced it

Attacks are coalesced before they go out: three quick clears become one event with the lines summed. Signing an event takes milliseconds with a local key and considerably longer with a browser extension, so nothing is ever signed between two frames: outbound traffic leaves on its own timer, about four times a second.

How it stays honest

The engine is a pure function of (seed, inputs). That is what makes the checkpoint interesting: it carries the sender's compressed input log, so anybody can replay it against the shared seed, rebuild their board, and check whether the attacks they claimed to send actually happened. A seat whose claims its own log does not support gets marked in the UI.

Incoming garbage is fed through the same input log as everything else, so a replay reproduces the board that actually happened, garbage included.

Feel

The numbers that decide whether a game like this plays well:

  • DAS 10 frames, ARR 2: how long a held key waits before repeating, and how fast it repeats after.
  • Gravity from 48 frames per step down to 4, on the classic curve: gentle at the start, sharply faster through the teens, then a hard floor so it stays humanly playable. Ten lines is a level.
  • Lock delay 30 frames with 15 slide resets: the moment after a piece lands where you can still slide it.
  • The board draws straight to a canvas from the game loop. React never sees a frame; it only re-renders for the numbers a human reads, about eight times a second.

Controls are rebindable from the table (⌨ controls), and the binding is stored per browser: it is a device preference, not account state, so it never goes near the relay.

Sound

Effects are synthesized at runtime: line clears pitched by how many lines went, a distinct chime for spins, a rumble for garbage, a falling tone for a top-out. No audio files, and they fire straight off engine events.

The music is the royalty-free set from TETRA by soyezequiel, a La Crypta hackathon project, credited in the game UI with a link back. It shuffles once per session and advances on its own; there is no picker. If a track cannot load, or the browser refuses to autoplay it, a generative synth bed plays instead, so the game is never silent because of a missing file.

Playing it

/play in a channel, pick Stacker, set a seed if you want a specific board order, and start. Because every player runs their own board, an account holds exactly one seat: hot-seat is meaningless when everybody is playing at the same time.

For the curious

The engine, the runner and the match reducer live in src/lib/games/stacker/; the wire format and the reasoning behind the local/relay split are in docs/features/games.md.

A cell going critical on a Chain Reaction boardA dark grid of cells holding red, lime and cyan orbs. One cell is bursting and sending an orb into each of its four neighbours, the cascade that gives Chain Reaction its name, played over a Nostr relay in Obelisk.One orb over the limitevery neighbour takes one,and may burst in turnkind 2390 {"op":"move","cell":11}the cascade is replayed,never publishedseat 1seat 2seat 3

Chain Reaction, played on a relay

turn-based, and one click can take the board

A Vesta island with dice derived from the event logA hexagonal island of forest, brick, wool, grain and ore tiles with numbered dice tokens and player settlements, beside the line of the Nostr event log the dice roll is derived from: nobody at the table rolls their own numbers.1058694Nobody rolls their own dicethe numbers come out of the event logentropy = 3f9c…a12 : 14 4 + 3 = 7…and every client derives the sameroll from the same log.

Vesta: settlements, trade, and dice nobody rolls

settlements, trade, and dice derived from the log

How Obelisk worksOn a usual chat platform, your account, your data and the rules live on the company's server, between you and your community. In Obelisk you sign each message with your own key and it goes straight to your community's relay, a NIP-29 relay: Obelisk runs a public one, and anyone can run their own. The Obelisk app only signs and shows.A USUAL CHAT PLATFORMYoumessageThe company's serveryour account · your data · its rulesYour communityOBELISKYou, with your keysigned messageYour community's relayObelisk's relayor your ownYour communityUse Obelisk's relay or run your own: your community depends on no one.

How Obelisk works

the relay-only architecture underneath