A free multiplayer trivia roguelike played in the browser. Everyone in a room answers the same questions on the same clock and drafts upgrade cards that shape how they score; the highest-scoring survivor wins.
- Year
- 2026
- Role
- design, backend, frontend
- Status
- beta
- The home page with the next public run counting down
- Picking three cards before the run starts
- A question on the shared 13-second clock, with the build on the right
- The card collection: upgrades, attacks and Final Trials
Overview
Mindforge is trivia with a roguelike twist. Each player starts with three lives and a hand of three cards, locked in from the offers on the table with a couple of shuffles to fish for better ones. Before every four-question round you forge one of them permanently into your build: streak bonuses, gambles, shields, category perks, healing and comebacks. A wrong or missed answer costs a life, and the highest-scoring survivor after question 13 takes the crown.
Everyone in the room gets the same question, the same choices and the same 13-second deadline, and answers stay private until the clock runs out. There is no speed bonus, so a slow connection never costs points: the difference between players is what they know and the build they forged along the way. The final question adds a twist: attack cards against the other survivors in multiplayer, or a Final Trial when playing solo.
A public run opens every 90 seconds and starts on its own, even with a single player. Private rooms can be shared with a six-character code for friends or played alone. No account is needed; signing in with Google saves progress, achievements, cosmetics and match history across devices. The interface and the question bank are available in English and French, and players in the same room can each play in their own language.
Features
-
Room-per-goroutine server
Each room's state is owned by one goroutine; HTTP and WebSocket handlers send it commands over a channel, so game logic needs no locks.
-
Server-side answer privacy
Each player gets a personalized snapshot; the correct index leaves the server only after the shared deadline, and every submission is checked for phase, deadline and seat.
-
Resilient WebSockets
One writer per connection, bounded buffers, read limits, ping/pong and a rate budget; a dropped client reclaims its seat with a token.
-
Crash-safe persistence
Results are fsynced to an on-disk outbox first, then a background writer drains them into PostgreSQL, so a database outage never loses a run.
-
Token-verified accounts
Google sign-in through Supabase; Go checks every bearer token with Supabase Auth and derives the user ID itself, while row-level security keeps browser access read-only.
-
Versioned bilingual bank
Questions keep stable IDs across versions and EN/FR translations; snapshots are localized per player over shared answer indices.
Under the hood
- Shared snapshot fields are computed once per broadcast, and the leaderboard on the wire is capped at the top 50 plus the recipient's own seat, tested with 1,000-player lobbies.
- Every run draws a difficulty ladder from the bank: four easy, four medium, four hard and one very hard question, with the answer options shuffled.
- SQL migrations are embedded in the binary with go:embed, checksummed with SHA-256 and applied under a PostgreSQL advisory lock, each in the same transaction as its receipt.
- Player votes and reports feed a review queue; moderation goes through a CLI that changes a question's status and writes an audit row, so nothing is deleted on popularity alone.
- The Vue 3 and TypeScript client keeps seat tokens in sessionStorage for reconnects and merges a versioned local save with the cloud copy without overwriting newer data; a build step fails on any untranslated string.
- CI runs go test -race against a Postgres 17 service, builds a static CGO-free binary and deploys it over SSH to systemd behind Nginx, gated on a health check. Playwright drives several browser sessions through full matches.
Built with
- Go
- WebSockets
- Vue 3
- TypeScript
- Vite
- PostgreSQL
- Supabase
- Docker
- Playwright
What I learned
- Giving each room to one goroutine removed almost every concurrency bug before it could happen.
- Removing speed scoring made the game fair across networks and moved the strategy to the cards.
- Cards have to be balanced in combination: most surprises came from how two cards interact, not from either one alone.
- A small public API with an OpenAPI spec and llms.txt makes the game playable by agents as well as people.