Add basic movement state to transform packets
Add optional movement-state fields (isMoving, isSprinting, isSneaking, isJumping, weaponDrawn, movementSpeed) to transform packets and wire them end-to-end. Plugin changes: extend F4TNetworking API and RemotePlayerState, derive movement speed/jump state on the game-thread, validate values, include fields when formatting transform JSON, and add throttled remote movement-state logging. main.cpp adds sampling, speed/vertical calculations, jump hold logic, and change-detection to avoid extra sends. Networking parsing (F4TNetworking.cpp) reads optional booleans/floats safely, preserves backwards compatibility, and clears movement-state logs on disconnect. Proxy controller includes a TODO note for future animation use. Server and docs: update protocol and packet docs, dev-log, server README, and fake_client.py to parse/display optional fields safely. Also add several .cursor rule files for coding, documentation, protocol, project overview, and testing guidance. This milestone prepares the data model for later animation/behavior work while keeping existing relay behavior unchanged.
This commit is contained in:
+14
-9
@@ -12,18 +12,20 @@ The current system is still a local prototype, but the Fallout 4 plugin now has
|
||||
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
|
||||
2. The plugin derives basic movement state on the game-thread polling path and
|
||||
sends it as optional data on transform packets.
|
||||
3. The plugin sends transform packets to the local Python server on
|
||||
`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.
|
||||
6. The server broadcasts transform packets to other connected clients.
|
||||
7. The plugin and `server/fake_client.py` store remote player state by `playerId`.
|
||||
8. The server broadcasts `disconnect` packets when clients disconnect.
|
||||
9. The plugin and fake client remove disconnected players from their remote
|
||||
4. The server assigns `playerId` values and sends `welcome` packets.
|
||||
5. The plugin receives its `welcome` packet and stores its assigned `playerId`.
|
||||
6. The server adds `playerId` and `serverTime` to transform packets.
|
||||
7. The server broadcasts transform packets to other connected clients.
|
||||
8. The plugin and `server/fake_client.py` store remote player state by `playerId`.
|
||||
9. The server broadcasts `disconnect` packets when clients disconnect.
|
||||
10. 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
|
||||
11. On the game-thread update path, the plugin reads a copied remote-player
|
||||
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,
|
||||
@@ -40,6 +42,7 @@ The native plugin is responsible for:
|
||||
- Loading into Fallout 4
|
||||
- Reading local player state
|
||||
- Sending local player data to the server
|
||||
- Adding basic data-only movement state to transform packets
|
||||
- Throttling normal transform sends separately from readable local movement logs
|
||||
- Receiving server packets on a background thread
|
||||
- Storing assigned and remote `playerId` state internally
|
||||
@@ -93,6 +96,7 @@ Current approach:
|
||||
|
||||
```text
|
||||
Game update reads local player transform
|
||||
Game update derives basic movement state
|
||||
Game update sends thresholded transform packets around 10 Hz while moving
|
||||
Game update logs local movement around 1 Hz
|
||||
Networking thread receives packets
|
||||
@@ -110,6 +114,7 @@ update path.
|
||||
|
||||
- Remote actor spawning
|
||||
- Multiple proxy actors
|
||||
- Animation graph sync or animation application
|
||||
- Combat sync
|
||||
- Quest sync
|
||||
- Inventory sync
|
||||
|
||||
@@ -717,6 +717,50 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
|
||||
|
||||
---
|
||||
|
||||
## 2026-06-02 - Basic Movement State Sync
|
||||
|
||||
### What Changed
|
||||
|
||||
- Added data-only movement state fields to transform packets:
|
||||
`isMoving`, `isSprinting`, `isSneaking`, `isJumping`, `weaponDrawn`, and
|
||||
`movementSpeed`.
|
||||
- Derived local movement speed from sampled position delta over elapsed time on
|
||||
the game-thread polling path.
|
||||
- Stored optional movement state fields in remote-player state with safe
|
||||
defaults for older packets.
|
||||
- Added throttled remote movement-state logs so packet data can be inspected
|
||||
without logging every transform.
|
||||
- Updated `server/fake_client.py` to display movement state while keeping
|
||||
missing fields backwards compatible.
|
||||
|
||||
### What Worked
|
||||
|
||||
- The server relay remains unchanged because it preserves unknown transform
|
||||
fields when it adds `playerId` and `serverTime`.
|
||||
- The networking receive thread remains actor-free and only updates plain
|
||||
remote-player state.
|
||||
- Proxy actor movement remains unchanged; movement state is not applied to
|
||||
animations yet.
|
||||
|
||||
### What Broke
|
||||
|
||||
- Nothing recorded.
|
||||
|
||||
### Notes
|
||||
|
||||
- This milestone prepares the remote-player data model for later proxy
|
||||
animation or behavior work.
|
||||
- Dynamic spawning, multiple proxy actors, animation graph sync, combat,
|
||||
inventory, quest, settlement, and interaction sync remain out of scope.
|
||||
|
||||
### Next Steps
|
||||
|
||||
- Test with two Fallout 4 clients in `F4TTestCell01`.
|
||||
- Use the synced state in a later animation milestone without expanding
|
||||
gameplay sync scope.
|
||||
|
||||
---
|
||||
|
||||
## Entry Template
|
||||
|
||||
Use this format for future updates:
|
||||
|
||||
Reference in New Issue
Block a user