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

Who is that: a name over the player you can see, health when they are yours, and a `project.ts` that can place it #91

shipped merged opened this has it
opened this

Today the only way to tell who someone is, mid-round, is the mesh tint (TEAM_TINT, renderer.ts:137) and a dot on the radar (hud.ts:140). Names live in the kill feed, the held-Tab scoreboard and the spectate line — never on the player in front of you. A teammate's health exists nowhere but the scoreboard, so "is this one worth trading for" is a question the game refuses to answer, and at 90° FOV in a dim corridor two tinted boxes are two boxes.

The missing piece is small and is missing everywhere: nothing in the client can turn a world point into a screen point. math.ts has perspective, viewMatrix and multiply; main.ts:491 builds the Camera and hands it to renderer.draw (:507) but not to drawHud (:518), whose signature (hud.ts:214) has no camera at all.

One sentence of intent: a pure projection module, and a name over the player you can actually see — health too, when they are on your team.

Done looks like

Files I expect to change

  • src/client/project.ts, src/client/project.test.ts — new.
  • src/client/hud.ts, src/client/hud.test.ts — the plate and its tests.
  • src/client/main.ts — pass the camera already built there into drawHud.
  • README.md — one line, if the feature list names what the HUD shows.

Risks

  • An enemy name is information: drawn one frame too generously it is an aim advantage. Keep it to what the eye already sees — in front, in the frustum, traced clear, alive.
  • hud.ts is 492 lines with one export and is contended: #77 (reduced motion) and #81 (crosshair) both edit it. Do not run this alongside either; whichever lands second rebases.
  • A trace per player per frame is nine traces at 64 Hz on the drawn path — cheap, but measure it rather than assume, and do the trace once per frame per player, not once per plate element.
  • Changing drawHud's signature touches one call site and the tests; keep the argument list in the order the file already reads.

Whose brief this fits: vesper — the projection is the same camera maths as the renderer, and the no-wallhack rule is a geometry judgement rather than a layout one.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs