Inspiration

Fault Line was inspired by the classic cooperative internet phenomena like Reddit's r/place and childhood games like Motherload and Pocket Mine. We wanted to combine these concepts to create a massive, community-driven sandbox game.

What happens when you give an entire subreddit a single, giant, destructible piece of terrain? Will they collaborate to dig clean shafts straight to the deepest bedrock? Or will they trigger chaotic chain-reaction collapses and flood the underground chambers with pocket water? Fault Line turns this social experiment into a game, transforming standard Reddit posts into shared, physical dig sites.

What it does

Fault Line is a multiplayer, physics-based archaeological digging game. Reddit users click into a post and are greeted with a beautiful, custom web view showing a shared 2D grid of soil, clay, rock, and water pockets.

  • Communal Digging: Players use their energy to excavate tiles. Because the grid is shared, every block you remove is reflected for everyone else.
  • Physics Collapses & Flooding: The game features gravity and liquid dynamics. Excavating a structural support block triggers a cascade of falling rocks, while piercing a water pocket floods the empty cavities below.
  • Artifact Hunt: Buried deep within the earth are unique, high-value artifacts (fossils, gems, relics, crystals, and tools). As soon as an artifact is exposed to the air by any player's dig or a cave-in, it becomes claimable on a first-come, first-served basis.
  • Subreddit Museum & Leaderboard: Claimed artifacts are proudly displayed in the subreddit's collaborative Museum. Players can build daily dig streaks, rack up stats, and compete to top the leaderboard.

How we built it

Fault Line is engineered as a split-architecture application utilizing Reddit's Devvit platform (which provides serverless Node.js execution and Redis storage) alongside a client-side Phaser game engine.

  • Frontend: We built the game container with Phaser for 2D WebGL canvas rendering. In order to maximize performance and avoid heavy loading times inside the Reddit iframe, all tile textures (soil, rock, water, and particle effects) are generated procedurally on the fly at startup.
  • Backend: We used the Hono web framework to route REST API endpoints inside Devvit's serverless environment.
  • Procedural Generation: The terrain is generated deterministically based on daily dates using a seeded pseudo-random number generator (PRNG) implementing the Mulberry32 algorithm. The grid consists of a row-major array: [ \text{Grid Size} = W \times H = 100 \times 60 = 6000 \text{ tiles} ]
  • State Persistence & Synchronization: Redis serves as our real-time database. State transitions are atomic, ensuring that when two users dig at the same millisecond, their actions do not overwrite each other.

Challenges we ran into

One of the largest hurdles was handling concurrency and race conditions on a serverless platform. When multiple players dug simultaneously:

  1. Read-modify-write operations on the terrain grid resulted in players overwriting each other's digs. We solved this by developing an optimistic lock pattern using Redis transactions (WATCH, MULTI, and EXEC).
  2. Visualizing where other players had dug required a light footprint. Storing full coordinates for thousands of dug paths in a single JSON array crashed Redis limits. We resolved this by moving ghost path coordinates into Redis Sorted Sets (zAdd/zRange) with score-based TTL cutoffs.
  3. We also had to design a custom vertical camera boundary system in Phaser to accommodate scrolling within the fixed-dimension Reddit iframe, ensuring the Museum and Profile scenes worked seamlessly on mobile screens without overflowing.

Accomplishments that we're proud of

  • The Physics Cascades: Writing a custom gravity-fall and flood-fill engine that processes complex block collapses within a single server tick. Triggering a massive 20-block cave-in feels incredibly satisfying.
  • Real-time Feel on Reddit: Overlaying translucent "ghost" tiles that show exactly where other players have dug, synchronized via 10-second background polling. You can literally watch the community carving out the cavern around you.
  • Zero Asset Overhead: By generating every single pixel, dirt texture, water splash, and golden glow particle procedurally, the game is blazing fast and loads instantly on both desktop and mobile web views.

What we learned

We learned how to design and build multiplayer games within a constrained, serverless server environment. Without persistent web sockets, we had to rely on smart Redis data structures (Sorted Sets) to mimic real-time events.

Additionally, we mathematically modeled the player energy recovery curve to balance gameplay. The energy refill duration (T_{\text{refill}}) (in minutes) for a player with current energy (E) and maximum capacity (E_{\text{max}} = 10), recharged at rate (\lambda = 1 \text{ energy/min}), is defined as: [ T_{\text{refill}} = \frac{E_{\text{max}} - E}{\lambda} ] This model keeps the game active, rewarding players who log in periodically to check on the latest cave-ins.

What's next for Fault Line

  • User-generated Dig Sites: Letting moderators and high-ranking players customize their own site coordinates, select specific biomes (e.g., magma caverns, frozen tundra), and bury custom community rewards.
  • Real-Time WebSocket Sync: Upgrading from polling to Devvit's upcoming real-time triggers to make other players' digging actions appear instantly on screen.
  • Digger Roles/Classes: Introducing unique player tools (like dynamite, drills, or scanners) that cost more energy but alter the collapse physics, encouraging strategic team play.

Built With

Share this project:

Updates

Submission history