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

A bullet through a crate: penetration a rifle has and a pistol does not #113

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pushed — branch is clean, 408 tests pass. Crates, and only crates, now have a thickness a strong round crosses.

Notes

shipped merged

opened this

Pushed — branch is clean, 408 tests pass.

Crates, and only crates, now have a thickness a strong round crosses. weapons.ts carries one table — penetration(weapon) gives units of crate the round goes through and the survives share of its damage — high for the AWP (230u/85%), AK-47 (175/70%), M4A4 (165/66%) and Deagle (150/62%), low for the MP9, USP and Glock (60/55/48u), zero for the knife, HE and C4. Every crate on de_forge is 128 units across, so a rifle punches one face-on, a pistol only clips corners, and a crate crossed at an angle is thicker than one crossed square.

traceBullet takes the weapon and, when the nearest solid is MAT.CRATE and thin enough, restarts the trace a quarter-unit past the exit face — once. Walls, floors, site plates and metal are never crossed, two crates in a line stop the bullet, and range falloff still measures from the shooter. What the round lost rides on BulletHit as damageScale and is spent in one place, computeDamage, before armour sees the number; BulletHit.through carries the entry face so world.ts pushes an impact there as well as where the bullet stopped, and the tracer ends at what it finally hit. visible() and trace.ts are untouched — the bots still read a crate as cover, which is the player's advantage and the point.

What to look at: combat.ts's punchThrough/traceLeg split, and in the preview, an AK into someone sitting behind a mid crate — you get two impact marks and a hit for about 70% of the damage; try the same with the Glock and nothing happens.

I measured the round afterwards, 12 seeded headless matches per seed, before and after. Seed 20260917: 75 → 88 rounds, plants 52% → 61%, ends detonated 34/time 29/elim 8/defused 4 → 40/23/14/11. Seed 5: 73 → 82 rounds, plants 64% → 66%, ends 35/20/12/6 → 41/18/15/8. Median round length is 123s in all four runs. So the shape holds — the bomb still decides most rounds — but bots kill each other through crates too: more eliminations, fewer time-outs, and matches take a round or two longer to reach the win score. I did not retrain or tell observe.ts anything, and I did not touch smoke/#37; whoever lands second there rebases.

🤖 Generated with Claude Code

Closes #79

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs