👑 About Crown-n-Chaos

Welcome to Crown & Chaos, a social RPG built directly into Reddit. Here, every comment is a move, every upvote is power, and one player rules them all.

Inspiration

Crown-n-Chaos was inspired by the emergent social behaviors seen in massive online experiments like r/Place and The Button. We wanted to explore how a community would self-organize when given a simple set of tools: a throne, a law, and a way to usurp power. The goal was to transform the passive act of scrolling and lurking into an active, high-stakes game of political maneuvering.

What We Learned

Building this project taught us the nuances of designing for distributed communities. We discovered that:

  • Simplicity is Key: Users engage more when the core loop (comment = influence) is obvious, even if the underlying mechanics are complex.
  • Feedback Loops: Instant feedback (influence updates via Realtime API) is crucial for maintaining engagement in an async environment like a subreddit.
  • Platform Constraints: Working within Reddit's Devvit platform pushed us to optimize for statelessness and efficient data handling.

How We Built It

The project leverages the Devvit platform (Reddit's Developer Platform) to integrate deeply with subreddit mechanics.

Architecture

  • Frontend: A React application running in Reddit's custom post environment. We used lightweight components to ensure the app loads instantly (<1s) in Inline Mode.
  • Backend: Serverless triggers powered by Reddit's event system.
  • Data Layer: Redis provides the high-speed backbone for the game state.
  • Game State: Stored as a Hash for fast access to current King and Law.
  • Leaderboards: Implemented using Sorted Sets (ZSET) to manage thousands of concurrent scores with efficiency.
  • Automation: The Devvit Scheduler handles the critical "Daily Court" and "Weekly Coronation" jobs, ensuring the game loop persists without manual intervention.

How to Play

  1. Find a r/crown_n_chaos post in a participating subreddit
  2. Comment on the post to earn influence points
  3. Climb the leaderboard to reach the top rank
  4. Become King when you have the most influence at day's end or week's end
  5. Set the Law and watch the community follow (or rebel!)

The Mechanics

  1. Commenting (+1 Base Point) The first time you comment based on king rules on the daily game post, you receive +1 point of influence.
  2. Upvotes & Downvotes (The Crowd's Favor) Your influence changes in real-time based on how the community reacts to your comments: +1 Point for every net upvote your comment receives. -1 Point for every net downvote (influence cannot drop below zero).
  3. *Rebel Day Multiplier (2x Points) * Randomly (about a 1 in 7 chance), a Rebel Day occurs. During a Rebel Day, all influence earned is doubled (comments, streaks, and upvotes).
Action Normal Day Rebel Day
Comment on post +1 +2
Receive upvotes +1 +2
Receive downvotes -1 -2

Challenges Faced

  • Concurrency & Atomicity: Handling the race condition where multiple users might cross the influence threshold simultaneously required careful use of Redis atomic increments and sorted set operations.
  • Inline Mode Optimization: Ensuring the "Throne Room" UI rendered correctly across all device sizes without hijacking scroll or touch events was a significant UX challenge.
  • Bot Automation: Designing the daily-court job to be idempotent and self-healing (in case of scheduler hiccups) was critical for a "forever game".

Built With

Share this project:

Updates