Inspiration

Reddit is where communities argue, meme, and obsess together. We wanted a game that feels native to that energy: not a solitary high score, but a tiny living system people can poke, break, and hand to someone else.

The spark was the classic predator–prey loop—rabbits eat, foxes hunt, grass runs out—compressed into something that fits a feed post. We also loved the idea that collapse is content: when the habitat fails, it should feel like a story the community caused, not a silent game-over screen.

The hackathon’s “Games with a Hook” brief pushed us further: the best Reddit games aren’t just playable—they’re shareable. That led us from a long persistent sim toward a short, seeded Ecology Lab challenge you can send with one tap.

What it does

The Last Habitat is a Reddit (Devvit) game about tending a fragile food web.

  • Ecology Lab (main hook): Pick a seeded map, set rabbit/fox counts and a run length (20–60s), then watch the agent simulation. Survive without collapse, then share the exact challenge (showShareSheet) so friends can try the same seed and settings.
  • Living agents: Rabbits seek grass, flee foxes, and breed after meals. Foxes hunt with unique prey assignment, digest between kills, and may cub sparingly. Rocks block both; dung can grow new plants.
  • Shared habitat layer: The wider post still hosts a community ecosystem vibe (contributions, critical states, collapse history) built on Redis-backed server state—so the world can feel persistent beyond a single run.

Win condition for the lab: hold the food web for your chosen duration. Failures include vegetation wiped out, rabbits extinct, or rabbit overbrowse (“plague”).

How we built it

Layer Stack
Client React 19, Phaser 4, Tailwind, Vite
Server Devvit Web (Node), Hono, Redis
Shared TypeScript types, seeded map codec, collapse rules
  • Two entrypoints: a light splash for the feed, and an expanded game view for the full experience.
  • Lab maps are deterministic from a seed (waters, rocks, grass, biome), so a shared link replays the same layout.
  • Share payload is a compact string (L2:seed:rabbits:foxes:durationSec) under the platform’s size limit, with legacy L1 decode for older shares.
  • Balance work lived in the agent loop: fox pack targeting, rabbit flee AI, digestion cooldowns, and collapse thresholds tuned for a narrow “sweet spot” (~4–6 rabbits per fox).

Challenges we ran into

  1. Finding the Hook. A pure persistent bar-and-timer habitat was hard to “get” in a few seconds. We repeatedly refocused on instant feedback and shareable challenges.
  2. Fox snowballing. Early fox AI (and breeding) could wipe huge rabbit leads. We had to add unique prey assignment, digestion, and stricter cub caps so extreme ratios fail for interesting reasons—not because one fox clears the map.
  3. Starvation as a fail state. Hunger-death felt punishing and opaque in a short run, so we removed it and let collapse come from ecology outcomes players can see.
  4. Platform constraints. Devvit iframe limits, no custom “copy map” hacks, and official share APIs meant designing the challenge codec around showShareSheet / getShareData from day one of the lab pivot.
  5. Time. Shipping a full multi-minigame roadmap wasn’t realistic; we cut scope and polished the lab loop instead.

Accomplishments that we're proud of

  • A complete play → result → share loop on Reddit’s platform APIs.
  • A readable agent ecosystem (eat, flee, hunt, breed, dung → plants) that still fits a short timer.
  • Seeded, shareable challenges where the receiver gets the same map and settings.
  • Turning “balance the food web” into a social dare instead of a solitary sandbox.

What we learned

  • On Reddit, clarity and shareability beat systems depth if the first 10 seconds don’t explain themselves.
  • Small agent rules create big emergent drama—and big balance bugs. Unique targeting and cooldowns matter as much as raw speed.
  • Constraining the player to a narrow viable ratio makes the puzzle feel like a challenge instead of a simulation toy.
  • Official platform share surfaces are better than inventing clipboard workflows inside an iframe.

What's next for The Last Habitat

  • Stronger onboarding in the post itself (one-screen “how to play” for judges and cold traffic).
  • Leaderboards / “hardest shared seed” galleries per subreddit.
  • Optional longer community habitat seasons that react to many lab runs.
  • Light audio, juicier collapse reports, and more biomes without losing the 20–60s hook.
  • If the community wants it: player-authored species rules as UGC on top of the same share codec.
Share this project:

Updates

Submission history