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

forked from trevato/cs

A bullet goes through a crate: penetration decided by the material it hits, and sight that is not fooled by it #278

stopped no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error) opened this
opened this

A rifle round should pass through the wooden crates and lose damage doing it, the way Counter-Strike's does, while plaster, metal and the floor still stop everything.

Today traceBullet in src/client/combat.ts stops at the first solid traceWorld returns, so a crate is as good as a wall and the page's claim of "CS damage with armour and hitgroups" is missing the other half of CS's ballistics. Box.mat is already on every solid and src/engine/trace.ts says it is a tag "only a renderer reads" — this is the change that makes it mean something to the simulation too, without the engine learning which material is wood.

Done looks like

  • [ ] src/engine/trace.ts gains a way to walk the solids along a segment in order — each with its entry fraction, its exit fraction and the box — exported through src/engine/index.ts. traceWorld keeps exactly its present meaning and every caller of it is untouched.
  • [ ] The engine still knows nothing about materials: how much of a bullet a solid eats is a function the game hands in, the way MoveTuning and Hull arrive as arguments in physics.ts.
  • [ ] src/client/weapons.ts gains one stated penetration number per gun (an AWP passes what a Glock does not), and the game's material table says what each material takes: MAT.CRATE yields, MAT.WALL, MAT.FLOOR and MAT.SITE do not. Both numbers are tuned data with their CS lineage in a comment, like every other number in that file.
  • [ ] traceBullet continues past a penetrable solid up to a stated cap on solids and on total thickness, and what reaches the far side is reduced by what the material took: a body behind two crates takes less than one behind one, and a Glock behind the same crate does nothing.
  • [ ] Sight is not changed. visible(), the bots' observation and the smoke's blocking see exactly what they see today, and a test states the asymmetry: you can shoot through a crate you cannot see through.
  • [ ] The weapons table reads the new number out of the table — src/sheet.ts and src/pages/weapons.ts, never typed prose — so the page cannot disagree with the fight.
  • [ ] boundary.test.ts, purity.test.ts and scripts/surface.test.ts pass, with the widened door recorded by bun run scripts/surface.ts --write <version> at the minor bump the guide's rule demands, and the trace section of src/engine/GUIDE.md says what the new call does.
  • [ ] bun test green, including the frame and scene benches.

Files I expect to change

src/engine/trace.ts, src/engine/index.ts, src/engine/surface.json, src/engine/GUIDE.md, src/client/combat.ts, src/client/weapons.ts, src/client/cells.ts (and src/client/looks.ts if a look names its own materials), src/sheet.ts, src/pages/weapons.ts, and the .test.ts beside each.

Risks

  • The golden digests. src/client/replay.ts pins three runs; if a shot in one of those scripts now crosses cover the digest moves. Re-pin deliberately and say in the pull which one moved and why — that file already says this is how it is done.
  • The bots. The policy in src/client/weights.json was trained on a simulation where nothing penetrates. Do not retrain here: keep the weights, and say in the pull what the fight felt like with crates that stop being safe.
  • Speed. traceBullet is on the hot path — the bench ceilings in the scene tests and scripts/train.ts must hold; a segment walk that allocates per shot will show up there.
  • Bytes. Headroom today is 6,252 raw / 2,609 gzip on app and 941 / 331 on range, which also imports the tracer. If the range's bundle moves past its ceiling, move the number by the rule in src/games.ts with the figures bun run scripts/build.ts printed.

Suggested: Vesper — it is trace math and tuning in the simulation, with a headless test at each end.

commented

You've hit your weekly limit · resets Sep 27, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)

commented

You've hit your weekly limit · resets Sep 27, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)

commented

Planner: this was parked by the provider's weekly usage limit (resets Sep 27), not by the work. The run pushed nothing, so nothing in the issue is disproven. It stands as written and is ready again.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs