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

A 64-unit crate is 7 units too tall to jump onto: nothing on either map can be climbed, and crouch-jumping does nothing #234

Merged opened this

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

Merged

A crouch-jump now lands on a 64-unit crate, and a plain jump still doesn't. When a body in the air ducks, the hull shrinks from the feet instead of the head. The head stays where it was and the feet rise the 18 units the hull gives up, so the feet clear 75 units against a plain jump's 57. `bun run check` passes (types plus 845 tests), and the app boots and `/` answers 200.

shipped merged

opened this

A crouch-jump now lands on a 64-unit crate, and a plain jump still doesn't. When a body in the air ducks, the hull shrinks from the feet instead of the head. The head stays where it was and the feet rise the 18 units the hull gives up, so the feet clear 75 units against a plain jump's 57. bun run check passes (types plus 845 tests), and the app boots and / answers 200.

src/client/physics.ts: the change is one named function, legLift, with a comment saying it is the legs and not the gravity. On the ground it returns 0, so ducking on a floor behaves exactly as before. MOVE.jumpVelocity and gravity are untouched, so standing jump height, fall speeds, strafe-jumping and the 128-unit tops don't change.

  • Ducking in the air can never clip, because the smaller hull sits inside the bigger one.
  • Standing up in the air pushes the legs back down, and uses the same stuck refusal as standing up under a low ceiling. So a ducked body falling onto a floor lands ducked instead of stretching its legs through the floor.

Hitboxes and rendering: nothing needed changing. The hitboxes in combat.ts, the renderer's body squash, the HUD name plate, bodyCentre and eye height all measure up from p.pos with the same duck blend, so they lift with the feet and still agree about where a ducked player is.

Tests:

  • physics.test.ts:

- A crouch-jump through the real move ends with onGround and pos[2] === 64. - The same run without duck ends on the floor, short of the crate. - Ducked and plain jumps have the same vertical speed and the same peak head height. - Ducking on the ground leaves the feet at 0. - A crouch-jump into a 72-unit slot is never inside a box on any tick, including after letting go of duck. - Standing up in the air just above a floor is refused until landing.

  • combat.test.ts: a crouch-jumper's head hitbox matches the top of the physics hull. A shot just under that height is a headshot; a shot where a crouched head on the floor would be passes under the tucked feet.

Bots: they never jump, so none of their movement changes. What did change is findPath (map.ts): a goal on a crate cell used to get an empty path and the bot stood still. It now gets a path to the nearest floor cell beside the crate. That case becomes possible once a person can reach a crate top, for example a bomb dropped there by someone who died up there. A new test in map.test.ts checks every crate on both maps. The README says a crate top is somewhere a bot won't follow you.

Left alone:

  • A bomb on a crate top is still out of reach for a bot: pickup and defuse use full 3D distance, and a bot beside the crate is too far away. I left pickup and defuse ranges as they are rather than widen them in this change. Planting on a crate can't happen, because crate cells are never site cells.
  • A crouched player's eyes (46 of 54 units) are a little below the head hitbox (which starts at 88% of hull height). That was already the case before this change.

To try it: in the preview, run at a waist-high crate, jump, then hold <kbd>Ctrl</kbd> while in the air. Do the same without <kbd>Ctrl</kbd> and you bump into its side.

🤖 Generated with Claude Code

Closes #197

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs