acdream/src/AcDream.Core/Physics
Erik 204d0ae047 fix(physics): remote bodies slide on steep faces instead of freezing (#32)
A remote observed in acdream landed on a sloped roof and froze; the server slid
on, the gap passed AP-87's 4 m threshold, and the body snapped — the visible
blip. Live probe capture, two adjacent ticks 63 ms apart:

  t=88420671  rsInContact=True rsOnWalkable=False rsIsOnGround=True
              bodyCpNz=0.6097 floorZ=0.6642 steep=True gravity=True
              vel=(2.146,2.264,-3.549)
  t=88420734  contact=True onWalkable=True   <- forced against the sweep
              gravity=False                   <- cleared
              velBeforeZero=(2.146,2.264,0.000)
              moved=0.0000                    <- and every tick after

The roof is 52.4 degrees against a 48.4 degree limit, so acdream's classifier
was CORRECT and was then overruled. Four independent links each froze the body
on their own: a per-tick force of Contact|OnWalkable, a per-tick velocity zero,
a Gravity clear at landing, and a landing edge testing IsOnGround
(= inContact || ...) instead of OnWalkable. The tick called
HandleAllCollisions alone — the tail of SetPositionInternal without its prefix.

Retail simulates remotes locally and derives these bits rather than asserting
them: CPhysics::UseTime @0x00509950 iterates the whole object table;
update_object @0x00515D10 gates only on parent/cell/FROZEN with no
is_player fork; SetPositionInternal @0x00515330 sets CONTACT from
contact_plane_valid @0x00515430 and ON_WALKABLE from contact_plane.N.z vs
floor_z @0x00515465-@0x0051548E before handle_all_collisions @0x005154FE;
set_on_walkable @0x00511310 fires HitGround @0x00511364 / LeaveGround
@0x00511346 edge-triggered with no ownership gate; calc_acceleration
@0x00510950 zeroes only when CONTACT && ON_WALKABLE && !Sledding @0x0051096B;
calc_friction @0x0050EE70 returns at its first line when ON_WALKABLE is clear.
acdream had copied retail's airborne no-op WITHOUT retail's local simulation.

The fix is mostly deletion: stop forging the transients, stop discarding the
authoritative velocity, stop clearing Gravity, and route the remote tick
through the same SetPositionInternal commit TickHidden and the local player
already use, with the landing edge derived from the sweep's own OnWalkable.
AP-87's threshold and conditions and InterpolationManager's node_fail_counter
snap-to-tail are deliberately untouched — this removes the CAUSE of the
divergence rather than weakening the backstop.

Cross-checked against ACE: its only creature-side VectorUpdate emitters are the
jump broadcast and spell projectiles, so integrating the wire velocity cannot
double-move a walking remote; and PhysicsGlobals.DefaultState already carries
Gravity, so deleting the manufactured State |= Gravity is safe.

Register: AP-81 narrowed (its GRAVITY half retired outright), AP-87 annotated,
AP-139 filed (the interpolation-queue clear on the landing edge), AP-140 filed
(the two routing gates select snap-vs-interpolate on walkability where retail
uses CONTACT — adjust_offset @0x00555D30 gates on transient_state & 1
@0x00555D52). AP-140's follow-up is deliberately shaped as "point the two gates
at Body.InContact", NOT "re-derive Airborne", which would perturb five writers
and collide with a pinned RemoteTeleportPlacementTests assertion.

Three gaps recorded in #32 rather than papered over: the new LeaveGround
dispatch is untested for chatter; a persistently !Ok transition can latch a
remote airborne; and — the visual-gate watch item — the deleted forge was a
blanket guarantee of Contact|OnWalkable, and contact_allows_move @0x00528dd0
silently refuses action animations without both, which is the literal root
cause of closed #270. Retail-correct on a steep face, a regression anywhere
else.

10 discriminating tests over a real PhysicsEngine landblock whose contact
normal Z is 0.61 against FloorZ 0.6642 — the live roof's exact relationship.
Suite 11,019 passed / 4 skipped / 0 failed. Includes the temporary
ACDREAM_PROBE_REMOTE_LANDING / ACDREAM_PROBE_REMOTE_SLIDE probe family that
produced the capture above; strip with the family.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 10:21:16 +02:00
..
Motion fix(physics): remote bodies slide on steep faces instead of freezing (#32) 2026-08-04 10:21:16 +02:00
AceModernCommandCatalog.cs feat(L.1b): dual MotionCommand catalog — AceModern runtime + Retail2013 conformance 2026-06-30 22:13:36 +02:00
AnimationCommandRouter.cs fix(anim): Phase L.1b route motion commands 2026-04-28 10:46:22 +02:00
AnimationHookRouter.cs feat(anim): Phase E.1 hook router + GameWindow wiring 2026-04-18 16:30:23 +02:00
AnimationSequencer.cs fix(animation): harden presentation phase handoffs 2026-07-21 10:01:25 +02:00
BSPQuery.cs fix(physics): restore retail path-6 collision response 2026-07-31 13:44:55 +02:00
BuildingPhysics.cs T6 (BR-7) C3: per-cell shadow architecture - flood registration, building channel, per-cell query; b3ce505 stopgap DELETED (closes #99) 2026-06-11 14:37:50 +02:00
CellArray.cs feat(runtime): seal dormant SetPosition evaluations 2026-08-01 11:31:58 +02:00
CellDump.cs feat(phys): A6.P3 #98 Step 2 — cell-dump probe + roundtrip test 2026-05-23 15:16:56 +02:00
CellSurface.cs refactor(physics): remove parsed collision graphs 2026-07-25 18:21:19 +02:00
CellTransit.cs feat(runtime): seal dormant SetPosition evaluations 2026-08-01 11:31:58 +02:00
CollisionExemption.cs fix(physics): #299 — port retail's mover-side IsImpenetrable exemption branch 2026-08-03 20:13:05 +02:00
CollisionPrimitives.cs feat(physics): Task 2 — true sphere collision primitive (CSphere::intersects_sphere) 2026-06-24 19:08:53 +02:00
CollisionShadowVerifier.cs perf(physics): cut production traversal to flat assets 2026-07-25 17:00:04 +02:00
CollisionTraversal.cs fix(physics): validate retail cell containment roots 2026-07-31 14:48:26 +02:00
CollisionWorldState.cs wip(physics): collision O(changed) delta-commit (O1-O3) - ON HOLD, feel-test failed 2026-08-02 20:06:59 +02:00
EncumbranceSystem.cs feat(physics): Campaign P P1 - stat-coupled movement (burden/stamina/vitae) 2026-07-30 08:18:06 +02:00
EntityCollisionFlags.cs fix(physics): #297 — keep the PWD bitfield live so PK status reaches the client 2026-08-03 20:59:01 +02:00
FlatBspQuery.cs fix(physics): restore retail path-6 collision response 2026-07-31 13:44:55 +02:00
FlatCollisionAssetBuilder.cs feat(content): bake and read flat collision assets 2026-07-25 15:22:08 +02:00
FlatCollisionAssets.cs perf(physics): cut production traversal to flat assets 2026-07-25 17:00:04 +02:00
GfxObjDump.cs feat(phys): A6.P3 #98 — GfxObj dump infrastructure (ACDREAM_DUMP_GFXOBJS) 2026-05-23 20:24:26 +02:00
IAnimationHookSink.cs feat(#188): fading-wall + sliding-door translucency; hold open past animation settle 2026-07-09 09:17:50 +02:00
IMotionCommandCatalog.cs feat(L.1b): dual MotionCommand catalog — AceModern runtime + Retail2013 conformance 2026-06-30 22:13:36 +02:00
InterpolationManager.cs fix(physics): remote bodies slide on steep faces instead of freezing (#32) 2026-08-04 10:21:16 +02:00
InterpretedMotionFunnel.cs fix(R4-V5): moveto wedge - StopCompletely's missing animation dispatch orphaned pending_motions; + the P1 autonomous store family 2026-07-03 14:15:36 +02:00
LandDefs.cs feat(physics #145): Slice 1 — Position/Frame types + LandDefs.GetBlockOffset (0x0043e630) 2026-06-21 10:30:20 +02:00
MotionCommandResolver.cs feat(L.1b): dual MotionCommand catalog — AceModern runtime + Retail2013 conformance 2026-06-30 22:13:36 +02:00
MotionInterpreter.cs fix #270 closeout: strip investigation probes; close the issue 2026-07-31 07:26:57 +02:00
MovementSystem.cs fix #266: retail run-rate 800 branch is exact-equality sentinel, not a cap 2026-07-30 19:22:41 +02:00
ObjectRangeMath.cs fix(items): use retail cylinder range for loot windows 2026-07-17 20:32:34 +02:00
PhysicsBody.cs feat(runtime): commit dormant SetPosition activation 2026-08-01 14:25:02 +02:00
PhysicsDataCache.cs wip(physics): collision O(changed) delta-commit (O1-O3) - ON HOLD, feel-test failed 2026-08-02 20:06:59 +02:00
PhysicsDiagnostics.cs fix(physics): remote bodies slide on steep faces instead of freezing (#32) 2026-08-04 10:21:16 +02:00
PhysicsEngine.cs wip(physics): collision O(changed) delta-commit (O1-O3) - ON HOLD, feel-test failed 2026-08-02 20:06:59 +02:00
PhysicsObjUpdate.cs feat(runtime): commit dormant SetPosition activation 2026-08-01 14:25:02 +02:00
PhysicsResolveCapture.cs test: fix PhysicsResolveCapture/PhysicsDiagnostics static-leak isolation 2026-06-02 15:20:24 +02:00
PhysicsSetPosition.cs feat(runtime): seal dormant SetPosition evaluations 2026-08-01 11:31:58 +02:00
PhysicsTimestampGate.cs feat(runtime): own initial create residence transaction 2026-08-01 19:35:08 +02:00
PlayerWeenie.cs fix #266: retail run-rate 800 branch is exact-equality sentinel, not a cap 2026-07-30 19:22:41 +02:00
PortalInfo.cs feat(physics): Phase 2 — wire CellBSP + Portals into CellPhysics 2026-05-19 16:52:20 +02:00
PortalPlane.cs fix(core): Phase B.3 — add centroid + radius bounds to PortalPlane crossing test 2026-04-12 19:08:46 +02:00
Position.cs refactor(physics #145): Slice 1 — rename Frame->CellFrame to avoid DatReaderWriter.Types.Frame collision 2026-06-21 10:34:36 +02:00
PositionFrameValidation.cs feat(net): port retail physics spawn and event timestamps 2026-07-14 00:22:17 +02:00
ProjectilePhysicsStepper.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
RawMotionState.cs feat(R3-W1): retail state completion — action FIFOs, MovementParameters, MotionNode, WeenieError renumber (closes J2, J16-codes) 2026-07-02 22:12:33 +02:00
RemoteMotionCombiner.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
RemoteWeenie.cs fix(R4-V5): #160 remote run movetos in slow motion - remote interps had no weenie, so retail's run-rate chain never reached my_run_rate 2026-07-03 16:18:40 +02:00
ResolveResult.cs refactor(runtime): own local movement and outbound cadence 2026-07-26 12:33:53 +02:00
Retail2013CommandCatalog.cs feat(L.1b): dual MotionCommand catalog — AceModern runtime + Retail2013 conformance 2026-06-30 22:13:36 +02:00
RetailFrameMath.cs feat(physics): port retail projectile integration 2026-07-14 11:43:11 +02:00
RetailObjectActivityGate.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
RetailObjectManagerTail.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
RetailObjectQuantumClock.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
RetailPhysicsStateTransition.cs feat(vfx): port retail hidden and teleport presentation 2026-07-14 14:59:48 +02:00
ServerControlledLocomotion.cs fix(combat): persist death and retarget on kill 2026-07-12 09:19:38 +02:00
ShadowEntrySnapshot.cs perf(physics): pool collision cell snapshots 2026-07-23 06:12:34 +02:00
ShadowObjectRegistry.cs fix(physics): #297 — keep the PWD bitfield live so PK status reaches the client 2026-08-03 20:59:01 +02:00
ShadowShape.cs feat(phys): add ShadowShape record (no callers yet) 2026-05-24 15:07:40 +02:00
ShadowShapeBuilder.cs perf(physics): cut production traversal to flat assets 2026-07-25 17:00:04 +02:00
SpawnPlacementSettler.cs feat(runtime): C3c - production placement cutover: both hosts on the residence conductors (routes 1+8) 2026-08-02 18:10:33 +02:00
TerrainSurface.cs fix(physics): AP-10 - restore retail's 0.1m dry-corner water sink-in; wire WATER_CONTACT_TS 2026-07-30 10:52:39 +02:00
TransitionScratchArena.cs perf(physics): reuse reset-complete transition scratch 2026-07-25 14:37:02 +02:00
TransitionTypes.cs feat(runtime): seal dormant SetPosition evaluations 2026-08-01 11:31:58 +02:00
WalkMissDiagnostic.cs feat(physics): WalkMissDiagnostic aggregator for ISSUES #83 probe spike 2026-05-20 10:31:39 +02:00
WeenieError.cs feat(core): adopt retail's full WeenieError code table 2026-07-29 07:33:27 +02:00