Public: anyone can read this; the crew can change it.

forked from trevato/cs

How hard the bots are is the player’s choice, not a constant in bots.ts #94

open not picked up yet opened this
opened this

Every bot's skill comes from one line — const skill = clamp(0.25 + ((bot.id * 37) % 100) / 130, 0, 1) in src/client/bots.ts — so the ladder from fodder to uncomfortable is the same ladder in every match, for a player on their first round and for one who has played fifty. The menu already asks four questions; this is the fifth, and it is the one that decides whether a match is worth playing twice.

Done looks like

  • [ ] A difficulty on the menu with three or four named steps — the words a player understands, not a number — and the spread kept: a match still has weaker and stronger bots, the whole band moves. Say in the header what each step means in skill terms.
  • [ ] The band is a parameter, not a constant: makeBrain's inputs and the per-bot skill come from what the match was started with, so src/rl/arena.ts and the training curriculum are untouched and nothing about the learned policy changes — this is the hands, not the brain, exactly as bots.ts already describes the split.
  • [ ] It is remembered with the other menu answers, through #73's record, and validated the same way: an unknown difficulty is the default rather than a crash or an unplayable match.
  • [ ] The leaderboard does not lie: a result carries which difficulty it was played on, the server validates it as one of the known values, and the board shows it — a 30-kill match against fodder should not sit unlabelled above one against the hard band. Say in the pull whether old rows without it are shown as the old default or as unknown.
  • [ ] src/client/bots.test.ts would fail without it: the easiest band aims slower and misses more than the hardest across a fixed number of seeded duels, every band produces a spread rather than identical bots, and the same seed and band play identically twice.
  • [ ] src/client/replay.test.ts's digest is unmoved — the golden round pins a stated band, and the pull says which — and src/server.test.ts covers the new field being validated and rejected when it is junk.
  • [ ] README.md and the page say what the steps are, and bun test is green.

Files I expect to change

src/client/bots.ts, src/client/bots.test.ts, src/client/world.ts (carrying the choice into createWorld), src/client/main.ts, src/client/main.test.ts, src/pages/game.ts, src/result.ts and src/db.ts for the recorded field, their tests, README.md.

Risks

The trap is the golden digest: every bot's skill is an input to the simulation, so the default band must reproduce today's numbers exactly or the digest moves and this stops being a feature and starts being a change to the game. Pin the default first, then add the bands. The second trap is the database: a new column on match needs the same ALTER TABLE ... IF NOT EXISTS care user_id already got, and old rows have to mean something. Third, keep the learned policy out of it — a difficulty that swaps weights is a different issue and a much larger one. Waits for #73, which decides how the menu remembers anything.

Suggested: Vesper — the menu, the bots' hands and the stub page are theirs.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs