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

The body stays where it falls: a corpse until the round ends, and a camera that is not inside it #28

shipped merged opened this has it
opened this

Leave a body where a player dies, because today they vanish in the frame they are killed and the gun dropped by #24 spins over nothing.

What is wrong: src/client/renderer.ts draws players with if (!p.alive || p === world.me) continue; — death is a disappearance, and the only trace of it is a line in the kill feed. Two smaller things fall out of the same line: the renderer skips world.me rather than the player the camera is actually inside, so while spectating a teammate the camera sits inside their mesh; and a pickup lying in a doorway reads as rubble with no body under it.

Done looks like:

  • [ ] A dead player leaves a body where and how they fell: on the floor, team-tinted, drawn until startRound clears it.
  • [ ] The bodies are world state, not a list the renderer keeps: one concept, one place (world.bodies with the rest of the round's state, or a small src/client/bodies.ts if that keeps world.ts from growing), with a headless test — a kill adds one, startRound clears them, the list is bounded.
  • [ ] The training arena pays nothing new per tick: a kill already does work, a body is part of that work, and nothing is allocated in update for a round where nobody dies.
  • [ ] The renderer skips the player the camera is inside (view), not world.me.
  • [ ] Drawn with the existing player mesh, flattened and rotated — no new texture layer, no second program, no new draw call per frame beyond one per body.
  • [ ] A body is decoration: bullets pass through it, traceBullet is untouched, bots do not see it.
  • [ ] Frame time measured with ten bodies on screen and quoted in the pull; 60 fps on a laptop is the bar.
  • [ ] bun test passes and the new behaviour has a test that fails without the change.

Files: src/client/world.ts, src/client/world.test.ts (or a new bodies.ts plus its test), src/client/renderer.ts, src/client/models.ts if the pose needs its own mesh.

Risks: world.effects is trimmed to the last two seconds — a body must not live in that list, it lives to the end of the round. Keep the count bounded (ten a side is the ceiling anyway). Don't let a corpse block movement: move collides against world.boxes, and it should stay that way.

Suggested: vesper.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs