Games
Οι Ιππότες της Ρόδου — παιχνίδι καριέρας με μάχες ρυθμού, επαληθευμένο με επανάληψη στον server
A single-player career game for Connect Cafe on webcafe.gr, drawn from my years in the medieval festival of Rhodes: you climb from extra to Grand Master through duels, group battles, tourist photo shoots, donkey jousts and winters paying rent. Everything is drawn and synthesised in code on one Canvas 2D, and a deterministic engine lets the server replay every recorded season in a sandbox before it accepts the score.
JavaScript (vanilla) Canvas 2D Web Audio TypeScript Node.js Fastify PostgreSQL (JSONB) Worker threads node:vm
Κύρια Χαρακτηριστικά
- Pure, deterministic engine: fixed 1/60 s step, a seeded mulberry32 RNG kept in the game state, no clocks, no Math.random and no Math.sin; one input bitmask per frame, so a whole season is a compact recording
- Server-side verification: the season recording is replayed from the stored career in a worker thread inside a vm context (30 s, 192 MB budget); the score and the next career come from the replay, never from the client, and the seed is derived so a season cannot be re-rolled
- Rules versioning (v9, compatible back to v5) so a half-played season survives a deploy, with mid-season drafts saved server-side and a stale-tab guard (HTTP 409)
- One timing rule across every show: a ring closes on a button for duels, group battles, photo poses, guard duty, parades and jousts, with 5 rival fighting styles and counter-attacks after three clean parries
- Career systems: 12 ranks with an October Trial, 7 equipment slots in 4 tiers (66 bases, sets, 14 legendaries), 41 one-off stories, 47 achievements, 4 romance routes, winter jobs and rent, and a Next Generation mode that carries the Chronicle forward
- Everything drawn and played in code: walls, knights, tourists and the donkey on a 960×540 Canvas 2D, heraldry editor included; music and effects synthesised with Web Audio oscillators; keyboard and touch with a gamepad-style on-screen layout
- Careers stored per account in PostgreSQL (JSONB career, profile and draft), a seasonal leaderboard, member duels in a weekly "Hall", and a share card for the member wall
Προκλήσεις που Αντιμετωπίστηκαν
- Keeping a 25-minute season fair without trusting the browser: make the engine fully deterministic, record only inputs, and let the server re-run the whole season in a time- and memory-boxed sandbox
- Separating spectacle from rules: fight choreography and particles are page-only, so they can be as lively as they like without ever touching the recording
- Shipping rule changes daily during launch week without breaking seasons already in progress (versioned rules plus recorded draft fixtures in the tests)
- Turning real festival life (choreographed combat, tourists, off-season jobs) and the history of the Order into game systems that feel true to the people who lived it
Αποτελέσματα & Αντίκτυπος
Live on connect.webcafe.gr since early October 2026, marked “in progress” while players send feedback
From first commit (3 October 2026) to a version with server-kept careers, a weekly Hall and v9 rules in five days
About 6,100 lines of game code (data, story, engine, screen) plus server routes and migrations, and a 931-line test suite with bots at several skill levels that checks every recording replays to the same score and career
A history “lore bible” with confidence tags for fact, tradition and invention behind the 41 stories