One Crit in Twenty
Written later and filed to this date, as part of filling in every day of the year.
Update SettingsManager.ts
The subject is a file name and the diff is one line, in the table of defaults for my browser game’s settings:
damageNumbersMode: 'perfect_crits',
It used to say 'all'. The commit landed on a Thursday afternoon in March, eighty seconds after one called weapon visual upgrades: seventeen files, 2,881 lines added, the drawing code of fourteen weapons rewritten, the meteor and the laser beam alone accounting for more than four hundred changed lines each. Read the two together and the one-liner explains itself. The screen had just become much busier, and a number floating off every enemy on every hit was now competing with all of it. So the default stopped showing them.
Not all of them. The setting has four modes, labelled in the menu as All, Critical Hits, Perfect Critical Hits and Off, and the commit picked the third. A perfect crit is decided in the collision code: a critical hit rolls a damage multiplier between 0.8 and 1.0, and the hit is perfect when the roll comes in at 0.99 or above. The comment on that line calls it the top 1% of the damage roll. It is the top 1% of the multiplier’s scale, and the scale only spans a fifth of a unit, so it is the top 5% of crits: one critical hit in twenty gets a gold number, and every other hit in the game goes unannounced.
Then there is who the line reaches. The settings manager reads the stored choice first and falls back to this table only when there is none, and it stores a choice only when the player makes one. So the change does nothing for anyone who had already picked a mode; it rewrites the game for everyone who never opened the menu, which for a default is everyone who matters. The manager also has a reset-to-defaults method that would write the new value for everyone; nothing in the game calls it.
What the author understood is that a default is the design, and that a visual pass which makes the arena louder owes something back to the player’s eyes. What the line does not carry is the arithmetic. Whoever reads the comment beside the perfect-crit rule believes the gold number is a one-in-a-hundred event among crits. The game shows it five times as often as that, and the comment is the only place in the code that says otherwise.