commit a8f131ffe4064d7639865a9e04c6dc9f4dd36fe8
parent 8ad1ece4b9f8cc76255569e9b50568446aeda62e
Author: anon <anon@example.com>
Date: Mon, 26 Oct 2026 06:18:45 +0000
Document native player movement and sparse pose correction
Recover longitudinal force, independent strafe displacement, angular ordering,
cached controls and component transitions from maintained client sources.
Verify those contracts with native WASM input and read-only state probes.
Trace the engine's automatic action20 producer and correct the broader claim
that following never publishes pose snapshots. Record the brief forward
prediction cap and a 25-second strafe that leaves the server 50 units behind.
Keep the shared native movement implementation explicit in the travel TODO.
Diffstat:
4 files changed, 218 insertions(+), 11 deletions(-)
diff --git a/TODO.md b/TODO.md
@@ -1181,6 +1181,21 @@ disconnect retention and succession policy still need period corroboration.
## Travel
+- [x] Recover ordinary held player movement and automatic pose-update rules.
+ Maintained source binds full signed longitudinal force, separate strafe
+ displacement, cached turn rates, input gates, pose anchoring and body heading.
+ Hardware verifies nine control combinations and the engine's occasional
+ action20 updates. A 25-second pure strafe moves 50.30 units while the current
+ server map stays at its starting position, with no action20 during the hold.
+ See [native player movement](docs/player-movement.md).
+- [ ] Replace the shared held-input estimate with native player simulation.
+ Reuse the vehicle integrator with distinct forward, follow, strafe and turn
+ controllers. Preserve acceleration, stop/reversal gates, cached controls,
+ angular order, pose-correction realignment and actual snapshot component state.
+ Cover long forward/strafe motion, reverse-to-follow, simultaneous controls,
+ speed/stat changes, roots/death/loading, interaction ranges, late observers
+ and periodic pose checkpoints without per-tick DB churn. Keep scene collision,
+ flight/water and other orientation modes explicit until implemented and tested.
- [x] Audit compact actor-spawn Run Speed. Send trained stat 156 as an unsigned
byte through 255 or a flagged short above it, preserving following materials.
Two GPU WASM clients verified training across 255, separate equipment/nano
@@ -1546,9 +1561,10 @@ and unresolved indoor lifecycle are explicit in [flight](docs/vehicles.md#yalmah
Scene collision and the full lifecycle matrix remain the next item.
- [ ] Complete canonical player following. Recover native scene collision,
surface projection, slopes, falling/flight and platforms instead of relying on
- the current NPC height-map policy. Replace the shared held-input predictor's
- 20-second horizon and instant speed with native movement, including strafe/turn
- state, so long uninterrupted targets do not freeze or lead their client pose.
+ the current NPC height-map policy. Use the shared simulation tracked under
+ Travel so long-held and strafing targets have current authoritative poses;
+ [native player movement](docs/player-movement.md) records the current failures
+ and the engine's sparse action20 correction policy.
Recover retained backward-direction steering when activating follow after
reverse movement; the current controller covers positive-direction following.
Verify live Chest VolumeMass after filling/emptying bags; its constructor's
diff --git a/docs/player-follow.md b/docs/player-follow.md
@@ -4,7 +4,9 @@ The ordinary 14.9.1 `/follow` command sends FollowTargetIIR_c, key `0x260f3671`.
It does not send the CharacterAction 29 constructed by the separately exported
N3Msg_Follow method. The server now admits the ordinary request and advances
transient authoritative follow motion using the recovered arrival controller.
-The client supplies no routine automatic position snapshots during following. Open-ground
+The client supplies occasional action20 pose corrections while moving; server
+motion must advance between them. See [player movement](player-movement.md).
+Open-ground
positive-direction movement is implemented; native scene collision, complete terrain/flight behavior
and the full combined lifecycle matrix remain unfinished.
@@ -94,6 +96,10 @@ behavior and combined lifecycle/resource cases.
The shared manual-input predictor also retains its existing 20-second horizon
and instant-speed approximation, and does not reconstruct strafe/turn motion.
These are outstanding general movement limitations, including follow targets.
+In a longer walking capture, the target sends an automatic action20 after about
+21 seconds. The map prediction stops for 0.884 seconds at its horizon while the
+native target travels another 1.324 units, then resumes from the correction.
+This capture establishes a brief prediction freeze, not permanent target loss.
Retaining native backward-direction steering when follow starts after reverse
movement also remains outside the current positive-direction controller.
@@ -248,11 +254,13 @@ and collision branches. The encumbrance multiplier depends on a global flag;
its maintained mapping starts zero, while the original live effective value
and indirect setters remain unestablished.
-The inspected following path has no automatic movement-message publisher.
-All direct maintained calls to ordinary CharDCMove's constructor come from
-N3Msg_MovmentChanged; extended action 20 comes from rotation input/flush. That
-bounded source search alone cannot prove all possible outbound behavior, but
-the hardware capture below confirms the missing snapshots in the tested flow.
+The arrival controller itself does not publish movement messages. A separate
+engine CheckMotionUpdate path checks every 61st engine Run, uses a strict
+greater-than-20-second integer-time threshold and a vehicle-speed gate, and
+submits ordinary CharDCMove action20 without excluding followers. The short
+hardware captures below establish only their own observed message windows.
+Complete producer/caller/timestamp-reset evidence and the longer capture are
+indexed in [player movement](player-movement.md).
The server uses transient follow state and authoritative motion, shared with
its position consumers and periodic checkpoints. It retains rotation 20,
diff --git a/docs/player-movement.md b/docs/player-movement.md
@@ -0,0 +1,182 @@
+# Native player movement
+
+The server still uses a bounded, instant-speed estimate for ordinary held input.
+Replacing it requires the shared native vehicle integrator with distinct
+longitudinal, arrival, lateral and angular controllers. Combining all controls
+into a normalized desired direction would change the original behavior.
+[Player following](player-follow.md) implements only its current documented
+subset. This document records the wider contract for the shared replacement;
+it does not claim that replacement is implemented.
+
+## Ordinary ground motion
+
+For each admitted native substep, use body quaternion `q`, longitudinal velocity
+`v`, position `p`, body mass `M`, force cap `Fmax` and speed cap `V`:
+
+```
+F = sign(forwardControl) * Fmax * rotate(q, forward)
+v = clampLength(v + F*h/M, V)
+p += h * (strafeControl * rotate(q, right) + verticalControl * worldUp)
+p += h * v
+```
+
+Zero forward control supplies no force; it does not itself discard existing
+velocity. Matching stop events and direction reversal explicitly Halt. The
+force uses only the sign of a nonzero forward control, with no arrival damping.
+Follow instead computes its existing arrival force and uses the same force and
+velocity integration. The four-unit target offset is specific to following.
+
+Strafe contributes displacement directly, independently of capped longitudinal
+velocity. It has no acceleration ramp or combined diagonal speed cap. For
+RunSpeed 5 at full health, ordinary walking caps longitudinal velocity at 1.5,
+but right/left strafe uses magnitude 2.0125. Simultaneous settled walking and
+strafing therefore travels faster than either individual axis.
+
+For nonzero turn control, angular motion happens after displacement:
+
+- With zero horizontal longitudinal velocity, rotate the body quaternion around
+ world up by `turnControl*h`, then refresh body forward.
+- Otherwise rotate longitudinal velocity by that angle. The ordinary outer
+ orientation pass subsequently reconstructs body facing from velocity.
+
+Positive yaw rotates forward +Z toward +X. Multiple native integration substeps
+share the outer orientation pass; rebuilding body facing after every substep
+changes curved movement. Reverse movement has distinct body and movement
+quaternions: the body faces opposite travel. Packets use body heading.
+
+The native integrator rejects nonpositive or greater-than-four-second frame
+intervals, and subdivides admitted intervals at a default maximum of 0.4 seconds.
+It has no 20-second held-input expiry. Native frame cadence, collision, gravity,
+surface projection, flight and nonzero orientation modes remain separate
+verification boundaries; these flat-ground reductions do not replace them.
+
+## Cached controls and transitions
+
+Forward/reverse start events set signed throttle and refresh speed/force before
+physics. Reversing direction clears velocity. A matching release stops
+immediately; a mismatched release is rejected by the native component state.
+Walk/run changes preserve throttle and velocity, refreshing parameters so a lower
+speed cap takes effect during the next integration.
+
+Strafe speed is sampled when strafe starts:
+
+```
+S = min(15, encumbranceAdjust(2 + 0.0025 * healthAdjustedRunSpeed))
+```
+
+It has no forward-speed 0.1 floor and no walk/run branch. The conditional
+encumbrance flag's live setting is not established; this is not evidence to
+enable a new overload penalty. Cached strafe control must not silently change on
+every physics tick when a stat changes.
+
+Turn starts choose 3.5 radians/second for neutral longitudinal helper state and
+1.5 otherwise. This tests the helper state, not physical displacement: pure
+strafing can retain the idle rate. Forward start/stop refresh an active turn's
+rate; reverse start/stop omit that refresh. Current input signs alone therefore
+cannot reconstruct every cached native control.
+
+| Actions | Component effect |
+| --- | --- |
+| 1 / 2 | Start / stop forward. Stop requires the matching forward state. |
+| 3 / 4 | Start / stop reverse. Reverse stop restores positive retained direction. |
+| 5 / 6 | Start / stop right strafe. Repeated matching starts and wrong releases reject. |
+| 7 / 8 | Start / stop left strafe; opposite strafe starts replace the direction. |
+| 9 / 10 | Start / stop positive yaw. Stop requires the matching turn state. |
+| 11 / 12 | Start / stop negative yaw. Stop requires the matching turn state. |
+| 20 | Pose correction retaining input/follow state. |
+| 22 / 23 | Walk / run preference and parameter refresh. |
+
+Admitted pose correction precedes these component callbacks. When position or
+rotation changes, native SetRelPosRot preserves speed magnitude and realigns
+velocity with the corrected body forward and retained movement direction.
+A subsequent reversing or stopping callback can then Halt.
+
+Follow control0 retains movement direction. A reverse-to-follow transition can
+therefore retain reverse body facing and reverse cached speed even though the
+arrival force still points toward its target. Physical follow start submits the
+matching signed start event; arrival submits the matching stop. Guessing positive
+throttle from every nonzero follow velocity loses this distinction.
+
+## Automatic pose correction
+
+The separate engine CheckMotionUpdate path submits ordinary CharDCMove action20
+without testing whether the player is following. Every 61st engine Run, it
+checks integer epoch seconds since the last movement-message timestamp against
+strictly greater than 20, requires an owned actor, and tests its vehicle's cached
+speed against approximately 0.01. The timestamp reset is tied to the movement
+message's pass-on condition. This is not a fixed 21-second network interval or
+a distance threshold.
+
+That cached speed is the length of longitudinal velocity, calculated before the
+separate lateral displacement. Pure flat-ground strafe with zero residual
+longitudinal velocity can move while cached speed remains zero, so the automatic
+pose-update gate does not establish periodic updates for every moving player.
+
+A 35-second hardware walking capture sends a forward start, one automatic
+ordinary action20 at 20.982 seconds, then a forward stop. The follower also sends
+an ordinary action20. During the target's 20-second server prediction horizon,
+the public map remains unchanged for 0.884 seconds while the native target moves
+1.324 units, then resumes after the correction. This demonstrates a brief cap
+freeze, not permanent loss of target motion in that run.
+
+A separate 25-second pure right-strafe capture covers 50.301 units on the verified
+flat route while native longitudinal velocity stays exactly zero. The server map
+remains at the start until release. Its wire stream contains only strafe start5
+and stop6, with no action20 during the hold. Removing the forward predictor's
+time cap alone cannot fix this failure.
+
+The same hardware character verifies the source control values:
+
+| Ordinary input | Observed native control / behavior |
+| --- | --- |
+| Walking forward / reverse | Throttle +1 / -1; speed still about0.3 after the initial100ms. |
+| Right / left strafe | Cached lateral scalar +2.0125 / -2.0125; longitudinal velocity zero. |
+| Walking forward + right strafe | Both controls retained; about2.35 units in the one-second exercise. |
+| Stationary right turn | Cached angular scalar3.5; no positional displacement. |
+| Right turn then forward | Forward callback refreshes angular scalar to1.5. |
+| Right turn then reverse | Reverse callback retains angular scalar3.5. |
+| Forward + right strafe + right turn | Helper bytes `[2,3,1,3,4,3,0,5,4,1]`; all three controls retained. |
+
+These are sampled GUI exercises with frame/event timing, not native float-bit
+equivalence tests. Each starts from an observed neutral control state. Immediate
+post-key-release probes can precede native frame processing; the following
+exercise's neutral state and the wire releases provide the applicable evidence.
+The first direction probe used the wrong scalar interpretation and is excluded;
+a separate corrected integer probe verifies reverse direction-1 while active.
+
+## Evidence and implementation checks
+
+Maintained-source bodies, full source/body hashes, initializer/IAT/vtable bindings
+and source-only verifiers are retained under `local/player-movement-research/`:
+
+- `longitudinal/findings.md`: N01-N08 and F01-F02 bind force, integration,
+ start/reversal/stop, speed/mass, body heading, pose anchoring and follow direction.
+- `lateral-turn/findings.txt`: exact action5-12 gates, cached strafe/turn values,
+ integration order and component serialization, with machine-readable linkages.
+- `pose-updates/`: engine producer, caller, time import, threshold and timestamp
+ reset evidence. The cache-speed producer is traced independently of displacement.
+- `runtime/`: headed Chromium GPU screenshots, page errors, reassembled wire
+ messages and read-only guest state/public-control probes. Owned fixture changes
+ use the normal control editor; no native calls or guest-memory writes are used.
+
+The three independent source ledgers verify 78, 75 and 23 complete maintained
+bodies respectively; overlapping functions are not unique additional procedures.
+`runtime-verification.json` indexes the source checks, nine control exercises,
+reverse-direction probe, long strafe and walking-cap measurements. Page-error
+logs are empty. All three owned players are removed after closing their clients;
+unrelated SQLite rows are hashed unchanged and foreign-key/integrity checks pass.
+The sole HTTPS8443 preview keeps its existing executable for this research pass.
+
+The 42-byte PlayerVehicle snapshot must retain actual velocity, all ten helper
+bytes, preferred mode and four cached controls. Some helper fields depend on
+command history; resetting unrelated bytes to constructor defaults does not
+reproduce the native writer. Initial spawn and readiness replay must represent
+both ordinary motion and follow targets consistently.
+
+The shared implementation remains an open TODO. Verify acceleration and steady
+motion beyond 20 seconds, forward/reverse switches and releases, independent and
+combined strafe/turn, changed speed while moving, pose corrections and follow
+transitions. Include repeated starts, wrong releases, roots/death/loading,
+late observers, active range-dependent interactions, and checkpoint/restart
+without per-tick database writes. Reuse the integrator while preserving each
+controller's actual force, cached parameters and transition rules.
diff --git a/docs/server-action-coverage.md b/docs/server-action-coverage.md
@@ -58,8 +58,9 @@ pass. The overall complete-action-set TODO remains open.
The ordinary player `/follow` route is now independently captured and traced.
FollowTarget installs native PlayerVehicle steering for owners and observers;
-the follower sends no regular automatic movement snapshots in the verified long-walk
-flow. An echo-only prototype left Go's position frozen; a manual cancellation
+the engine also sends occasional action20 pose corrections while moving, including
+following. These leave long intervals requiring server simulation; see
+[player movement](player-movement.md). An echo-only prototype left Go's position frozen; a manual cancellation
packet finally reported a 12.1-unit change. It is retained as research, with
native arrival-force/integration equations. The production handler now couples
the native response to transient authoritative arrival motion, mass, cancellation