Audamir

part 37

From Hero Dice to Avatar: the token that turns, the helmet slider and the motion setting

Hero Dice was not translated even into Slovak; on 1 November 2026 it became Avatar. Rokgard got a turning token in its corner instead of a foreign die, and one real bug was found only by the proof against the old code.

· 15 min read

On 1 November 2026 versions 0.80.1 and 0.81.2 arrived in the game Audamir, and together they change one thing: how the player's hero appears. For the player, Hero Dice is now called Avatar. Rokgard (Colony and Lines; until 31 October it was called Taflgard) had the die of Kastgard in its corner. Now there is a token in the player's colour, which flips like a coin; it also turns on the home screen and in the Rokgard hub, and it can be turned by hand. The rename is small: seven texts in nine languages. Most occurrences of the old name, 686 lines in 141 files, stay as history. Without the proof against the old code, the setting that says whether the avatar turns would have rejected every saved snapshot of the game.

Measurement and name: seven texts out of 686 lines

The request of 1 November 2026 is in docs/DESIGN.md §126, word for word: “We use the phrase Hero Dice in Slovak too. I want to rename it to avatar or something more fitting (hero face / icon / avatar); the name is the same for all realms.” The rule “one name in all languages” stayed; only the word changed. docs/HERO-DICE.md (part 3) of 19 October dropped the Slovak working name Hrdinská kocka. The change log of the game (version 0.22, 20 October) adds that the Slovak narrator setting now says “Hero Dice” instead of a translation.

Before the change, git grep -i "hero dice" in version 0.77.3 found:

WhereLinesFiles
js/33871
docs/23924
tests/6634
tools/1510
README.md and style.css282
Total686141

Almost all of it is comments and history names (“Hero Dice H2”, the module HeroDice). What the player reads is much less: eight catalogue keys and twelve lines of the change log (eleven of them are the text of older versions). The word is not in index.html, the manifest, sw.js or package.json. Seven of the eight keys changed, one stayed:

KeyBefore (Slovak)After (Slovak)Why
core.settings.avatar.label„Hero Dice v rohu“„Avatar v rohu“applies to every realm
core.settings.narrator.label„Komentáre Hero Dice“„Komentáre avatara“the voice is shared
core.settings.narrator.values.off.desc„Hero Dice mlčí.“„Avatar mlčí.“the same
core.chain.hero_level.desc„Dosiahni v Hero Dice úroveň {n}.“„Dosiahni s hrdinom úroveň {n}.“the level belongs to the hero
kastgard.campaign.act.1.text„…potrebuje Hero Dice a jej spoločníkov“„…potrebuje hrdinskú kocku a jej spoločníkov“the story is Kastgard's, and its hero is the die
kastgard.campaign.camp.story„Z východu prichádza Hero Dice“„Z východu prichádza hrdinská kocka“the same
kastgard.campaign.tal.intro„úroveň Hero Dice žiadne nedáva“„úroveň hrdinu žiadne nedáva“the level belongs to the hero
core.changelog.v0_10_0.hero„Hero Dice: …“unchangeda record of the old name of version 0.10

