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

forked from trevato/cs

Take updates from trevato/cs #381

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

This merges trevato/cs `main` (0c4e051, staged at `refs/following/main`) in two commits. The merge commit (`044c9d4`) keeps this repository's tree for every conflicted file. A second commit ports #231, the one upstream change that #379 did not already take. `bun run test` passes (typecheck plus 1548 tests), and the app boots with `/` answering 200.

shipped production is serving it deploy ae07c2d

opened this

This merges trevato/cs main (0c4e051, staged at refs/following/main) in two commits. The merge commit (044c9d4) keeps this repository's tree for every conflicted file. A second commit ports #231, the one upstream change that #379 did not already take. bun run test passes (typecheck plus 1548 tests), and the app boots with / answering 200.

Per file:

  • This side won in README.md, src/client/{bots,hud,main,motion,report,weapons,world}.ts and their tests, src/db.ts, db.test.ts, src/pages/game.ts, game.test.ts and src/rl/arena.test.ts. Upstream's text in these files is from before the engine was pulled out, and this repo already has upstream's #188–#230 in its own form (#367, #371, #375, #379). README.md, bots.ts and bots.test.ts then get the #231 port below.
  • This side won in src/client/{bodies,earshot,input,physics,plan,renderer,settings}.ts, their tests and src/readme.test.ts: they stay deleted. Their work lives in src/engine/ (controls, renderer, physics) and in src/plan/.
  • Upstream's src/client/zoom.ts and zoom.test.ts stay out, and the auto-merged src/client/match.ts additions are dropped, as in #379. look.ts already handles scoped sensitivity, and this repo has no settings store for those additions to serve.
  • #231 (bots reload sensibly): ported into src/client/bots.ts.

- topUp: a bot with nobody in sight reloads a magazine at or under half (TOP_UP_SHARE). - outOfAmmo: a bot whose rifle runs dry mid-fight draws its sidearm if the sidearm is loaded. Otherwise it reloads, and this repo's walk to cover still goes with that reload. - Where this differs from upstream: both rules apply only to the learned brain. scriptedFight is unchanged, so the arena's baseline stays still, following this repo's rule that the baseline does not move. - README.md explains both rules next to the section on reloading behind cover. Upstream's measured plant rates were left out because they were measured on upstream's code, not this repo's.

  • Tests:

- bots.test.ts gets upstream's four tests, adjusted to this repo's standoff, plus two new ones: a dry rifle with an empty pistol still reloads, and the scripted baseline does not top up. The top-up and draw-the-sidearm tests fail on the pre-port bots.ts. - Test changed because its setup no longer produced the case it tests: src/client/cover.test.ts. Its bot now draws its loaded pistol instead of reloading, so the setup empties the pistol too. The reload under fire it checks still happens. - src/client/replay.test.ts: the ten-bot, smoke, switch and gen_o digests are re-pinned, because bot behaviour changed on purpose. The first thirteen seconds of the de_forge runs and the first eleven of gen_o hash as before; the duel and the tight generated match did not move. The history note at the top of that file says so.

To try it in the preview: play a round and watch a bot that has fired part of a magazine. It reloads once nobody is in view, not in the middle of the next fight.

Closes #380

🤖 Generated with Claude Code

Closes #380

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs