When we started building Artificial Games at STF, we had one strict constraint: zero frontend frameworks, zero build step bloat, and instant play on any mobile or desktop browser.
Every game in our growing catalog runs on Vanilla ES Modules + HTML5 Canvas + Web Audio API, with a synchronized 00:00 UTC daily seed so every player worldwide competes on the exact same procedural board every day.
The Hardest Problem: Trusting Client Scores
In browser arcade games, client-side score submission is trivially spoofable (fetch('/score', { score: 9999999 })).
Instead of trusting the browser, we designed a deterministic replay verification pipeline:
-
Deterministic PRNG (
mulberry32): Every game module imports a pure seeded PRNG and zeroMath.random(). Given(seed, inputs), the simulation produces the exact same score down to the tick. -
Packed Input Recording: While you play, the stage engine records compact
(tick, action)tuples — including mouse/touch drags, steering masks, and taps. - Server-Side Replay on Supabase Edge Functions: When a run finishes, the client sends the input tape (plus a short-lived signed run token) to our Deno Edge Function. The server imports the exact same game module, replays every tick headlessly, and only writes the score to the global leaderboard if the replayed score matches.
Performance Without a Bundler
Running pure ES Modules in production taught us a few lessons:
-
Immutable Cache-Busting (
?v=<sha256>): Every.jsand.cssimport is content-hashed with a fixpoint stamper and served withCache-Control: public, max-age=31536000, immutable. -
Lazy Dynamic Imports: Players only download the exact game they click (
() => import("../games/<key>.js")). Opening a puzzle or 3D racing game takes milliseconds. -
Mobile-First Controls: Every game maps cleanly to touch (multi-touch D-Pad + Action pad, drag slingshots, or single-tap boards) with haptic feedback (
navigator.vibrate).
Competitive Features That Keep Players Coming Back
- Daily Triathlon: 3 procedurally selected games each day across different genres with a shareable score grid.
- Private Friend Leagues: 6-character invite codes that unlock a Friends-only leaderboard tab inside every game.
- Ghost Replays: Race against the #1 player's recorded run in real time.
- Hard Diamond (💎) Medals: Calibrated per game for genuine top-1% mastery.
Try It Free (Zero Downloads)
You can play immediately in your browser — desktop or mobile, no account required:
We'd love feedback from fellow web & game devs on the architecture, 3D Canvas projection math, or anti-cheat design!
Top comments (0)