99df2c09

By: Michael Lynch <git@mtlynch.io>

Predict the local player between snapshots

Rendering the local sprite only from server snapshots meant its
position stepped at 20 Hz, and no client-side movement filled the
frames between. The walk read as choppy compared to the client-only
version on master.

The sprite now runs on an Arcade Physics body driven by input velocity,
so motion integrates at Phaser's fixed step. Server snapshots stash the
divergence as a decaying correction rather than teleporting the sprite.
Correction is only applied on axes the player isn't actively driving —
on a driven axis the gap is expected RTT-worth of lag, and consuming it
would visibly slow the sprite below its intended speed.

The one architectural cost is that PLAYER_SPEED now lives on both sides
of the wire again; a comment in game-scene.ts calls out the pairing
with state.ex.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Suite timing

Time to Start Worker time Duration Time to finish
Config 2s 17s 17s 20s
Eval 13s 38s 38s 51s
Build 36s 4m51s 1m38s 2m14s
Suite 2s 5m47s 2m12s 2m14s

Timeline

0s10s20s30s40s50s1m1m10s1m20s1m30s1m40s1m50s2m2m10s