Audamir

part 43

Two renamings in one day

The mode id classic became principalities, the prefix diceWars became audamir. The first word was a value in the data, the second an address of the data, so they were handled differently. What was read and written, how it was verified, what was not.

· 12 min read

On 2 November 2026 two renamings reached the development version of the game Audamir. The id of the mode Principalities (Slovak "Kniežatstvá") changed from classic to principalities (version 0.90.5). Then the prefix of all storage keys changed from diceWars to audamir, together with the names of the files the game saves (0.92, patch 3 in the change log). The game is only in its development form, at the time of writing in version 0.97.1; I claim nothing about deployment to players.

Both renamings look the same: an old word is replaced by a new one. What matters is what the old word was in the game. **classic was a value in the data: it stands in the profile, the history of games, the score table and the saved game, so a reader without a mapping does not know which mode the data belong to. diceWars was an address of the data**: diceWars.profile is the name of the key under which the browser holds the whole profile. Whoever does not find the new key finds nothing. A value can be mapped on reading; an address has to be moved without losing anything. That is why they were handled differently.

The numbers come from the documents of the game, from git log and from the verification stamps; what could not be verified is at the end.

The names that meet here

The table is a glossary for the whole blog. Old articles keep the old name as a record of their time; new ones write the new name and the old one in brackets.

Old nameNew nameWhen
Classic, id classicPrincipalities, id principalitiesdisplayed name 31 Oct 2026, id and file names 2 Nov 2026
Auda WarsAudamirname of the game 31 Oct 2026, storage keys 2 Nov 2026
diceWars.* (storage keys)audamir.*2 Nov 2026
Hero DiceAvatar1 Nov 2026

The background of the name of the game is in the article What the game is called: from Dice Wars - Forever to Auda Wars.

Two words, two roles

Principalities received the new displayed name on 31 October, but the id classic and all the stored data stayed. On 2 November that stopped being enough. Tribes arrived, a faithful copy of the original (see Tribes: a copy that can be measured), and the sentences of Principalities about "the original game Dice Wars" stopped being true. Then the request was that the word classic should remain nowhere, and that diceWars should be called audamir like the project.

classic → principalitiesdiceWars → audamir
what the old word wasa value: the mode id in the profile, the history, the score and the saved gamean address: the prefix of localStorage keys and of Web Lock names
if the new code does not know ithistory rows are discarded, the mode statistic is zerothe profile is read as empty
what was doneboth spellings are read, the new one is writtenthe data are moved: copy, read back, compare, only then delete the old one

Inventory: what must be found before anything is renamed

The word classic was mentioned by 309 tracked files in game version 0.86.0. Storage is the part that can hurt. A tool played out a player with the real functions and found 15 places: the mode statistic, the history rows, 39 achievement steps, the score table and the name of the key of a game in progress. The document also lists 16 silent traps, where nothing is reported:

  • a history row with an unknown mode is discarded, so up to 1,500 games of history disappear,
  • the statistic of an unknown mode is read as zero,
  • an unknown id of achievement steps: 39 steps are locked, they are earned and paid out again.

For Audamir there are 21 traps and 15 places (K1 to K15). Two of them are striking. The key diceWars.save.classic carries both old names at once: the prefix and the mode id. And diceWars.profile.unreadable is the only copy of a profile that could not be read; nothing reads it, so without a move it would stay under a name nobody looks for.

The language is read before the storage: I18n reads the settings when the first script loads, before Store, so a move would come too late, and it therefore reads both names itself.

A tool that tells a comment from a string from code

The word classic is in the code in too many places and in too many roles for a plain search and replace. tools/rename-ids.js has a small lexer of JavaScript, so it knows whether the same letters stand in a comment, in a string or in code. Of 4,675 occurrences in 266 files, two thirds are ids, that is values in the data.

Where the word classic stood: occurrences by classOccurrences of the word classic in 266 files before the rewrite, by the class determined by the tool rename-ids.js: id as data 3,053, identifier in code 585, word in prose 584, text files 209, deliberately kept 115, text key 75, file path 31, page element 23. Total 4,675.id (value in data)3,053identifier in code585word in prose584text files209deliberately kept115text key75file path31page element23occurrences in 266 files, total 4,675 (game 0.87.2, 2 Nov 2026)
Occurrences of the word classic in 266 files before the rewrite, by the class determined by the tool rename-ids.js (game 0.87.2, CLASSIC-RENAME). Two thirds are ids, that is values in the data; those were the concern of the first of the two kinds of renaming.

There were 45 unclear places. A typical one is a property written in shorthand, { coins, classic }: it is both a variable and a key. A row of the map decides it: the variable is renamed, the key stays as the id, and the notation is written out in full (classic: principalities).

