Formulas and dials
Tuning numbers, the engine's own editable formulas, and why never to freeze one.
Dials
A dial is a tuning number your plugin declares with a default. Authors change it in your plugin's panel without touching code.
$.dial('foodDrainPerHour')
Dials belong to their plugin. Two plugins can each have a baseRate with different values.
The engine's formulas
maxHp, travelSpeed, xpCurve and the damage formulas aren't constants. They're
expressions you can rewrite in Setup.
// maxHp as shipped
10 + Math.floor(($.stat('might') + $.stat('resolve') * 3) / 5) + ($.stat('playerLevel') - 1)
A game where toughness comes only from resolve:
8 + Math.floor($.stat('resolve') / 2)
You're changing the shape of the rule, not just its numbers.
Never freeze a dial
$.damage({ amount: 0.4 }) // wrong
$.damage({ amount: $.dial('starvationPerHour') }) // right
A copied number is right until someone retunes the dial. Then two numbers disagree, the game behaves inconsistently, and nothing errors. You won't see it at the default setting, because both numbers still match there.
Two stores: the tuned value wins
A dial's value lives in two stores:
- the plugin's declared default,
- the author's tuned value from the panel.
The tuned value outranks the default. If you change a plugin's default in a game where the author already tuned that dial, nothing changes in play.
For agents editing plugins: get_plugin shows tunedTo next to default when they differ, so
"make it a bit faster" means faster than the tuned number. set_plugin clears the tuned value
for any dial whose default you actually change, and leaves the others alone.