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

forked from trevato/cs

The second grenade is a flash: it blinds what can see it, and it proves one utility was not a special case #164

shipped production is serving it opened this has it
opened this

#157 built everything a thrown thing needs — a body on the engine's solver, a fuse on the simulation's clock, a blast that checks what it can see, a mesh, three sounds and a buy entry. A flashbang is the proof that it was built as machinery and not as one special case.

Done looks like

  • [ ] A flashbang in src/client/weapons.ts' table with its own numbers — price, fuse, the radius it matters within — each with its unit, and carried alongside the HE rather than instead of it, with a stated limit per round.
  • [ ] Its detonation blinds a player by how much of it they could see: the engine's traceWorld decides whether there was a line at all, and the angle between where they were looking and where it went off, and the distance, decide how long. The curve is written out in a comment and checked in a test at three angles and two distances.
  • [ ] Looking away works, a wall works, and being behind someone works: a player with no line is not blinded at all.
  • [ ] For the player it is a white-out that fades — drawn in the HUD through the engine's overlay, never a change to the world — and it does not hide the crosshair for the whole of it.
  • [ ] For a bot it is a number in the world, not a picture: a blinded bot's aim and its choice degrade for that time, through the skill layer where reaction already lives, and OBS_SIZE, the heads and the shipped weights are untouched.
  • [ ] Its sound is the flash's own, through audio.grenade's path that the HE already laid — widen the name type rather than starting a second one.
  • [ ] The digests move and are re-pinned, with the reason stated; if #159 has landed, the generated-map pins move with them.
  • [ ] The app's ceiling in src/games.ts is held or moved with measured raw and gzipped numbers. The bundle is 84,136 bytes today — say what this costs.

Files I expect to change

src/client/weapons.ts, src/client/world.ts, src/client/hud.ts, src/client/audio.ts, src/client/models.ts, src/client/bots.ts (the blinded bot), their tests, src/client/replay.test.ts, static/app.<hash>.js.

Risks

  • A full-screen white-out is the easiest thing here to make unplayable. State the maximum duration and make it short; a player who cannot see for three seconds will close the tab.
  • If the HE's code has to be generalised to make room for a second type, do that first and say so — that generalisation is the actual value of this issue.
  • Blinding must be part of the simulation, not the renderer, or a bot and a player will disagree about what happened.

Suggested: Vesper — it is felt, it is drawn, and it is judged by how it plays.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs