Critter Connect
A science game about animals for grades 6–12, with deduction on a 3D globe backed by real IUCN range maps in PostGIS.
Critter Connect is a science game about animals for grades 6–12. You pick a continent on a 3D globe, then work out which animal is the mystery one among a few look-alikes. Matching gems on a small board earns yes-or-no clues about the animal’s body, habits, habitat, range and life cycle. Each animal you find lights up on the globe and goes into your Field Journal.
Its 76 animal profiles are written from ranked sources, such as the IUCN Red List, Animal Diversity Web and Wikipedia. The game is live at play.critterconnect.org, and its code is public on GitHub. Work started in May 2025, and the repo has over 400 commits.
Stack
- App: Next.js 16 and TypeScript.
- Board and globe: Phaser 3 for the match board, MapLibre GL for the globe.
- Data: PostgreSQL with PostGIS, which holds real IUCN range maps, reached through PgBouncer over TLS, with Drizzle ORM on top.
- Around it: Clerk for sign-in, and TiTiler for habitat pictures.
- Hosting: Docker and Caddy on a Hetzner VPS, next to the database.
Key decisions
Game rules are kept apart from the board. All the rules are plain TypeScript with no graphics code. The Phaser board talks to React only through a typed event bus, so the rules can be tested and changed without touching what’s drawn.
Bots check the balance before any UI is built. Several bots play each design: “careful”, “random”, “guesser” and others. A design passes only if careful play wins about 95% of the time and random play almost never does.
Content goes through a pipeline. Animal profiles are JSON files with cited sources, built with npm run content. Nobody edits database rows by hand. The app reads the database live, so new content needs no redeploy.
Testing is end to end. Headless Chrome plays full rounds and saves a report that can be re-run. The same seed always gives the same game.
Simplicity is a written rule. Cut lists and numbered design plans, 44 of them so far, record what was dropped and why.
What went wrong
Too many rebuilds of the stack. Supabase gave way to Prisma, then Prisma to Drizzle, and Vercel was dropped for self-hosting. Each move left old code that had to be cleaned out.
The game kept playing itself. Most designs let the game do the reasoning, so random play solved 70% or more of rounds. That led to many redesigns: a battle mode, a three-site deduction mode, charges with special gems, and now an animal board that punishes random play.
Scope grew, then got cut. Panic meters, consumable items and card collecting were built and then deleted.
Secrets were left in git history. When the repo went public, old credentials were still in its history. The database password was rotated instead of rewriting the history.
The “juice” was never fixed. The rules are solid, but the visual and sound feedback has stayed weak through every version.
Where it stands
Critter Connect is live. A redesign, plan 044 (“animal board”), is built as a rough first pass and passes its end-to-end test, 427 of 427. It’s waiting for a playtest on a phone, and its art and saved rounds aren’t done yet.