fix(physics): restore retail path-6 collision response
This commit is contained in:
parent
acec33eca8
commit
75b6f6b6c9
8 changed files with 523 additions and 223 deletions
|
|
@ -1,14 +1,17 @@
|
|||
# P2 — Collision response-layer edge family: port-ready pseudocode
|
||||
|
||||
**Status: RESEARCH PASS COMPLETE (2026-07-30); RETAIL RESPONSE ORDER PORTED
|
||||
(2026-07-31).** Originally a research-only doc for Campaign P Slice P2
|
||||
(`docs/plans/2026-07-29-physics-parity-campaign.md` §P2); a same-day
|
||||
implementation session landed TS-1's retirement and AP-7's fix, attempted
|
||||
TS-4 per this doc's own §6 Step 3 fixture-first order, reproduced the
|
||||
historical wedge, and stopped — see §7 item 6 for the full capture and
|
||||
root-cause diagnosis. TS-4 is NOT retired; its shortcut stays in place.
|
||||
**Status: RETAIL RESPONSE ORDER COMPLETE (2026-07-31).** Originally a
|
||||
research-only doc for Campaign P Slice P2
|
||||
(`docs/plans/2026-07-29-physics-parity-campaign.md` §P2). The first TS-4
|
||||
attempt reproduced a steep-roof fixed point because its fixture discarded
|
||||
the accepted contact state between frames; §7 item 6 preserves that useful
|
||||
failure analysis. Slice 1B then completed the exact nested edge/StepDown
|
||||
dispatcher, Slice 2A restored StepDown's mandatory Placement tail, and Slice
|
||||
2B repeated the removal with production-shaped state carry and the complete
|
||||
direction matrix. TS-4 is now retired; see §10.
|
||||
#166 got a reattribution note in ISSUES.md rather than new code (per §3).
|
||||
#116 remains untouched (oracle-first, out of implementation scope).
|
||||
#116's former skipped wall control is now active with the retail Path-6
|
||||
first-frame hard stop and next-frame slide chronology.
|
||||
**Headline findings that change the plan's assumptions:** TS-1 was already
|
||||
substantially ported (the register row and plan phrasing were stale — see
|
||||
§2); the one real gap needed no code change (acdream's unified world-space
|
||||
|
|
@ -17,17 +20,11 @@ substantially ported (the register row and plan phrasing were stale — see
|
|||
NOT about a literal `PhysicsState.Sledding` auto-toggle at all (see §3);
|
||||
AP-7's L.3c regression does not reproduce on the production graphical
|
||||
root-motion path post-R6, and now ports retail's confirmed 0.25f threshold
|
||||
(see §1); TS-4's shortcut removal is coupled to TS-1's completion and
|
||||
reproduces a wedge even after TS-1 lands — see the §7 item 6 update for the
|
||||
precise mechanism (Phase 3 of `TransitionalInsert` is structurally
|
||||
unreachable from Path 6's unconditional `SetCollide`, which returns
|
||||
`Adjusted` without repositioning the sphere) and what a future attempt
|
||||
needs to check first; #116 remains a genuine oracle-first research item
|
||||
needing live cdb/Ghidra, not an implementation item (see §5). Read §6 (port
|
||||
order) before starting further implementation on this family. Campaign P
|
||||
Slice 1B subsequently performed that fresh `transitional_insert` read and
|
||||
removed AP-3, AP-4, AD-53, and AD-54; the exact closeout and controls are in
|
||||
§8. TS-4 remains deliberately unchanged.
|
||||
(see §1). The apparent TS-4 wedge was a harness-state defect, not a reason to
|
||||
retain a product compensation: production-shaped vertical, inward,
|
||||
tangential, uphill, and downhill histories now pass graph/flat raw-bit
|
||||
parity without the shortcut. Campaign P Slice 1B removed AP-3, AP-4, AD-53,
|
||||
and AD-54 (§8); Slice 2A retired AP-5 (§9); Slice 2B retired TS-4 (§10).
|
||||
|
||||
Every claim below is tagged **FACT** (grep/read-verified against the
|
||||
named-retail decomp, the register, ISSUES.md, or current acdream source
|
||||
|
|
@ -599,12 +596,13 @@ manufacture a caller that sets it.
|
|||
|
||||
## 4. TS-4 — Path-6 steep-poly shortcut removal
|
||||
|
||||
### The current shortcut (FACT, `src/AcDream.Core/Physics/BSPQuery.cs:2149-2266`)
|
||||
### The former shortcut (HISTORICAL FACT; removed by Slice 2B)
|
||||
|
||||
Path-6 (the default `sphere_intersects_poly → collide_with_pt / SetCollide`
|
||||
dispatch) tests each hit polygon's world-space normal. For BOTH sphere0
|
||||
(feet) and sphere1 (head), if `worldNormal.Z < PhysicsGlobals.FloorZ`
|
||||
(steeper than ~49° from horizontal), acdream takes a SPECIAL BRANCH:
|
||||
Before Slice 2B, Path-6 (the default
|
||||
`sphere_intersects_poly → collide_with_pt / SetCollide` dispatch) tested each
|
||||
hit polygon's world-space normal. For BOTH sphere0 (feet) and sphere1 (head),
|
||||
if `worldNormal.Z < PhysicsGlobals.FloorZ` (steeper than ~49° from
|
||||
horizontal), acdream took a SPECIAL BRANCH:
|
||||
projects the move along the steep face, writes
|
||||
`collisions.SetCollisionNormal(worldNormal)` **and**
|
||||
`collisions.SetSlidingNormal(worldNormal)`, and returns
|
||||
|
|
@ -653,7 +651,7 @@ and — when that surface turns out too steep to be walkable —
|
|||
`EdgeSlideAfterStepDownFailed` → `CliffSlide`/`PrecipiceSlide` (TS-1's
|
||||
domain, §2 above).
|
||||
|
||||
### TS-4 port shape (FACT-grounded, mechanically simple)
|
||||
### TS-4 port shape (COMPLETED 2026-07-31)
|
||||
|
||||
Delete both `if (worldNormal{0,1}.Z < PhysicsGlobals.FloorZ) { ... return
|
||||
TransitionState.Slid; }` blocks (`BSPQuery.cs:2200-2215` and
|
||||
|
|
@ -666,7 +664,7 @@ retires both `SetSlidingNormal` write sites (satisfying DO-NOT-RETRY §0
|
|||
item 1 permanently — deleted, not just avoided) with no replacement logic
|
||||
needed at this layer.
|
||||
|
||||
### ⚠️ Port-order coupling with TS-1 (INFERENCE, but directly evidenced by the shortcut's own commit history)
|
||||
### Port-order coupling with TS-1 (historical guard, now satisfied)
|
||||
|
||||
**This is the single most important sequencing fact in this whole
|
||||
document.** The shortcut's comment proves TS-1's retail-faithful chain
|
||||
|
|
@ -1182,3 +1180,42 @@ The #273, #271, #185, StepUp, transition-retry, and TS-4 controls remain
|
|||
unchanged. AP-5 is retired; TS-4 is intentionally untouched.
|
||||
|
||||
---
|
||||
|
||||
## 10. Campaign P Slice 2B closeout — TS-4 retired (2026-07-31)
|
||||
|
||||
A fresh read of `BSPTREE::find_collisions` (`0x0053A440`) confirms the exact
|
||||
Path-6 split. A primary/foot-sphere polygon hit transforms the polygon normal,
|
||||
calls `SPHEREPATH::set_collide`, writes `LandingZ`, and returns `ADJUSTED_TS`
|
||||
(`0x0053A7B3..0x0053A7DC`) regardless of steepness. Only when that sphere is
|
||||
clear does a secondary/head-sphere hit write `collision_normal` and return
|
||||
`COLLIDED_TS` (`0x0053A793..0x0053A7A4`). Neither branch writes
|
||||
`sliding_normal`.
|
||||
|
||||
Both parsed-graph and prepared-flat Path-6 implementations now follow that
|
||||
split exactly. The steepness branches, in-place tangent projection, and BSP-
|
||||
layer `SetSlidingNormal` writes are deleted. Exact site tests compare the two
|
||||
representations by raw bits and pin every mutated and preserved field:
|
||||
|
||||
- foot: `SetCollide`, candidate backup, transformed `StepUpNormal`,
|
||||
`WalkInterp=1`, `WalkableAllowance=LandingZ`, `Adjusted`;
|
||||
- head: `CollisionNormal`, `Collided`, with no `SetCollide` state mutation;
|
||||
- both: a pre-existing sliding normal is preserved byte-for-byte.
|
||||
|
||||
The failed first removal was a test-harness lesson, not a retail exception.
|
||||
Its gravity-only replay always passed `isOnGround:false` and discarded each
|
||||
accepted result's Contact/OnWalkable bits, making the nested edge/StepDown
|
||||
chain impossible to exercise on the next frame. The replacement replay uses
|
||||
the same retained `PhysicsBody` chronology as production. Parsed graph and
|
||||
prepared flat now match by raw result/body bits for vertical roof descent,
|
||||
downhill input, uphill pressure (including a no-launch/no-bounce assertion),
|
||||
tangential roof travel, inward-plus-tangent wall travel, and flat-roof ledge
|
||||
rejection. Every trace asserts finite bounded motion and signed-plane non-
|
||||
penetration. The former #116 D4 control is active: its primary-sphere hit
|
||||
hard-stops frame one through SetCollide, then the accepted persistent normal
|
||||
permits the downward slide on frame two.
|
||||
|
||||
The complete historical #273/#271/#269/#265/#185/#137/#116/cellar/roof
|
||||
matrix and the full Core Release suite pass without a replacement
|
||||
compensation. TS-4 is retired.
|
||||
|
||||
---
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue