Audamir

part 47

Previews in the settings: music, the live picture and the numbers

The last preview step, music and the live picture, was added on 3 November 2026 (change log entry 0.102). It is described from a later state of the game, together with the numbers of the build, the traps and the mutants.

· 9 min read

The previous article on previews ended with step P5: the music and the live picture were waiting for a function that plays four bars, and decision D10 postponed them. The step was built on 3 November 2026 and is in the change log as version 0.102. This article describes it from a later state of the game, from 16 November 2026 (version 0.190.2). Where it matters when each part was added, the text says so.

The article also contains the numbers of the build (the registry, the estimate against the actual size), the traps and the mutants.

Why P5 waited

Step P5 is called "Music and the live picture" in the plan and is marked as optional (SETTINGS-PREVIEW §5): the ▶ Listen button for the three music settings (style, density, volume) and a sample picture for the live picture. It needs a function that plays four bars of the chosen style, and that did not exist in the game: grep -rn audition js found nothing (0 hits, 3 November 2026, on top of game 0.97.1). The estimate in the plan is 1 to 1.5 days.

Why it waited: decision D10 of 1 November postponed the music to P5, and the volume was allowed to use a tone. P5 therefore did not fail; it was postponed in advance. A peculiarity: not even the tone for the volume was built, although D10 allowed it; the volume waited together with the others. Four settings waited: livePicture, musicStyle, musicDensity, musicVolume. Of the original 10 live pictures and 7 demos, therefore, 9 and 4 are built.

Music: ▶ Listen

Music had three settings: style, density and volume. For those there was nothing to show except sound. Decision D10 of 1 November postponed them, because the function that plays four bars was missing. Meanwhile the volume was allowed to use a tone. No tone was built for the volume: the volume plays the same live music as the other two settings.

The ▶ Listen button belongs to all three rows and plays four bars of the live music in the chosen style, density and volume. The demo is the same live music that the game would play under the effects, that is, quieter than the music bed itself, and not a tone or the piece after the game. The density row shows the number of notes, and the volume row the gain in decibels against the usual volume.

How ▶ Listen works for the musicThe Listen button belongs to all three music settings; the sound starts only on a click, plays four bars of live music at the volume of the live music, and ends by the rules.Settingstyle, density, volumeThe Listen button belongs to allthree rows of the music.Listenon a click onlyThe sound never starts by itself.Without sound the button is off.Four barsMusicLive.auditionLive music of the chosen style,density and volume, no game.VoicesynthesizerLoud as under the effects,follows the slider, never louder.Endfour waysBars played out, Stop, a new styleor density, or closing the window.
How ▶ Listen works: the sound starts only on a click and plays four bars of the live music in the chosen style and volume

The sound never starts on its own, only on a click. It plays until the bars have run out. It stops with the Stop button; when the style or the density changes (a new piece is a new click); when the game's sound or its live music takes over the sound; when the panel switches to a row without a sample; and when the window is closed. The volume is tracked while it plays, so the slider is the way to find the right level. The button is disabled and says why when sound is not possible: sound turned off in the settings, the game's music playing (the demo would sound over it), or a browser without sound.

Appearance & controls window, row Music style: in the PREVIEW panel the Listen button, 32 notes, 4 bars, 79 BPM
Game state 16 Nov 2026, version 0.190.2: the Appearance & controls window, the Music style row with the Listen button

This is verified by tests on a fake audio context: what gets scheduled, what the volume is and when the demo ends are all followed. Sound in a real browser was not verified in this article.

Live picture

The Live picture row shows a sample game: a recording of 740 bytes in which three seats play seven rounds on a small map and the player wins. The recording is played back by the same collector that draws the live picture in the game, and the picture grows round by round. With the switch on, the picture grows about half a second per round. The Show button lets the picture grow again. With the switch off the scene is empty, and it says so. With reduced motion set in the system, the picture is complete straight away.

The game's documentation gives 600 bytes. The code has 740 bytes, and the code is what counts. The picture is not the dots picture from the mockup. It is the live picture's own mechanism, so the preview and the game draw with the same code.

How the sample of the live picture growsThe sample record (740 bytes) is played back by the same collector as the live picture of the game and drawn round by round; with the switch off the stage stays empty and says so.Sample record740 bytesThree seats, seven rounds, a small map,won by the player; nothing is drawn.Replaythe collectorPlayed back by the same collectoras the live picture in the game.Painterlive picturePrimitives are added round by round,the camera glides on.Ongrows round by roundAbout half a second a round.Off: an empty stage with a text.Showgrows againShow grows it again; reduced motionshows it finished at once.
How the live picture demo grows: the 740-byte recording is played back by the same collector as in the game
Appearance & controls window, row Live picture On: in the PREVIEW panel the finished picture and the Show button
Game state 16 Nov 2026, version 0.190.2: the Live picture row switched on, the finished demo picture and the Show button

Registry: how many values have a line

Two things were counted under "rows of the registry": the decisions in the registry (the rows of Settings.PREVIEWS) and the values with a line under the panel. A value has a line if Settings.captionOf is not empty. The slider is one value; Player colour has 14 values and Language 10.

StateSettingsDecisions in the registryDrawn"None"WaitingValues with a line
before the first step (game 0.80.1)23000050 of 88
P12323441555 of 88
P22424941175 of 90
P32424134787 of 90
P42424164487 of 90
P6 (state of 3 Nov, before P5)2424164488 of 90

"Drawn" is a decision with a scene and no step; "waiting" is a decision with a step. The row P1 is the commit of the step before the merge with 0.81.2; in version 0.82.2 the registry had 24 decisions after the merge. At the start the registry did not exist. After P6, 22 of the 24 settings had a line, and only the two values from P5 were missing: "Live picture: Off" and "Music density: Normal". They got their captions in P5.

Settings values with a line under the panel, step by stepShare of the setting values that have a line under the panel: before the first step 50 of 88, after P1 55 of 88, after P2 75 of 90, after P3 87 of 90, after P4 87 of 90, after P6 88 of 90.before the first step50 of 88P155 of 88P275 of 90P387 of 90P487 of 90P6 (today)88 of 90share of the values with a line under the panel (100% = all values)
Values of the settings with a line under the panel after steps P1 to P6; state of 3 Nov 2026

Per setting, before the first step 8 of 23 settings had a line for every value (6 explaining every value, and 2 with a hint: Language and Music volume), and 7 had no text at all; this agrees with draft No. 39 (7 without text, 2 with a hint, 6 with all). Of the 38 values without a line at the start (88 − 50), 36 got one and 2 remain (my own calculation). Two values of the new Avatar movement had one at once. Behind this are 14 written captions: 13 from appendix A of the analysis and "Live music: Off" from P6. Seven captions are for a whole setting and cover 29 values (Player colour 14, Speed 4, Sound 2, Theme 3, Show numbers 2, Palette 2, Avatar in the corner 2), and seven for one value (7 + 29 = 36). A one-off script over the js/ trees from git archive counted it.

What it cost compared with the estimate

The estimate is from SETTINGS-PREVIEW §3.4 and §3.6; the actual is the wc over the game's tree at version 0.97.1, that is before the music and the live picture. The sums are my own calculation.

FileEstimate (lines)Actual (lines)Bytes
js/ui/settings-preview.js22030221,130
js/ui/preview-board.js70975,831
js/realms/kastgard/ui/previews.js9032121,769
js/realms/rokgard/ui/previews.js40935,988
total42081354,718
Preview files: the estimate and the reality in linesEstimated and actual lines of the four preview files: settings-preview.js 220 and 302, preview-board.js 70 and 97, the previews of Kastgard 90 and 321, the previews of Rokgard 40 and 93. In all 420 and 813.050100150200250300350220302settings-preview7097preview-board90321Kastgard previews4093Rokgard previewsestimateactual
Preview files: the estimate from the plan and the actual number of lines at state 0.97.1

The actual size is 1.94 times the estimate by lines and about 2.7 times the estimated "about 20 KB" by bytes. The Kastgard file grew the most, from 74 lines in the first step to 321 (P3 added 191 lines, P4 54). The estimate came from the mockup; the document does not say where it went wrong. CSS: estimated 60 lines, actual 91 added. Texts: estimated 29 keys, actual 31 keys and 279 strings in nine languages. Two test files were estimated; there are four, with 53 tests. ConfigPane stayed as it was: js/ui/config-pane.js has 53 lines and did not change from the state before the first step.

Traps from building the steps

  • A composed text key does not pass the key test. The fragment guard rejects a key built from a variable (the name of the mode inside the key), so the three fight labels are three literal keys. Likewise the gender sentence had to be a literal key.
  • A key that only a realm file reads is moved into the realm's catalogue. The guard then reports an error. The keys of the Kastgard previews are written straight under kastgard.previews.
  • Chapter numbers in the documentation collide. Steps P3 to P6 carried chapters 136 to 138, but during the work another chapter took those numbers, and at the merge they were renumbered to 137 to 139.

Mutants and tests

The tests of steps P3 to P6 were attacked with 84 mutants: a copy of the tree, one change at a time, and only the tests of this part. The first run left 9 mutants alive. Four were holes in the tests: a demo that would change a territory was never looked for; the warning was never tried without a remaining attack; a 60% chance was never tried; Hud.showRoll was never measured for time. After pins and further tests, 83 are caught and one is equivalent. Mutants measure the quality of the tests, not the correctness of the demos. The first full verification found one more thing: the prefix of the previews texts was among the places that the gender lint does not read.

Step P5 has its own tests: the recording of the demo is pinned by a test (it plays, and it is what the recipe produces), and the sound is tested on a fake audio context.

What I take from it

  • Sound must not start on its own. The button is the only way the demo sounds, and a test pins it.
  • A picture from the game's own mechanism is better than an imitation. The preview and the game draw with the same code, so they cannot disagree.
  • "It exists" and "it is true" are two tests. The claim "every value has a line" found a value that the decisions had not found.
  • Mutants show the holes in tests. Of 84, nine survived the first run, and four were real gaps.
  • The estimate from the mockup was a little more than half of the actual size (420 of 813 lines, my own calculation).

Sources and notes

  • Game documents: docs/SETTINGS-PREVIEW.md (step P5 in the plan and in the state), docs/DESIGN.md §144 for P5.
  • Change log: entry 0.102 (3 Nov 2026) with the Listen button and the sample game of the live picture.
  • Code: the scenes listen and picture (previews-music.js, previews-picture.js), audition.js; the recording of the demo has 740 bytes.
  • Screenshots of the game from 16 Nov 2026, version 0.190.2. Other numbers are from state 0.97.1 unless stated otherwise.
  • Related articles: Previews in the settings: what a preview is and how it was built, Previews in the settings.