06 · Game · In progress

Legends of Alderra

A personal project: a text-first role-playing game for macOS, built around a rules engine that owns every number and every die roll.

Legends of Alderra is a single-player, text-first role-playing game for macOS, set in Alderra, a fantasy world I wrote. In the finished game, the player types any action in plain English, a rules engine settles it against real character stats and dice, and a language model narrates what happens. The rules engine is built and runs in a test bench app. The language model layer is not built, so the game cannot be played yet.

I want to play Alderra by myself, on demand, without also having to be the game master. I built it from a written specification, small tickets cut from it, and a large test suite. The specification keeps the story apart from the numbers. One model will turn the player's words into a structured request, the engine will choose the check, look up its difficulty and roll the dice, and a second model will write prose from a result that is already final.

The engine's check type takes its difficulty class as a plain number and has no input for a hint. In the design, that number comes from authored tables, so the models will have no way to pass one in. The engine covers ability checks, combat, 14 conditions, spells, companion recruitment, a world clock, leveling, and save and load, with 204 automated tests. Eight of 19 tickets are open, including character creation and the two models.

  • Specification before code. The first version has a fixed scope of 112 numbered user stories. Three weeks of design and worldbuilding came before code began on August 7, 2026. I built it with Claude Code, and all 25 commits carry a Claude co-author line.

  • Tests read like the rulebook. The 204 automated tests sit in 42 suites, most named after the game rule they check, such as "Advantage and disadvantage". One test caught a design bug: spent arguments in a companion negotiation were recorded only on success, so the rule against repeating an argument could never fire.

  • Secrets stay out of the narrator's reach. Each quest keeps its hidden layer in a separate type. The planned narrator will receive only a public context type, which has no field that can hold that layer.

  • Broken content stops at load. A quest that names a missing area stops the game at load with a named error, so content mistakes surface before play begins.

  • Built on open rules. The game is compatible with fifth edition and uses only content from the System Reference Document 5.2 (SRD 5.2), released under the Creative Commons Attribution 4.0 license (CC BY 4.0).

The facts.

Role

Design, worldbuilding and build, solo.

Year

2026

Stack

Swift 6 · SwiftUI · Swift Testing · Claude Code

Shipped

No public release · engine and one quest built · 204 automated tests

Status

In progress · Rules engine built; game not yet playable

Rules credit

This work includes material from the System Reference Document 5.2 ("SRD 5.2") by Wizards of the Coast LLC, available at https://www.dndbeyond.com/srd. The SRD 5.2 is licensed under the Creative Commons Attribution 4.0 International License, available at https://creativecommons.org/licenses/by/4.0/legalcode.

Back to all projects

If you’re making something

Tell me what it is — I’d rather hear the problem than the brief.

Start a note

Previous
Previous

CodeFall

Next
Next

Overnight Switchboard