The tool for Audamir (tools/audamir-rename.js) needs no lexer: the old spellings are prefixes and stems, never identifiers. The id that a file carries is never written by a machine: the old id must still be read, and someone must add it to the list of old ones.

Principalities: read both, write one

The renaming of the id went in layers, and each layer is a separate group of commits that can be reverted alone. First all readers read both spellings, and only then is the new id written. That makes the turn one constant (LegacyIds.MODE_CANON), and it can be turned back without loss.

Each reader had a trap. Three of them:

  • The order of achievements. The migrations of an old revision speak about classic-untouchable-N, so the renaming of the steps must run after them.
  • The hash of the snapshot also covers meta.mode, so an old snapshot is accepted by an alternative hash with the original spelling.
  • The file name of a record contains the mode. Within one day it had two new names. According to the document, this is the only change a player sees in Principalities.

Audamir: moving the data

The move is deliberately careful. For each old key that exists:

  1. Its text is read.
  2. If the new key does not exist, the same text is written, read back and compared. If the write fails (full storage, refusal), the copies of this run are taken back, nothing is deleted, and the session goes on under the old names. The next start tries again.
  3. If the new key already exists: the same text, the old one disappears; a different text, both stay, the new one is used, and the old one is neither read, changed nor deleted, because a tab of the old build may have written to it.
  4. Only when all copies are verified are the old keys removed.

The move had to run earlier than the plan expected: Store.migrateKeys() runs as the very first thing in App, because app.js reads the settings and the profile already when the script loads. A fresh old lock is a signal too: a tab of the old build that plays a game counts as "somebody else", so the new tab does not take it over by mistake.

Proofs with data of the old code

The data are not made by a human by hand. The old code makes them and the new code reads them. Both proofs (principalities-migration.js and audamir-migration.js) have the same shape: the old tree from git archive plays out a player with the real functions, and the new tree reads what came into being. In both, the result matched what the plan promised.

A proof is checked with mutations: a deliberately broken reader or move. For Audamir this showed a weakness in the proof itself. A storage that refuses already the first new key does not reveal a move that deletes too early. Two mutations survived until the storage was full from the third new key.

Things unrelated to the renaming also had to stay bit for bit the same. The stamp of three trees confirms it: 196 fingerprints of the AI baseline match, and 12 golden records and 3 golden maps are the same byte for byte apart from the mode id (the golden files keep the old id, because they are old data). The stamp also compares test names: at the tree after the renaming of the mode id, 82 names from the base are gone and 109 are new, and all 82 "lost" ones contain the word Classic. So renaming a word changes test names too, and the comparison has to know it.

The decision: everything now

The Principalities plan originally counted on a more cautious path: the three portable formats (the record file, the #R= link and the snapshot file) would be written with the old id for 14 days, because someone other than me might hold the data. On 2 November I decided: change everything now, so that I do not return to it.

For Audamir the same holds: the old names are read forever and written by nobody, with no deadline. The folder of the game was renamed the same day, because no sessions were running.

The cost is written in the documents: going back to an older build is not supported. A backup from the new build loses the Principalities statistics in the old one, and after the first start of the new build the keys live under audamir., which the old build does not read. So before the first start a backup should be made that contains no key names and can be imported into every build.

The order with respect to Tribes: the rewrites waited for the merge of the work on Tribes, which had 56 changed files and the word in every one. For Audamir the order was the opposite of the plan, because the main session gave consent earlier.

Where it almost went wrong

  • The rewrite made nonsense of sentences. The word was replaced also in sentences that talked about the old name: the glossary row "Principalities (was Classic)" became "Principalities (was Principalities)", and a test was called "Principalities is Principalities". Fixed in R3.
  • The proof collided with Tribes. When four chains of Tribes achievements arrived, the new code had eight ids that the old code cannot have, and the check failed. The first fix did not solve it; a second whole run of verify.js found the rest.
  • Trials on a copy caught more than expected. For Principalities 14 of 534 tests failed on the copy. For Audamir 11 of 3,989 tests failed on the real tree after the rewrite. All were fixed.

What could not be verified

What is decided

Decided by me: the whole scope at once, the id principalities, no transition period, the slot is renamed, the prefix audamir., the extension .amr.json. Decided: the shape of identifiers, the limit of 20 characters in the score table, the hash of the box under the old spelling, and the order of the page before the game.

What I take from it

  • First ask whether the word is a value or an address. A value is mapped on reading; an address is moved, and with it an empty profile threatens.
  • Readers before writing. A layer where everything reads both spellings makes the turn a single constant.
  • A move has an order. Copy, read back, compare, only then delete; on failure delete nothing.
  • A proof is checked with mutations. Even a sharp proof had a weakness that surviving mutations showed.

Sources and notes