Move placed proxy from remote-player snapshot

Enable game-thread proxy actor movement driven by a copied remote-player snapshot and update related networking/validation, docs, and test client.

- Plugin: add F4T::ProxyActorController::Update() (alias UpdateSafetyTest preserved) and implement remote-state-driven movement for the single placed proxy (F4TProxyRemotePlayer01REF) in F4TTestCell01. Selects lowest available playerId, validates same-cell/worldspace for movement, and caches represented playerId. Adds helper functions (ParseHexFormId, IsRemotePlayerInSameLocation, SelectRemotePlayerToRepresent, MoveProxyToRemotePlayer) and improved throttled logging.
- Networking: tighten transform packet required-field checking (requires type, playerId, x, y, z, angleZ, cellId), add GetMissingRequiredTransformField, make movementType/worldspaceId/clientTime/serverTime optional with sensible defaults, and switch LogThrottledWarning to accept string_view.
- main.cpp: call ProxyActorController::Update on game-thread tasks.
- fake_client.py: mirror new packet validation and provide defaults for optional fields.
- Docs/dev-log/protocol/setup: update architecture, dev log, protocol, and setup notes to describe the single-proxy remote-state milestone, required packet fields, and testing checklist.

This change keeps networking thread limited to parsing/updating plain remote-player state and moves all actor access to the game-thread controller. Dynamic spawning, multiple proxies, and interpolation remain out of scope.
This commit is contained in:
2026-05-31 22:21:39 +12:00
parent 49819813da
commit 46b2fa8b9b
9 changed files with 376 additions and 48 deletions
+11 -5
View File
@@ -22,8 +22,10 @@ both send and receive paths:
8. The server broadcasts `disconnect` packets when clients disconnect.
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`.
The Fallout 4 plugin still does not spawn or move remote actors.
The Fallout 4 plugin still does not dynamically spawn remote actors.
## Main Components
@@ -36,10 +38,11 @@ The native plugin is responsible for:
- Sending local player data to the server
- 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
thread
Planned later:
- Applying remote player updates safely
- Spawning or moving remote actors
### External Server
@@ -86,17 +89,20 @@ Current approach:
```text
Networking thread receives packets
Networking thread stores remote player state
Game update reads remote player state
Future game update applies actor movement
Game update reads a copied remote player snapshot
Game update moves the placed test proxy actor
```
The networking receive thread does not directly modify Fallout 4 actors or game
objects. It parses newline-separated JSON, updates plain C++ remote-player
state, and leaves actor spawning or movement for a later game-thread milestone.
state, and leaves actor access to `F4TProxyActorController` on the game-thread
update path.
## Out Of Scope For Current Prototype
- Remote actor spawning
- Multiple proxy actors
- Interpolation or smoothing
- Combat sync
- Quest sync
- Inventory sync
+38 -1
View File
@@ -606,4 +606,41 @@ Use this format for future updates:
- Replace local-player-offset movement with remote player state movement.
- Only move the proxy when the remote player is in the same cell/worldspace.
- Snap movement first.
- Add smoothing/interpolation later.
- Add smoothing/interpolation later.
## 2026-05-31
### What Changed
- Changed the proxy actor controller plan from local-player-offset movement to
remote-state-driven movement.
- The placed proxy actor `F4TProxyRemotePlayer01REF` now represents the lowest
available remote `playerId` from a copied remote-player snapshot.
- Proxy movement remains game-thread-only and throttled to roughly 5 Hz.
- The networking receive thread still only parses packets and updates plain
remote-player state.
- Relaxed receive-side transform validation so interior/test-cell packets only
require `cellId`; missing `worldspaceId` is stored as an empty string.
- Added a same-test-cell proxy movement log for `F4TTestCell01`.
### What Worked
- Existing proxy actor lookup and safe handle caching were preserved.
- The local-player-offset safety movement remains available as a debug fallback
mode in code.
### What Broke
- Not tested in-game yet.
### Notes
- The proxy is left wherever it last moved after a remote disconnect for now.
- Dynamic spawning, multiple proxy actors, interpolation, and gameplay sync are
still intentionally out of scope.
### Next Steps
- Build the plugin with `xmake build`.
- Run the single-client, two-client, and disconnect tests in `F4TTestCell01`.