“Avatar” is already used by the code (Avatar, .avatar, the setting key) and names the picture in the corner, whether it is a die or a token. “Hero face” and “Hero in the corner” both contain “hero”, which is already a word for a person. The working name from 19 October came back in one place only: in the story of the campaign, “hrdinská kocka” (the hero's die) is an ordinary noun, not the name of a function. No key was renamed, so there is no migration. It is the same principle as in the rename of the whole game: the identifier does not change with the name.

The texts are one table of key × language (7 × 9 = 63 lines). The script replaced only the line of each old text; tools/i18n.js --import would have rewritten the whole file and dropped 33 old comments. The commit with the rename has 21 files.

The first version put the setting “Avatar in the corner” on the card All realms. An instruction of the same day corrected this: the picture in the corner belongs to the hero of every realm, so the setting belongs to the window “Your hero” (the card of settings is described in the article on one window). The saved key avatar is the same, so there is no migration here either.

Rokgard had someone else's die in its corner

Colony and Lines had the die of Kastgard in the corner until then, because the application had a single avatar and nothing decided its appearance. The fix is in the data: the manifest of each realm says what its hero is (hero: { look: 'die' } for Kastgard, 'token' for Rokgard). The function paintCornerHero in js/ui/app.js reads that word and gives the avatar setForm(look, { color }) with the colour of the human seat. Neither app.js nor avatar.js names a realm or a shape, and a test checks it by reading the source without comments. A new realm registers itself with a word in its manifest, a row in the table Avatar.FORMS and a rule in style.css.

Die (die)Token (token)
RealmKastgardRokgard
PictureCSS cube, six faces with pips9 layers in preserve-3d
Resting posex −24°, y 32°x −22°, y 28°
Turning1 to 3 quarter turns about one axishalf a turn about the vertical axis, tilt up to ±12° from the resting one
Voicenarratornone

The pictures show both shapes at the same time and scale. The die turns in quarter turns about one axis; the token flips half a turn like a coin. The time is shortened: one turn takes 3.4 s in the game, and the colour of the token is a sample.

Die of Kastgard: quarter turns about one axis
Die (Kastgard): quarter turns about one axis
Token of Rokgard: half a turn like a coin
Token (Rokgard): half a turn like a coin

The token is a disc of nine layers (.slab) placed one behind another along the z axis: the two outer layers have the shine and the ring, the seven between them are the edge, which shows when the disc is tilted. The colour is the variable --token, and the token has the colour of the player in this game, not the colour from the profile.

The turning rules are the same for both shapes: a new tilt every 5.2 to 8.2 seconds (TURN_EVERY in js/ui/avatar.js), a transition of 3.4 seconds, the module's own seeded generator, no turning under prefers-reduced-motion, while the tab is hidden, during heavy board animation or when the avatar is folded. The token in the corner consists of two commits, a static one (footer feature) and a flipping one (footer fix), so that the animation can be reverted separately.

Rokgard has no voice. The modes of Colony and Lines have hud.narrator: false; the token is a picture. The setting “Avatar in the corner” turns it off too.

It turns at home too, by hand, and the helmets are a slider

The next request of 1 November (DESIGN §127) had five points: the Rokgard token on the screen Your hero cannot be turned by hand, the 21 helmets should be one row, the token in the panel and in the hub is static, and the setting of motion is missing. Here is the screen Your hero of that time (version 0.84, 1 November 2026): each realm has its own panel, Kastgard the die and Rokgard the token in the player's colour, which has no voice yet.

Screen Your hero of 1 November 2026 (version 0.84): the Kastgard panel with the die, the Rokgard panel with the token in the player's colour, the helmets in a row with arrows
Your hero on 1 November 2026, version 0.84: every realm has its own panel; Kastgard its die, Rokgard its token in the player's colour, which has no voice yet

Who turned what:

PlaceWhat turned itAfter the change
Corner of the game (die, token)the timer in Avatarunchanged
Home and hub of Kastgard (die)one avatar, which placeHero movesunchanged
Home and hub of Rokgard (token)nothing, a bare span.tokenavatar with the shared timer
Screen Your hero (die)only the hand, FaceView.cubeFaceView.turnable
Screen Your hero (token)nothing, a bare span.tokenFaceView.turnable

The die had two turning codes (the timer in Avatar and the hand in FaceView), and the token had three pictures. Now there is one token picture (Avatar.FORMS.token.make()), one turning by the timer and one turning by hand.

On the home screen and in the hub the application keeps one avatar per realm. The die is one avatar for the whole home screen, because it speaks: one bubble, one voice. The token does not speak, so a map by realm id is enough. The avatar moves from the panel to the hero block in the hub, like the die, and where a screen has no tile, it is removed together with its timer. The bare token tile is hidden while the avatar is shown; with “Avatar in the corner” off, it stays as before. A click is a “poke” (counted for a secret achievement) and does not open the hub. The panel of a realm is described in the article on the home screen.

Turning by hand on the screen Your hero is one function, FaceView.turnable: a drag with the mouse or a finger, the arrow keys, Home and a double click. The die and the token both keep their own pose while the page is open, and the token has a description for screen readers: “Your token. Drag it or use the arrow keys to turn it; Home returns it.”

Helmets. The screen shows 21 helmet shapes, one for every fifth point of reputation up to 100 (article on the helmet, DESIGN §118.2). They were in a grid (repeat(auto-fill, minmax(62px, 1fr))), and now they are one row, .hero-slider: a button, the list, a button. The list scrolls sideways and snaps to the centre (scroll-snap); the padding lets the first and the last helmet reach the centre too. The player's helmet is in the centre right after rendering, so it does not depend on the window width. It is only a picture: nothing is chosen and nothing is won. The buttons “Previous helmet” and “Next helmet” are disabled at the ends, the arrows move by one, and Home and End go to the ends. The touch drag and the wheel are done by the browser; the mouse drags the row, which settles on the nearest helmet after release. The steps glide only without prefers-reduced-motion. A trap: scroll-behavior: smooth also glides for scrollTo({ behavior: 'auto' }), so the first view asks for 'instant'.

The motion setting and the bug the proof showed

The setting Avatar motion (key avatarMotion, values turning and still, the default is turning) applies to the corner of the game, the die of the home screen and the tokens of tiles. The system setting for reduced motion takes precedence. The texts of both settings exist in all nine catalogues (DESIGN §127.3):

LanguageAvatar in the cornerAvatar motionRotating / Static
enAvatar in the cornerAvatar motionRotating / Static
skAvatar v rohuPohyb avataraRotujúci / Statický
csAvatar v rohuPohyb avataraRotující / Statický
srAvatar u ugluKretanje avataraOkreće se / Miruje
ruАватар в углуДвижение аватараВращается / Неподвижен
esAvatar en la esquinaMovimiento del avatarGira / Quieto
pt-brAvatar no cantoMovimento do avatarGira / Parado
frAvatar dans le coinMouvement de l’avatarTourne / Fixe
deAvatar in der EckeBewegung des AvatarsDreht sich / Ruhend

Two decisions from DESIGN §127.3 deserve attention. Still means that nothing moves by itself, including a click: a poke is still counted, but nothing turns. And the player's hand is not the motion of the avatar: the die and the token on the screen Your hero can be turned by hand even when the setting is Still. The game says this to the player: “The avatar stands still everywhere. You can still turn the die or the token by hand on the screen Your hero.”

A bug showed up in this setting. The new key in cfg was not written by the old code, so a series of proofs that compare the new code with the old one failed (DESIGN §127.4): fixtures of old settings, presets of Principalities, backups with the old mark, counts of the dictionary, and four tools that run the old and the new code side by side. It was enough to teach them that avatarMotion is “later” and is left out on both sides of the comparison (tools/_support/later-settings.js). One of the tools did not show a pin to move, but a real bug.

The fix is small: hashSnapshot in snapshot.js skips the settings in the list HASH_SKIPS = ['avatarMotion'], because a setting of appearance reproduces nothing from the game. The test makes an old snapshot (it deletes the key and recomputes the hash as the old build wrote it) and an old file, and checks that both are read with the original hash; a changed map size is still rejected. The cost is written in a comment: a change of avatarMotion in a snapshot is not caught by the hash. The rule for DESIGN that follows is: **a new setting of appearance changes the cfg of every game**, and anything that hashes the whole cfg must know it.

What was verified and what remains

The verification stamps of the tree in .git/verify-stamps (the state before the commit of the version) say:

Rename and token (→ 0.80.1)Motion of the avatar (→ 0.81.2)
Tests3,725, passed 3,724, 1 skipped3,735, passed 3,734, 1 skipped
Fingerprints of common games (baseline.js)all 188 matchall 188 match
Golden recordsbyte for byte the samebyte for byte the same
Migration tools14 in order14 in order
Texts per language (i18n.js --check)3,8313,839 (+8 keys)

The notes of the two sessions add: for the rename and the token, 18 mutations of the code and, after fixing the brief, 6 more; for the motion, another 18. Always one at a time on a copy of the tree, and all were caught. In the last batch 16 were caught at once and two survived until their tests were strengthened (one of them was the hash of the snapshot). From the live browser: when flipping, rotateY changed 28° → 208° → 388° → 568°; the slider had the helmet “from 30” in the centre; the “›” button moved it by one (7 → 8); the End key jumped to the 21st helmet, and a mouse drag of 260 px moved 21 → 18; Still stopped the token for 13 seconds, and Rotating set it turning again. At 375 px the slider was 219 px wide, with three helmets.

What remains:

  • The token does not speak. Rokgard has no narrator.
  • The bare token tile is hidden when the avatar is off. A new realm with a different shape of hero needs a row in Avatar.FORMS, a rule in CSS and its own picture on the tile.

Sources and notes

What could not be verified: the GIFs come from the CSS of the game rendered in a browser, not from the live game; the time is shortened, and the colour of the token is a sample. prefers-reduced-motion was not emulated in the live browser; the behaviour is proven by a test and a rule in the CSS. The touch drag of the slider was not tried by anybody. The texts in cs, sr, es, pt-br and fr passed a check of the catalogue, but no native speaker read them. The tests and the game were not run while the article was written; the counts come from the stamps and git grep.