Skip to content

feat(fp): a blow's thump pans toward where it came from (hit_direction) - #121

Merged
KunalSiyag merged 1 commit into
mainfrom
droid/round4-hit-thump
Oct 28, 2026
Merged

KunalSiyag merged 1 commit into
mainfrom
droid/round4-hit-thump

Conversation

@KunalSiyag

Copy link
Copy Markdown
Owner

What

Round-4 impact item 6: the audio half of hit_direction. In first person, the thump of a blow that lands on the hero pans a fist's reach toward where the blow came from — the same angle that drives #95's screen-edge arc. Third person and flag-off are untouched: health only emits the direction in first person with the flag on, so the thump keeps sounding at the chest there.

How

  • New bus signal hero_hit_dir(angle), emitted by health_feature._flash_from (5b's angle source: 0 ahead, +PI/2 from the right, ±PI behind) just before hero_hurt.
  • audio_feature remembers the pending angle and, on the hero_hurt that follows, offsets the existing punch_hit thump by DIR_THUMP_M (0.9 m) toward the source — the body's right is (cos, -sin) of the yaw and it faces (-sin, -cos), the same convention as the flinch and the arc. A pending angle is consumed by whatever hurt comes next, so one spent on a thump-less cause (fall) never leaks. Cars and bites keep their own placements.
  • No new buses, no new samples, no bus lifetime changes (per fix(audio): keep the fp buses for the session (web exit_fp crash) #83).

Tests

  • New tools/tests/fp_hitdir_test.gd: pans right/left/behind pin the sign and reach against the player's yaw; no marker leaves the thump chest-centred; a marker on a thump-less cause is spent, not saved.
  • fp_health_test._check_hit_direction also records hero_hit_dir: both angles reach the bus in first person, and nothing fires in third person. (fp_health_test stays at the 1000-line cap; fp_audio_test was already exactly at it, hence the dedicated file.)

Suites: fp_hitdir, fp_health, fp_hud green; run_all + pre-commit green; docs/api regenerated for the touched pages; ARCHITECTURE's health and audio rows carry the clause. Gate covered by CI per the window-freeze terms.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

Pairing #95's arc with sound: health's _flash_from — the same first-person,
flag-gated angle source as the screen-edge arc — emits the new bus signal
hero_hit_dir(angle) just before hero_hurt, and the audio feature pans the
hurt's existing punch thump a fist's reach (DIR_THUMP_M) toward the blow's
source instead of sounding at the chest. No new buses or samples; third
person and the flag off stay exactly as before by construction.

fp_hitdir_test pins the pan signs (right, left, behind, chest-centred
without a marker, and that a marker spent on a thump-less cause never
leaks); fp_health pins the signal's angles and its silence in third
person.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Automated review

No new findings on the 10 changed files (gdlint, complexity, TODO policy, dead code).

Run python3 tools/checks/run_all.py locally for the full set of checks.

@KunalSiyag
KunalSiyag merged commit 03e87e0 into main Oct 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant