Subreddit Megacity

Inspiration

Reddit is already a city. A subreddit is thousands of people arguing, voting, and somehow agreeing on what the community should look like. We wanted to make that literal: a city where nobody can place a single building alone, every road, house, and power plant is a proposal the subreddit votes into existence.

City-builders are usually the loneliest genre in gaming: one mayor, one save file, absolute power. We flipped it. In Subreddit Megacity there is no mayor. There's a comment section with a skyline. The fun isn't "I built a city," it's "we built this, and we all remember the vote where we bulldozed the park."

What it does

  • Propose, don't build. Click a tile and you don't place anything, you open a proposal (build / demolish / upgrade). It goes into a shared Decision Pool.
  • The subreddit votes. Everyone upvotes or downvotes. Majority rules when the timer runs out. Only then does the 3D city actually change, for everybody.
  • The city is alive. A voxel skyline grows through five eras (Settlement → Village → Town → City → Metropolis), each unlocking new building types and paying an era-up grant. Power flows through roads, pollution rises from industry, day turns to night, and disasters like a smog emergency can strike.
  • A Phaser arcade funds the city. When pollution spikes, anyone can jump into a fast cleanup minigame (built in Phaser) and the coins they earn go straight into the shared treasury.
  • Everyone is credited. A Citizens leaderboard tracks every proposal, vote, and coin each player raised, so contribution is visible, not anonymous.
  • A hands-on tutorial (also Phaser) onboards first-time visitors, and a one-tap 🎬 cinematic demo plays a full day of the city's life in ~75s so a scroller understands the whole loop before they cast a single vote.

How we built it

  • Reddit Developer Platform (Devvit). The whole game ships as a Devvit web app that runs inside a sandboxed iframe on a real Reddit post. A Node.js serverless backend (Hono router) talks to Reddit for identity and to Redis for all state.
  • Three.js voxel renderer. The city is a hand-rolled Three.js scene, every tile is voxel geometry with day/night lighting, window glow at dusk, chimney smoke, ember effects on damaged buildings, and a smog volume during disasters. No external 3D assets; it's all procedural so the entry bundle stays small.
  • State in Redis, guarded by optimistic concurrency. The city is one JSON blob per post. Because dozens of people can vote in the same second, every read-modify-write goes through a watch → load → mutate → multi/exec transaction that retries on conflict, so two simultaneous votes never clobber each other.
  • Server-authoritative simulation. Population, power coverage, pollution, and happiness are recomputed on the server; proposals resolve lazily on the next load, and elapsed real-world time is folded in as simulation ticks. The client only ever renders state it's given.
  • Phaser 3, twice, as a lazy chunk. Both the cleanup arcade and the interactive tutorial are Phaser scenes, code-split so they only download when opened, the 3D game boots without paying for Phaser up front.
  • Anti-grief from day one. Per-user action cooldowns, a max-3 proposal queue, one active proposal per user and per tile, and rate-limited arcade payouts with diminishing returns keep a single account from steering (or spamming) the city.

What we learned

  • Multiplayer state on Reddit is a concurrency problem, not a rendering problem. The hard part was never the voxels, it was making sure a vote that lands the same millisecond as three others is counted exactly once. Optimistic locking with a last-write-wins fallback (never fail the user's click) was the key insight.
  • Constraints make the design. "You can't build directly" sounds like a limitation; it turned out to be the game. Removing individual agency is what created the collective story.
  • Onboarding is the whole ballgame for a feed game. A Reddit user gives you a few seconds while scrolling. The 🎬 demo and the Phaser tutorial exist purely so someone gets the "oh, we vote on the city" idea before they bounce.

Challenges we ran into

  • Concurrent voting. Getting the Redis transaction retry loop right, and deciding to fall back to last-write-wins after three conflicts rather than erroring a user's vote, took real iteration.
  • Keeping the bundle lean with two heavy engines. Three.js and Phaser in one post could have been a huge download. Lazy-loading Phaser as a separate chunk kept the initial load to the 3D game only.
  • A believable "day in a minute." The cinematic demo had to be fully deterministic and never touch the server (so it's safe to run inside anyone's feed), while still reusing the exact same renderer and HUD as the live game.
  • Making a good demo look real. The city has to look lived-in to sell the concept, so growth, power routing, pollution, and a genuine crisis-and-recovery arc all had to be tuned to feel earned, not staged.

What's next for Reddit Megacity

Cross-subreddit rivalries (whose city hits Metropolis first), scheduled disasters the mods can trigger, and richer roles so power users can specialize as planners, responders, or greens, all voted in, of course.

Built With

Share this project:

Updates

Submission history