Split The code is public; the app answers only to the crew.

90° of view, take it or leave it: no field-of-view setting, and a phone sees the least of the map #210

open told opened this
opened this

Give the person a field of view they choose, remembered like sensitivity, without letting it change how fast the mouse turns.

HIP_FOV = 90 in src/client/zoom.ts:16 is a constant, and fovFor(weapon, scoped) returns it for everything that is not a scope. The camera already takes fov as data (renderer.ts:138, project.ts:41), so the plumbing exists and only the choice is missing. It matters most where the screen is smallest: a phone held in landscape at 360 px shows the same 90° as a 27-inch monitor, and a player who wants the wider view every CS player runs cannot have it.

The trap is sensitivity. #198 made the scope's mouse speed follow screenShare(fov) — turning slower when the view is tighter. A chosen hip FOV must not ride that curve, or every existing sensitivity in the world silently changes the day this ships.

Done looks like

  • [ ] A validated fov in src/client/settings.ts — integer, clamped 70–110, default 90, anything else falling back to the default — remembered exactly like sensitivity and touchSensitivity, with a test for the out-of-range, non-numeric and missing cases.
  • [ ] A control in the pause overlay and the menu, kept in step the way sensitivity already is, at least 44 px on a side and reachable from the keyboard, showing the number it is set to.
  • [ ] fovFor takes the chosen hip FOV; a scope still returns the weapon's zoom, so an AWP at 40° is 40° whatever the hip is set to. A test covers both.
  • [ ] Hip sensitivity is untouched by the setting: a test asserts the mouse-to-degrees factor at fov 70 and at fov 110 is identical, and that the scoped ratio still follows screenShare off the weapon's zoom and not off the hip choice.
  • [ ] The HUD is unaffected: the crosshair's spread arms are degrees on screen, so whatever converts them honours the camera's fov — a test at two fovs, or a comment saying why it cannot drift.
  • [ ] Nothing in the simulation reads it: observe.ts, the bots and saved.ts are untouched, so a resumed match and the arena see exactly what they see today.
  • [ ] bun run check green, with tests that fail without the change.

Files I expect to change

  • src/client/settings.ts, src/client/zoom.ts, src/client/main.ts, src/pages/game.ts.
  • src/client/settings.test.ts, src/client/zoom.test.ts (or wherever fovFor is covered), src/pages/game.test.ts.
  • README.md — Playing.

Risks

  • A wide FOV draws more of the level: check the frame does not blow past what #196 is about to budget, and say in the pull what 110° costs against 90°.
  • The viewmodel is drawn on its own projection (renderer.ts); deciding whether the gun scales with the chosen FOV is a judgement — make one, say which, and keep it stable rather than letting the gun swim.
  • #191 adds a touch-sensitivity control to the same overlay; these two collide in the markup only, so take them in either order but expect one to rebase.

Crew

vesper — the camera, the input curve and the overlay.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs