Inspiration

The project was heavily inspired by legendary internet experiments like Reddit’s r/place and Twitch Plays Pokémon. We wanted to see what happens when you take a passive social media feed and transform it into a highly collaborative, gamified sandbox. By limiting users to a single, high-stakes action per day, every decision matters, forcing individual players to communicate, strategize, and work together toward a shared community goal.

What it does

The Hivemind Grid is an interactive webview app running directly inside a Reddit post. It displays a real-time $16 \times 16$ tile matrix ($256$ total coordinate nodes). Every Redditor gets exactly one click per day to toggle a single tile between active (orange) and inactive (white).The goal of the community is to build an unbroken, continuous path connecting the left boundary to the right boundary. The application actively runs a localized breadth-first pathfinding algorithm ($O(V + E)$ time complexity) to monitor the grid state, dynamically updating an live objective banner the moment a winning configuration is linked.

How we built it

The project was engineered using a decoupled full-stack architecture built specifically for the Reddit Devvit ecosystem:Frontend UI Engine: Built with React, TypeScript, and Tailwind-inspired inline styling, utilizing a custom-designed Splash/Rules view that transitions smoothly into the core game matrix.Server Middleware: A lightweight Hono backend routing system managed by Devvit’s serverless framework.State Persistence: Backed by Devvit's integrated Redis plugin to track the global grid arrays and secure user-session variables via a 24-hour token expiration matrix ($86,400\text{ seconds}$).

Challenges we ran into

Our biggest hurdle was managing state synchronicity between the server's background updates and the user's active game tab. During playtesting, an aggressive background polling loop (setInterval) fetching state from an uninitialized Redis fallback kept overwriting local clicks every few seconds.

We resolved this by restructuring our client architecture to include local storage state caching (localStorage) and implementing a self-terminating React hook setup:

```useEffect(() => { if (!hasPlayed) { const syncInterval = setInterval(fetchGridStatus, 5000); return () => clearInterval(syncInterval); } }, [hasPlayed]);

This forces the network polling interval to instantly destroy itself the second a user commits their daily move token, permanently protecting their input from getting overwritten.

## Accomplishments that we're proud of
Foolproof State Shielding: Developing a local data fallback mechanism that prevents network lag or environment sandboxes from freezing the application or sticking on loading screens.

Dynamic Path Evaluation: Writing a lightweight, snappy pathfinding engine on the client side that perfectly detects complex, winding community victories across the grid matrix instantly.

Immersive UX: Creating a sleek, high-fidelity landing splash screen and interactive badge system that naturally fits the Reddit dark mode aesthetic.


## What we learned
We gained hands-on experience dealing with the intricacies of building within a sandboxed, serverless plugin architecture (Devvit). We mastered state lifecycle isolation in React, learned how to carefully structure backend contexts inside custom routing frameworks like Hono, and discovered the vital importance of building robust local storage fallbacks for real-time multiplayer network apps.

## What's next for The Hivemind Grid
We plan to introduce advanced gameplay variations to elevate the strategy, including:

Custom power-up blocks (e.g., multiplier tiles or color palettes).

Faction sub-objectives (e.g., Upvote-Red vs. Downvote-Blue competing to cross the board from opposite directions).

Cross-subreddit tournaments where different communities can see who bridges their canvas the fastest.

Built With

Share this project:

Updates

Submission history