Throttle transform sends and smooth proxy movement

Separate normal transform send cadence from movement logging and improve proxy smoothing. Key changes:

- Polling/send logic (plugin/src/main.cpp): introduced distinct send vs log intervals (100ms send, 1s log), lowered send thresholds (≈3.0 units position, 0.02 rad rotation), renamed/clarified functions, and added special movement types (worldspace_change, cell_change, teleport) that bypass the send gate and are logged immediately. Normal movement targets roughly 10 Hz while moving to avoid packet-per-frame traffic.
- Proxy controller (plugin/src/F4TProxyActorController.cpp): tuned proxy position lerp alpha to 0.15 for smoother motion, renamed movement-interval variables for clarity, and removed the generic per-update movement gate so normal proxy visual updates are applied each game update while only the safety-offset path is throttled.
- Documentation updates (docs/architecture.md, docs/dev-log.md, protocol/player-sync.md): describe the new send/log separation, cadence and thresholds, smoothing behavior, and recorded dev-log about smoothing tests and results.

These changes reduce network noise, produce smoother remote visuals, and keep readable local movement logs while preserving immediate sends for large/categorical movement changes.
This commit is contained in:
2026-06-02 13:01:02 +12:00
parent 8dbe3117b0
commit 4ebc4a2814
5 changed files with 197 additions and 80 deletions
+10 -4
View File
@@ -13,7 +13,8 @@ both send and receive paths:
1. The Fallout 4 plugin reads local player transform data.
2. The plugin sends transform packets to the local Python server on
`127.0.0.1:7777`.
`127.0.0.1:7777`. Normal movement sends are throttled separately from
movement logs, targeting roughly 10 Hz while the player is moving.
3. The server assigns `playerId` values and sends `welcome` packets.
4. The plugin receives its `welcome` packet and stores its assigned `playerId`.
5. The server adds `playerId` and `serverTime` to transform packets.
@@ -23,9 +24,10 @@ both send and receive paths:
9. The plugin and fake client remove disconnected players from their remote
player tables.
10. On the game-thread update path, the plugin reads a copied remote-player
snapshot and moves the single placed proxy actor in `F4TTestCell01`,
smoothing normal movement and snapping cell changes, worldspace changes, and
teleports.
snapshot and moves the single placed proxy actor in `F4TTestCell01`.
Proxy visual updates are independent from local movement log throttling:
normal movement is smoothed toward the latest target, while cell changes,
worldspace changes, and teleports snap directly.
The Fallout 4 plugin still does not dynamically spawn remote actors.
@@ -38,6 +40,7 @@ The native plugin is responsible for:
- Loading into Fallout 4
- Reading local player state
- Sending local player data to the server
- Throttling normal transform sends separately from readable local movement logs
- Receiving server packets on a background thread
- Storing assigned and remote `playerId` state internally
- Moving the single placed test proxy actor from remote-player state on the game
@@ -89,6 +92,9 @@ Networking should run separately from game update logic.
Current approach:
```text
Game update reads local player transform
Game update sends thresholded transform packets around 10 Hz while moving
Game update logs local movement around 1 Hz
Networking thread receives packets
Networking thread stores remote player state
Game update reads a copied remote player snapshot
+93 -31
View File
@@ -544,35 +544,7 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
---
## Entry Template
Use this format for future updates:
```markdown
## YYYY-MM-DD - Milestone Title
### What Changed
- ...
### What Worked
- ...
### What Broke
- ...
### Notes
- ...
### Next Steps
- ...
```
## 2026-05-31
## 2026-05-31 - Placed Proxy Actor Control
### What Changed
@@ -608,7 +580,9 @@ Use this format for future updates:
- Snap movement first.
- Add smoothing/interpolation later.
## 2026-05-31
---
## 2026-05-31 - Remote-State Proxy Movement
### What Changed
@@ -644,7 +618,9 @@ Use this format for future updates:
- Build the plugin with `xmake build`.
- Run the single-client, two-client, and disconnect tests in `F4TTestCell01`.
## 2026-06-02
---
## 2026-06-02 - Remote Proxy Smoothing
### What Changed
@@ -682,3 +658,89 @@ Use this format for future updates:
- Run the single-client, two-client, special-movement, disconnect, and cell-leave
tests in `F4TTestCell01`.
---
## 2026-06-02 - Smooth Remote Proxy Movement Tested
### What Changed
- Separated normal local transform send cadence from local movement log cadence.
- Lowered normal transform send thresholds to support smoother remote motion:
about 3 game units of position change or 0.02 radians of rotation change.
- Targeted normal transform sends at roughly 10 Hz while moving, without sending
every frame.
- Kept local movement logs readable at the slower debug interval.
- Kept `cell_change`, `worldspace_change`, and `teleport` sends immediate and
baseline-updating.
- Removed the 200 ms throttle from remote-player proxy visual movement on the
game-thread update path.
- Tuned normal proxy position smoothing to a per-update lerp alpha near 0.15.
- Preserved direct snapping for special remote movement types and kept rotation
snapping through the existing safe heading path.
### What Worked
- The networking receive thread remains actor-free and still only updates plain
remote-player state.
- The single placed proxy actor remains the only remote visual representation;
dynamic spawning and multiple proxy actors are still out of scope.
- Two Fallout 4 clients can still connect to the local server.
- Server transform relay still works.
- Remote player state still updates correctly.
- The proxy actor now moves smoothly compared to the previous snapping/jittery
version.
- The current visual result is close to feeling correct, with animation sync now
being the obvious missing piece.
### What Broke
- Nothing recorded.
### Notes
- `server/server.py` and `server/fake_client.py` were intentionally left
unchanged because the transform packet protocol did not need to change.
- This is the first smooth visible multiplayer prototype for Fallout 4
Together.
- The proxy actor still lacks synced animations.
- Only one proxy actor is supported.
- Dynamic spawning is not implemented.
- Combat, inventory, quest, settlement, interaction, and animation sync remain
out of scope for this milestone.
### Next Steps
- Add basic movement state sync.
- Start with simple animation-related states like idle, walking, running,
sprinting, crouching, jumping, and weapon drawn.
- Keep animation sync separate from combat and inventory sync.
---
## Entry Template
Use this format for future updates:
```markdown
## YYYY-MM-DD - Milestone Title
### What Changed
- ...
### What Worked
- ...
### What Broke
- ...
### Notes
- ...
### Next Steps
- ...
```