Skip to content

Rework movement and combat feel against the art #156

Open

Description

@arudaev

Problem

Codex's 16-layer stack (#111 → #149) is the game's only movement, combat and enemy code, and it doesn't meet the bar Alexander set (24 Oct, 04:00):

  • It doesn't feel smooth. Animations run too fast or look rubbery, and nothing compares the clip speed to the movement speed, so feet slide.
  • Values are hardcoded instead of coming from the system.
  • It was barely played. Unit tests pass, but nobody tuned it with a pad and a keyboard on the real stage.

Codex has stopped (no credits left), so this is ours now.

Evidence at the stack's top (feature/41-chair-guard):

  • Fixed 12 fps timing. Animation timing is written as n / 12 in guard.ts, overhead.ts, sweeps.ts, rover.ts and jump.ts, instead of reading fps and frames from each *.anims.json. Retiming a clip means editing code in five places.
  • Chair enabled by region name: chair.ts has enabled = region === 'rusty-creek' instead of the chair pickup (interact kind pickup, item chair).
  • Hardcoded spawn: player.ts falls back to { x: 120, y: 461 }.
  • Unchecked walk and run speeds. Walk 3.5 m/s and run 6 m/s at 43 px/m (movement.ts), with an automatic run after 0.4 s held. Nobody measured these against the walk and run cycles' stride, so the feet slide.
  • Coffee placeholder: coffee.ts draws coffee-placeholder; the approved coffee-machine atlas is on feat: seat Dexter at the coffee machine with his gifts #154.
  • Generic sprite tinting: hits flash setTintFill(0xffffff) on every sprite, not the hurt frames that were drawn for them.

Acceptance criteria

  • One timing source: every clip's speed comes from its anims.json (fps, frames, loop), with no n / 12 left in gameplay code.
  • Speeds measured from the art: walk and run speeds follow the measured stride of the approved cycles (compare.py lineup, the foot travel per frame × fps), and the PR body shows the numbers.
  • Smooth transitions: idle ↔ walk ↔ run ↔ jump ↔ land use the bridge clips (docs/09 "Smooth, not rubbery"), with no pops. A GIF of each transition goes in the PR.
  • Data, not code: the chair comes from its pickup, spawns come from collision, and nothing names a region in combat or player code.
  • Played and recorded: a 2-minute recording on keyboard and pad shows run, jump, ladder, slope, chair sweep, pogo, guard and a rover fight. Every tuning value is listed in one table in docs/02.

Notes

How this fits the merge plan is in its own issue. Base: the stack stays (it's structured well: substeps, contracts, tests). Rework happens in layers on top, never as a rewrite from zero.

Metadata

Metadata

Assignees

Labels

area:combatChair, guard, health, damage, save points, pickupsarea:playerHero movement, animation state, cameratype:taskWork players don't see: tooling, pipeline, collision data, docs; one PR

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions