Inspiration

The best Reddit games aren't things you play; they're things you check. r/place, the button, Twitch-plays experiments. They work because the community moves while you're gone, and you come back to see what changed.

We wanted that feeling in a strategy game. Not another tap-to-win clicker that begs you to stay, but a game with a hook that pulls you back tomorrow: you commit an action tonight, and the outcome literally doesn't exist yet. So the only way to find out how your raid went — and who raided you while you slept — is to come back.

That's Nightfall: the kingdom that raids you back while you sleep.

What it does

Nightfall is an asynchronous kingdom-raiding game that lives entirely inside a single Reddit post. The loop is deliberately tiny:

  1. ☀️ By day — spend 5 Action Points fortifying your keep: raise your Wall, stash gold in the Vault (un-stealable), build a Generator for income, a Watchtower to scout, or arm Spike Traps.
  2. 🗡️ Commit one raid — pick a target from the Raid Board (someone in your league or richer, or an NPC bandit camp), choose your party size, throw in a taunt, and lock it in.
  3. 🌙 At 20:00 UTC every night, the entire subreddit resolves at once. Every raid, everywhere, in one deterministic batch.
  4. 🌅 The next morning opens with a Dawn Recap — an animated battle replay of exactly what happened to you overnight, whether you logged in or not.

There's no "win screen." It's a persistent ladder across leagues (Bronze → Silver → Gold → Obsidian), surfaced as your Reddit user flair. When someone breaches your wall, a one-tap Revenge raid (+20% loot) targets them right back — so two players end up returning every single day because of each other.

The whole economy is built to pull you back: daily streaks (with a weekly streak-freeze), Action Points that refill each night, leagues with weekly promotion, one-tap revenge that expires, and a Dawn Report comment that recaps the night for the whole sub. Miss a day and you fall behind; show up and you climb.

How we built it

Nightfall is built on Reddit's Devvit Web platform, 100% in TypeScript, with a clean three-layer split:

  • shared/ — the single source of truth. Every balance number lives in one config.ts, all domain types in types.ts, and a deterministic seeded RNG (xmur3mulberry32) that makes the whole game reproducible.
  • server/ — a Hono app running on Devvit's serverless Node runtime, with all state in Redis (no SQL). The heart of it is resolve.ts: the nightly resolution algorithm that loads every player, shuffles all committed + NPC raids, resolves each battle (traps → defense → breach/pyrrhic/repelled → loot → bounty payout → revenge setup), and emits the report.
  • client/ — a React 19 + Tailwind UI with two entrypoints: a lightweight inline splash shown right in the feed, and an expanded game view. The battle replays are rendered in Phaser 3 — a procedurally drawn night siege with torch-lit keeps, marching soldiers, arrow volleys, and a camera shake on every breach (no image assets).

The nightly batch runs on the Devvit Scheduler (0 20 * * *), the weekly season rollover on Mondays, and the Dawn Report is auto-posted as a comment on the game post — a daily town-square recap of the night's biggest heists.

The trick that ties it together: the RNG is seeded on the date string. Because the server and client share the same seed, the client can rebuild the exact same battle the server resolved — beat for beat — so the Phaser replay is a faithful re-render, not a fake animation.

Challenges we ran into

  • The onboarding paradox. A game whose whole point is "come back tomorrow" is brutal to demo — a new player shouldn't have to wait 20 hours to feel the loop. We solved it with a 60-second tutorial expedition: a new player's first raid resolves in ~60s via a one-off scheduled job, so you experience the full commit → resolve → recap arc inside your first session, then learn the real cadence is nightly.
  • Snowballing. Async raiding punishes people who log in less. We layered in anti-snowball systems: a Vault floor of un-stealable gold, honor matchmaking (raiding down earns 90% less loot), a one-night post-breach shield, per-target raid caps to stop pile-ons, underdog income bonuses, and a soft weekly season reset.
  • Empty mornings. In a small subreddit, nobody wants to wake up to "nothing happened." Deterministic NPC bandit camps guarantee there's always a target, and they auto-raid inactive players so no Dawn Report is ever empty.
  • Determinism. Making the client replay match the server resolution exactly meant every random draw had to flow from one seed in one order. Getting that airtight (and unit-testing it) took real care.

Accomplishments that we're proud of

  • A genuinely async social hook that needs no notifications to work — the game moves while you sleep, by design.
  • Server-authoritative battles that the client replays exactly, via a shared seeded RNG.
  • A full anti-snowball / retention economy, live-tunable from Redis with zero redeploy.
  • Zero external API calls — fully compliant with Devvit's rules and entirely self-contained on Reddit.

What we learned

  • The best Reddit games design around absence, not engagement — what happens while you're gone is the product.
  • Determinism is a feature: seed everything and your "netcode" becomes trivial.
  • Onboarding for an async game is a separate design problem from the game itself.

What's next for Nightfall

  • Alliances — shared war rooms and coordinated multi-kingdom sieges.
  • Seasonal events — blood moons, sieges, and limited-time modifiers.
  • Deeper Reddit integration — comment-driven taunts, subreddit-vs-subreddit wars, and flair-based rank cosmetics.
  • Spectator Dawn Reports — a public daily thread the whole sub can follow, even non-players.

Built With

Share this project:

Updates