commit a13cb462e2baedf0a2f69f0e4355c9c1b6069af5
parent 51d7979afdfef42f5782e74b2c00c3be0673028d
Author: anon <anon@example.com>
Date: Mon, 9 Nov 2026 10:12:22 +0000
Bound final browser walking approaches before reading snapshots
The earned starter run crossed its waypoint repeatedly because reading a
large snapshot could keep forward input held beyond the arrival tolerance.
Hold longer moves normally, then use bounded 200 ms forward presses for the
last metre, releasing input before reading the next complete native snapshot.
The complete TestBrowserWalkingFinalApproach regression passes at Run Speed
5 and 100, including fractional/integer and lateral arrivals, real wall
refusal, recovery and cold pose retention. Both existing harness unit tests,
JavaScript syntax and diff checks pass. The full starter rerun remains pending.
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/DEVELOPERS.md b/DEVELOPERS.md
@@ -823,7 +823,8 @@ Short key/click helpers release on the fresh consumed SDL event, then read the
next full snapshot. Reading a large snapshot while holding a skill button can
trigger native autorepeat and buy more points than intended.
`GameTest.walk(x, z)` follows observed position and heading with bounded native
-steering pulses and forward input held until arrival or a steering change.
+steering pulses. Longer moves hold forward until the final metre or a steering
+change; bounded forward presses finish the approach before reading another snapshot.
It rejects stalled routes and waits for actor
readiness when travel changes playfields, including a walk started while the
local actor is absent during zoning. Use it for ordinary ground routes.
diff --git a/tools/client/game_test.mjs b/tools/client/game_test.mjs
@@ -274,8 +274,8 @@ export class GameTest {
const angle = difference(yaw, 2 * Math.atan2(actor.rotation[1], actor.rotation[3]));
const key = Math.abs(angle) > 0.06 ? (angle > 0 ? 'KeyD' : 'KeyA') : 'KeyW';
- // Keep forward input held until arrival or an observed steering change.
- if (key === 'KeyW') {
+ // Hold longer moves until the final approach or an observed steering change.
+ if (key === 'KeyW' && distance >= 1) {
await this.hold('KeyW', `walk toward ${x},${z}`, state => {
const actor = this.local(state);
if (!actor || actor.playfield !== field) return true;
@@ -283,12 +283,12 @@ export class GameTest {
if (distance < best - 0.05) { best = distance; progressAt = Date.now(); }
assert(Date.now() - progressAt < 8000, 'Route is not approaching its destination');
const yaw = Math.atan2(x - actor.position[0], z - actor.position[2]);
- return distance < 0.35 || Math.abs(difference(yaw, 2 * Math.atan2(actor.rotation[1], actor.rotation[3]))) > 0.06;
+ return distance < 1 || Math.abs(difference(yaw, 2 * Math.atan2(actor.rotation[1], actor.rotation[3]))) > 0.06;
}, 120000);
continue;
}
- const delay = Math.min(200, Math.max(20, Math.abs(angle) / 3.5 * 1000));
+ const delay = key === 'KeyW' ? 200 : Math.min(200, Math.max(20, Math.abs(angle) / 3.5 * 1000));
this.record({kind: 'action', action: 'walk-pulse', key, delay, x, z});
const sequence = this.sequence;
await this.page.keyboard.press(key, {delay});