Repository navigation
feat(hands): injuries that change the fight, FINISH HIM, fatalities, dismemberment and death - #296
Merged
Merged
Conversation
…dismemberment and death - Engine: 24 deterministic injuries with gameplay effects, a blood supply, the FINISH HIM phase with eight fatalities, death as a finish, a computer that fights with what it has left. Protocol version 6. - Client: injuries shown on the body (shader cuts, closed cross-sections, thrown parts, organs, pouring wounds, hanging eyes and gut), in the pose (dead arms, limp, daze, death throes), in the HUD, commentary, sound and haptics; the kill replayed in slow motion. - Explicit gore only at blood full with motion not reduced. - Dependencies: aiohttp 3.14.5 and refreshed locks for new advisories; vite 8.3.8, vitest 4.1.12. - CI: npm audit runs through a reviewed-advisory gate, for a zod 3 advisory with no fix that the Discord SDK pins.
|
Your organization has run out of review credits. Add credits to resume code reviews. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hands gets gameplay-affecting injuries, a blood supply, a FINISH HIM phase with eight fatalities, and death. The engine decides every injury; the client shows it on the body, in what pours and flies from it, in how the fighter moves, and in the HUD, commentary, sound and haptics. Protocol version 6.
Engine
Injury, rules incombat-manifest.jsonsectioninjuries): broken nose, broken jaw, jaw torn off, an eye out (each side), an ear torn off, a cheek flayed, skull fractured, shoulder dislocated, arm snapped, forearm severed, arm torn off, ribs caved in, liver ruptured, disembowelled, knee blown. Each is caused deterministically from accumulated wear and the punch that lands (one a punch, worst first, no dice) and changes how its owner fights: punch startup, impact and reach, guard leak, poise taken and its ceiling, stamina regeneration and maximum, foot speed, accuracy. A punch asked of a torn-off arm is thrown with the other hand; with both gone he cannot punch, guard, clinch or hit low. A dislocated shoulder is put back at the rest.MatchPhase.FINISH). The first punch the other fighter lands kills him with the fatality that punch earns (head: jab eyes out, straight head burst, hook decapitation, uppercut spine rip; body: jab heart punched out, straight gutting, hook bisection, uppercut blown to pieces). If none lands he collapses and it is a TKO.FinishMethod.DEATH): a fatality, bleeding out, more heavy shots on a fractured skull (brain), or a power body shot on an open gut (gutted). A death counts as a knockout in ratings.injury,injury_healed,vomit,finish_him,fatality,death,armless; aknockdownwith detailcollapse. Snapshots carryinjuriesandblood_volume, both in the checksum.rules.py).Client
injuries.tsmirrors the engine's rules from the manifest;prediction.tsmirrors hand swap, injury startup, foot speed and the armless fighter's missing guard, checked against engine-generated fixtures (test/injury-table.json, movement traces).render/carnage.tsreads each fighter's injuries from the shown snapshot every frame (late spectators and replays are right) and shows an injury's moment once, as its punch lands on the render clock: the injury stays off the body from the snapshot that lists it until then, so what it tears off is still there to be thrown.render/mutilation.ts+render/injury.ts: the skin shader stops drawing what is gone (jaw, forearm, arm, top of the skull, everything above the waist, a hole through the chest) and the cuts are closed with flesh and bone built from their rims; exposed brain, ribs, knee and elbow bone; ears, flayed cheek; skin drains to grey with blood loss.render/effects.ts+render/viscera.ts: baked body parts thrown under physics with their owner's skin, injuries and cross-sections, organs, gut lengths, bone, vertebrae, fat, ears; wounds that keep pouring per site in the colour of what they pour (blood, bile, brain, urine); a gut that hangs as a rope and drags; a heart that keeps beating on the canvas; a spine that leaves with the head; flies over a corpse; boot prints, smears and pools on the canvas.render/graph.ts+render/ragdoll.ts: a dislocated arm hangs, a snapped forearm swings from the elbow, a blown knee limps, an open belly is held shut; retching, fainting from blood loss, the FINISH HIM daze; death falls by cause and death throes.render/renderer.ts: injuries, FINISH HIM, fatalities and deaths on the render clock; the kill replayed in slow motion (the body is put back together for the lead-up); prediction through the finish phase.fullwith motion not reduced;reduced,offand reduced motion keep every body whole and only name the injuries.Dependencies and CI
CI's two dependency audits had started failing on
mainsince its last run (advisories published in the month since), so this PR clears them:aiohttpfloor raised to 3.14.4 (locked 3.14.5);certifi,filelock,msgpack,pyasn1,setuptools,soupsieveandyarlrefreshed inuv.lock.pip-auditis clean.vite8.1.5 to 8.3.8,vitest4.1.11 to 4.1.12,undici7.30.2 through the lockfile.zod3, which@discord/embedded-app-sdk2.5.0 (its latest release) requires; only zod 4.6.6 is patched. It is a memory-exhaustion bug when validating oversized arrays, and here zod only validates the Discord client's messages in the player's own tab.npm audit --audit-level=highcannot ignore a single advisory, so CI now runsnpm run audit:high(web/hands/scripts/audit.mjs): it fails on any high or critical advisory that is not in a reviewed list, and on a reviewed entry npm no longer reports. This changes a security gate and deserves a second look.Verification
uv run ruff check .,uv run ruff format --check .,uv run mypy src/,uv run pip-audit,uv run bandit -r src/ -c pyproject.toml: clean.uv run pytest: 2417 passed.scripts/hands_replay.py --check(the golden bout now runs on through a second get-up to FINISH HIM and a decapitation at tick 941) andscripts/hands_parity_fixtures.py --checkpass.web/hands:npm run typecheck,npm run test:run(71 files, 1557 tests),npm run audit:high,npm run build,npm run scan:build;scripts/check_hands_wheel.pyon the built wheel. Bundle 2.89 MB (1.45 MB gzip).scripts/hands_balance.py, 24 bouts a matchup): mirror matchups stay near even (champion 11-13, contender 11-13, rookie 11-12-1); skilled play still beats aggression; rookies still go to the cards with no deaths.scripts/hands_e2e_scenarios.js):finish(three knockdowns, FINISH HIM, a fatality,deathfinal, 405 replay frames with no jump),koandcpu, with no client or server errors.reducedandoff: no console errors. The production bundle served by the Python server loads and reaches its outside-Discord state with no console errors.Known limits
total_gibcosts tens of milliseconds once, and once more at the replay's impact.