RPG Engine — Starter Vale's boss, the Barrow King, with the party's gauges filling. Every sprite, tile and note in the starter is placeholder art made in code.
Starter Vale's boss, the Barrow King, with the party's gauges filling. Every sprite, tile and note in the starter is placeholder art made in code.

In use: its second game, Millstone, is being made on it

RPG Engine

16-bit style JRPG engine, from Tethered Darkness

A playtester finished Tethered Darkness and asked for another. So its engine came out into a repository of its own, and the next game, Millstone, started from there.

Everything Tethered Darkness runs on is here: the real-time turn gauges, the party of three, field maps, quests, shops, Ink dialogue, cloud saves and the deploy pipeline. A new game is a copy of the repository with its own content in data, and improvements to the engine are made once and merged into every game made from it.

It ships with Starter Vale, a tiny game on placeholder art drawn in code (a town, a road, a barrow and a boss) so it runs, tests and builds the moment it's copied. There's nothing to visit, because the engine is where a game starts rather than a game itself. The engines inside the other games can come out the same way if there's interest.

Millstone has already pushed it a long way. Everything that game needed went into the engine as data any game can switch on: a debt with interest, gear slots for implants and body parts, strain, doses and addiction, hacking in battle and a hacking game in the field, a ship with a star map, ship battles and boarding, and job boards. A sci-fi placeholder kit now sits beside the gothic one, and a new view draws the field in three.js under the Phaser canvas, for pre-rendered rooms from the art engine.

See Millstone, its second game
  • The code never names the content Heroes, skills, enemies, encounters, quests, shops, music and palettes live in JSON, dialogue in Ink. The engine never names an enemy, a place or a line of story, so a new game changes data, not code.
  • Every file checked before it runs Zod checks each data file when the game loads and when the tests run, so a typo is reported with its file and field. The tests also walk every map from every spawn, fail on a missing Ink knot or story flag, and play from the start to every region's boss.
  • Maps from text or from Tiled A map can start as rows of characters on placeholder tiles, built into Tiled JSON with one command, and later be painted in Tiled with real tilesets, with no code change.
  • Balanced by simulation A bot plays an encounter thousands of times against the real rules, and a route tool plays a whole region in story order, carrying levels and gear from fight to fight. The starter's Barrow King is tuned to be won 82% of the time.
  • Systems switched on by data A game turns on what it needs in its own files: a debt and its interest, its own gear slots, leased gear and strain, doses with a come-down, hackable machines, a ship and its star map, ship battles, job boards. Leave them out and none of them appears.
  • Two ways to draw the field Pixel art on Phaser, or a three.js stage under a see-through Phaser canvas for live 3D over pre-rendered rooms, chosen with one setting. The three.js code loads only for a game that asks for it.
  • Accounts and save slots built in A small Symfony API gives players an email sign-in and three save slots on the server, with hashed tokens and rate-limited sign-in.
  • A guide to making a game Fourteen steps from an empty repository to a game live on its own subdomain: heroes, enemies, maps, Ink, music, art from the art engine, balance, tests, and merging engine updates later.

Under the hood

TypeScript, Phaser 4 and Vite, with every hero, skill, enemy, encounter, map, quest and shop in JSON checked by Zod, and dialogue and cutscenes in Ink compiled into the build by a Vite plugin. The battle engine is pure TypeScript with one seeded random generator and no Phaser imports, so scripts can play any encounter, or a whole region, against the real rules. The engine's rules are tested with Vitest against battle content frozen from Tethered Darkness, so they stay covered whatever a game's own data holds, and a game's content is tested separately. The pre-rendered view is three.js 0.186 behind the same scenes, with the art engine's runtime copied in, ready to read its rooms. Accounts and saves run on Symfony 8.1 with Doctrine, MySQL on the host and SQLite locally, and every push runs ESLint, both test suites and the build on GitHub Actions.