World revamp
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# Client Fixes / Notes After WorldHandler Refactor
|
||||
|
||||
## Server Protocol: UNCHANGED
|
||||
The wire protocol (OpCodes, payload shapes, message flows) is identical after the refactor.
|
||||
No client code changes are required for compatibility.
|
||||
|
||||
## Performance Impact
|
||||
The server tick loop no longer hits the database. Movement/collision is now pure in-memory.
|
||||
The client should observe dramatically faster movement response -- the "1 tile per 3 seconds"
|
||||
latency was caused by 30+ DB round-trips per player per tick on the server side.
|
||||
|
||||
## Client Recommendations
|
||||
|
||||
### LOCAL_MOVE_SPEED mismatch
|
||||
The client uses `LOCAL_MOVE_SPEED = 160.0` for local prediction, but the server walk speed
|
||||
is `120 px/s` and run speed is `180 px/s`. This means the client's local prediction overshoots
|
||||
when walking, causing small rubber-banding corrections via `VISUAL_RECONCILE_RATE`.
|
||||
|
||||
Options:
|
||||
- Match client prediction to server walk speed: change `LOCAL_MOVE_SPEED` to `120.0`
|
||||
- Or read speed from WORLD_SPAWN payload and use it dynamically
|
||||
- Run speed (shift held) already reasonably matches at 180 vs client 160
|
||||
|
||||
### Other observations
|
||||
- `MOVE_SEND_INTERVAL_MS = 100` correctly matches the server 10Hz tick rate
|
||||
- `VISUAL_RECONCILE_RATE = 4.0` and `VISUAL_SNAP_DISTANCE = 256.0` are reasonable
|
||||
- Client-side collision pre-check (line 350-355) only checks 1 tile vs server's 5-point check
|
||||
-- this is fine, it just means the client may sometimes send input that the server rejects
|
||||
Reference in New Issue
Block a user