Wire the fall-damage rule the repository already wrote, so landing is part of the simulation instead of dead code with a passing test.
fallDamage at src/client/physics.ts:221 is exported, documented ("CS-style: nothing under ~580 u/s, then it bites") and asserted twice in physics.test.ts:129. Nothing calls it. move zeroes vel[2] the instant a floor is within two units (physics.ts:208-217) and world.ts never sees the speed the body landed at, so a player steps off anything, takes nothing, and the only evidence the rule exists is a unit test of an unused function.
One measurement to carry into the change: the tallest standable surface on either map is a crate top at 128 units (mapFor(...).boxes tops are 0, 2, 64, 128 and 384, and 384 is wall). A 128-unit drop lands at about 452 u/s, under the 580 threshold — so on today's two maps the rule correctly costs nothing, and wiring it is about the simulation being whole and any taller geometry getting it for free. Say that plainly rather than inventing a drop to justify it.
Done looks like:
[ ] move reports the speed the body hit the floor at (a field on Body, or its return), set only on the frame a fall ends and zero otherwise — no allocation, because the arena steps this millions of times.
[ ] world.ts turns that into damage on the landing tick through the paths damage already takes: ENVIRONMENT as the attacker (the precedent is the bomb at world.ts:1294), the round's ledger via recordDamage, and a death that reads as one in the feed.
[ ] Tests that fail without it: a fall of 128 units costs exactly nothing; a fall of 320 units costs the amount fallDamage states for its impact speed; the damage lands once per fall, not once per tick on the ground; a fall that kills credits ENVIRONMENT and shows up in damageTaken.
[ ] The person feels it: the existing hurt effect fires for their own fall damage, so the vignette and the pain sound they already have do the work — no new sound name (SoundName is being rewritten under #110) and no new effect kind.
[ ] README's What is real and what is not says the rule and says the honest part: no drop on de_forge or de_cinder reaches the threshold.
Files I expect to change: src/client/physics.ts, src/client/physics.test.ts, src/client/world.ts, src/client/world.test.ts, README.md.
Risks: the landing detection runs every tick, so the impact speed must be captured before vel[2] is cleared and cleared afterwards, or a player standing still takes a fall's damage forever — that is the test to write first. Bots share the code path; they do not jump off heights, and the maps cannot reach the threshold anyway, so the arena should be untouched. If the honest conclusion is that this rule should not exist, deleting fallDamage and its test is an acceptable answer — but say so in the pull; leaving it as it is, is not.
Wire the fall-damage rule the repository already wrote, so landing is part of the simulation instead of dead code with a passing test.
fallDamageatsrc/client/physics.ts:221is exported, documented ("CS-style: nothing under ~580 u/s, then it bites") and asserted twice inphysics.test.ts:129. Nothing calls it.movezeroesvel[2]the instant a floor is within two units (physics.ts:208-217) andworld.tsnever sees the speed the body landed at, so a player steps off anything, takes nothing, and the only evidence the rule exists is a unit test of an unused function.One measurement to carry into the change: the tallest standable surface on either map is a crate top at 128 units (
mapFor(...).boxestops are 0, 2, 64, 128 and 384, and 384 is wall). A 128-unit drop lands at about 452 u/s, under the 580 threshold — so on today's two maps the rule correctly costs nothing, and wiring it is about the simulation being whole and any taller geometry getting it for free. Say that plainly rather than inventing a drop to justify it.Done looks like:
movereports the speed the body hit the floor at (a field onBody, or its return), set only on the frame a fall ends and zero otherwise — no allocation, because the arena steps this millions of times.world.tsturns that into damage on the landing tick through the paths damage already takes:ENVIRONMENTas the attacker (the precedent is the bomb atworld.ts:1294), the round's ledger viarecordDamage, and a death that reads as one in the feed.fallDamagestates for its impact speed; the damage lands once per fall, not once per tick on the ground; a fall that kills creditsENVIRONMENTand shows up indamageTaken.hurteffect fires for their own fall damage, so the vignette and the pain sound they already have do the work — no new sound name (SoundNameis being rewritten under #110) and no new effect kind.de_forgeorde_cinderreaches the threshold.Files I expect to change:
src/client/physics.ts,src/client/physics.test.ts,src/client/world.ts,src/client/world.test.ts,README.md.Risks: the landing detection runs every tick, so the impact speed must be captured before
vel[2]is cleared and cleared afterwards, or a player standing still takes a fall's damage forever — that is the test to write first. Bots share the code path; they do not jump off heights, and the maps cannot reach the threshold anyway, so the arena should be untouched. If the honest conclusion is that this rule should not exist, deletingfallDamageand its test is an acceptable answer — but say so in the pull; leaving it as it is, is not.Suggested: scout.