urt-rs / docs /research /QVM_DAMAGE_FACTOR_BATCH.md
nmarshall's picture
qvm: health direction and knockback gates
f8ab1ad
|
Raw History Blame Contribute Delete
6.03 kB
# Damage factor and contact dispatch: RE-703–712
Ten separately checked tasks extend the [original-model/Rust batch](ORIGINAL_MODELS_RUST_BATCH.md). Complete289594 now computes factors and wound bookkeeping from original-model contact contexts. The contact caller's direction basis, damage-call arguments and scalar return are recovered separately. This batch adds no playable Rust/Bevy/Solari behavior.
| Task | Completed scope | Evidence |
| --- | --- | --- |
| RE-703 | Protection gates and actual armor inventory selection | [Protection](QVM_DAMAGE_PROTECTION.md) |
| RE-704 | Original weapon/location descriptor pairs and cubic range local | [Range](QVM_DAMAGE_RANGE.md) |
| RE-705 | Weapon24 half/full-range attenuation | [Attenuation](QVM_DAMAGE_ATTENUATION.md) |
| RE-706 | Factor saturation, weapon4 cap and optional accumulation | [Clamp](QVM_DAMAGE_CLAMP.md) |
| RE-707 | Wound eligibility, leg flag and client4312 increments | [Wounds](QVM_DAMAGE_WOUNDS.md) |
| RE-708 | Attacker/weapon attribution, counter and pending flag | [Attribution](QVM_DAMAGE_ATTRIBUTION.md) |
| RE-709 | Original location jump table and client192 flags | [Location flags](QVM_DAMAGE_LOCATION_FLAGS.md) |
| RE-710 | Held-item deadline and final return override | [Interruption](QVM_DAMAGE_INTERRUPT.md) |
| RE-711 | Complete factor function with original-model contact contexts | [Complete factor](QVM_DAMAGE_COMPLETE.md) |
| RE-712 | Contact direction basis, captured health-damage ABI and return | [Contact dispatch](QVM_CONTACT_DISPATCH.md) |
## Findings and validation
Mode9 and strict spawn-protection gates precede damage location selection. Actual32155/32117 checks positive client health and16 inventory slots, comparing low-byte item IDs17/22 for vest/helmet classification. Source descriptors use4068+432×weapon+8×location for factor/wound pairs. Weapon24 attenuates from scale1 at half range to float32(0.1) at full range. Factors saturate at1, weapon4 caps at float32(0.35), and its optional accumulator adds each capped factor without a total clamp.
Weapon4 computes a clamped distance ratio and cubic complement, but complete289594 never consumes the cubic local in its return arithmetic. Its distance ratio still gates wound-meter effects below float32(0.15). Client/entity flags suppress wounds; accepted wounds update a meter, attribution, a counter capped by a strict below4 check, and pending flag256. The original location table independently sets grouped client192 bits. Held items with low bytes14/23 can write time+200 deadlines above factor thresholds0.2/0.5, except leg locations11–14. A final global override returns1 after preceding effects; early zero/protection returns bypass it.
The complete factor fixture copies original hit contexts verbatim into a separate memory region and verifies report identity. Its independent oracle checks return, location output, accumulator, tracked external client fields and attacker attribution. Source table words are checked directly against original file bytes. Explicit synthetic clock/range/counter/flag fixtures expose arithmetic boundaries without establishing legal live-game domains.
Contact293373–293627 rebuilds forward/right/up from attacker angles using six modeled native sin/cos calls. It captures211239 only when the scalar is nonzero and the special flag is zero. Arguments preserve target, attacker twice, forward pointer, trace point pointer, scalar truncated to integer, zero flags, original weapon method and location. Nonzero subunit scalars dispatch integer0; explicit negative scalars dispatch signed negatives. The caller returns its unchanged float scalar.
The1259-test baseline gains41 Python checks, ending at1300 passing tests. All ten new JSON reports regenerate byte-identically, each below2MiB. Storage/filter, documentation-link and whitespace checks pass. Earlier reports, original assets, Rust code and the shared VM evaluator remain unchanged. Original native/executable parity and Linux execution remain open.
## Remaining limits and next ten tasks
RE-702 is partially advanced for contact/damage analysis, with its Bevy/native/interactive scope still open. RE-713 tracks the next work.211239 remains captured, so these results establish no health/armor mutations. Full292545 is not composed yet: ordinary/special location selection, contact events and feedback still separate the accepted prefix from the recovered dispatch suffix. Native sin/cos results are modeled, not reference-captured.
1. Compose ordinary contact292545 with complete289594, including scalar×100 and location-zero suppression.
2. Recover special weapon4 contact location/equipment selection and its bypass of ordinary health dispatch.
3. Recover contact event allocation, normal encoding, IDs, flags and health prediction at292917 onward.
4. Recover event scalar/accumulator encoding, direction normalization, weapon27 muzzle handling and feedback gates.
5. Compose complete292545, including impact-only and nonclient branches, with actual recovered children and explicit native boundaries.
6. Recover211239 health/armor/team/knockback/death gates and mutations against independently checked boundary fixtures.
7. Compose shared293732 trace/contact/statistics and successful295018 pellet aggregation using original-model geometry.
8. Recover native loader18183 ownership/endian/failure behavior and capture native/executable parity for geometry, transcendental math and live frame/clock domains.
9. Add Rust frame/tag interpolation, hierarchy, geometry/classification contracts and Bevy asset resolution, preserving case and archive variants.
10. Build an interactive macOS/Linux Bevy/Solari slice and continue maps, materials, textures, audio, networking, lifecycle and packaging validation.
Follow-up: [RE-714–723](QVM_CONTACT_HEALTH_BATCH.md) composes complete292545 and recovers211239 entry/normalization/knockback stages. Full health behavior and callbacks remain open; RE-713 is partially advanced and RE-724 records the next work.