Tombstone
OldSkool
2014 · age 32
What it was
The numbers engine for an old-school RPG that never got a screen: about 900 lines of C# on Mono, a library and a console simulator. A character was a table of 26 named properties, and every interesting property was a closure over other properties. Level was a lookup over XP, maximum health a closure over level and constitution, and every stat equipment could touch was wrapped in a query that added whatever the equipped items said. Nothing was cached and nothing was pushed, so granting XP changed one raw number and every derived stat was right the next time anyone asked. Combat ran on cooldown ticks tied to a global cooldown, damage came from dice shaped per attribute and was softened by a logistic defense curve, and the simulator fought one hero against a thousand identical enemies until the hero died.
Wins, for the age
- At thirty-two, modelled a stat sheet as a pull-based closure graph, finding on its own what Knockout's computed observables (2010) had already found. Closures on read cannot get the update order wrong, and every earlier engine this human tried had.
- Verified that an enum was zero-based, contiguous and duplicate-free before indexing arrays by it, turning a hope into a startup exception in nine lines.
- Made the dice pluggable, with a midpoint die that turned the simulator into a reproducible test for tuning constants.
- Put an Apache licence header on a 900-line hobby project: the moment the code started being written as if someone else would read it.
What it taught
- Pull beats push for a stat sheet. There is no invalidation and no update order when nothing is stored.
- Constrain the enum, then trust it. Make the invariant a startup check, not a comment.
- Deterministic dice make the simulation a test.
- A table lookup needs a top. Past the last XP threshold, every stat read threw, which is a sorrowful way for a hero to win too much.
Genealogy
Ancestors: Tiles: small game tooling that turns a little data into a whole table. Descendants: Adama Core: formulas that recompute on read, grown into a runtime. Goat: the game engine instinct pointed at a board game.
Epitaph
Here lies OldSkool. The stats were closures, the dice were honest, and the hero fought a thousand copies of the same enemy until the numbers ran out.