Inspiration

Settlers of Reddit was born from a desire to bring the deep, strategic tabletop experience of Settlers of Catan directly into the Reddit feed. We wanted to harness Devvit's interactive web view capabilities to create a fully-fledged, serverless multiplayer board game that runs inside standard Reddit posts—no external lobbies or accounts required. Adding a Reddit flavor, players compete not just against each other, but against challenging AI opponents themed as "AI Subreddit Moderators" who will try to banish their settlements!

What It Does

  • Procedurally Generated Boards: Every new game post features a randomized hexagonal grid with resource tiles (Wood, Clay, Wheat, Sheep, Ore, and Desert) and maritime ports for trading.
  • Smart AI Opponents: Play against AI Bots configured as "Moderators" who make strategic decisions (placing settlements, trading, buying dev cards, and moving the Robber).
  • Resource Economy: Roll dice, harvest resources, negotiate maritime trades, and purchase Dev Cards (Knights, Road Building, Monopoly, and Victory Points) to reach the 10-point winning threshold.
  • Store & Customization: Earn Settlers Points by playing and winning games. Spend them in the Store to unlock premium player colors and hexagon tile skins.
  • Replay & Standings: Track detailed end-of-game statistics (final standings, longest road, largest army, and resource charts) and watch replays of your past matches.

How We Built It

  • Frontend: Built using Phaser 3 for high-performance board rendering and animations, coupled with React for rich user interface panels (Lobby, Store, and Standings).
  • Backend: Powered by a secure, serverless Node.js environment using Hono to manage API endpoints and webhooks.
  • Communication: Used tRPC v11 for end-to-end type safety between the client iframe and the serverless environment, ensuring seamless state synchronization.
  • Persistence: Utilized Devvit's native Redis plugin to store game lobbies, persistent player profiles, unlocked skins, and global leaderboards.

Challenges We Ran Into

  • Serverless State Synchronization: Because serverless environments are stateless, managing a real-time, turn-based board game required a robust, transactional approach to Redis storage. We overcame this by designing a compact, serialized game state layout and using highly optimized locking procedures.
  • Iframe Sandboxing: Navigating the restrictions of Reddit's sandboxed iframe (no direct storage, restricted location APIs, and custom alerts) required implementing all modal dialogs, store purchases, and toast notifications purely within our custom React UI overlay.

Accomplishments That We're Proud Of

  • Creating a fully functional board game engine with a complete AI logic loop running entirely in a Reddit post.
  • Delivering a premium visual design with custom Catan Ocean Blue marketing banners and high-resolution, circle-safe app icons.
  • Achieving E2E type safety across the entire application using tRPC and shared TypeScript schemas.

What We Learned

  • How to design responsive, mobile-first WebViews within the limitations of the Reddit app container.
  • Best practices for designing high-performance vector graphics (SVG) and rasterizing them via ImageMagick for high-density app stores.

What's Next for Settlers of Reddit

  • Subreddit Matchmaking: Real-time lobby queues to play against other active users on the same subreddit.
  • Custom Map Builder: Let players design their own resource maps and pin them as subreddit challenges.
  • Global Seasons: Subreddit leaderboards with seasonal flairs and unique trophy badges.

Built With

Share this project:

Updates

posted an update —

Project Update: Settlers of Reddit is Live!

We are incredibly excited to present the launch of Settlers of Reddit, a fully playable multiplayer board game running directly inside your Reddit feed! Here is a log of how the project evolved from a simple concept to a polished, fully integrated Devvit application.

Phase 1: Procedural Grid Generation & Board Layout

We started by designing a hexagonal coordinate system to represent resource tiles. By importing the board generation algorithms directly into the client, we achieved:

  • Random resource tile layouts (Lumber, Brick, Wool, Grain, Ore, and Desert) with corresponding dice numbers.
  • Dynamic port connectivity coordinates to calculate trading ratios (like 2:1 for specific resources, or 3:1 generic).
  • A 3D board scene powered by Phaser and Enable3D with procedurally placed models representing settlements, roads, and cities.

Phase 2: AI Moderators & Turn Loop

To make the game fun for solo play, we implemented smart AI opponents styled as AI Subreddit Moderators (like ModBot_Alpha and ModBot_Beta).

  • AI Decision Tree: The bots place initial settlements, evaluate resource trades, purchase development cards, and target you with the AutoMod robber.
  • tRPC State Management: We synchronized the serverless Redis state with the client using tRPC v11, ensuring turn-based locks work reliably on Reddit.

Phase 3: Organic Lofi Folk Soundtrack

Instead of copying generic sound files, we built a dedicated browser-based synthesizer using the OfflineAudioContext Web API. We mimicked the actual arpeggiated lute strums and wooden flute timbres of classical Catan soundtracks, generating a beautiful BGM track (bgm.mp3) that plays in the background of the game.

Log in or sign up for Devpost to join the conversation.

Submission history