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:
@@ -63,6 +63,12 @@ Example after server processing:
|
||||
"cellId": "0000DD60",
|
||||
"worldspaceId": "0000003C",
|
||||
"clientTime": 1780212128.301,
|
||||
"isMoving": true,
|
||||
"isSprinting": false,
|
||||
"isSneaking": false,
|
||||
"isJumping": false,
|
||||
"weaponDrawn": false,
|
||||
"movementSpeed": 186.4,
|
||||
"serverTime": 1780212128.3011043
|
||||
}
|
||||
```
|
||||
@@ -80,6 +86,12 @@ movementType Movement classification for this transform update.
|
||||
cellId Current cell form ID as a string.
|
||||
worldspaceId Current worldspace form ID as a string.
|
||||
clientTime Timestamp generated by the sending plugin.
|
||||
isMoving Optional movement-state flag; defaults to false when missing.
|
||||
isSprinting Optional movement-state flag; defaults to false when missing.
|
||||
isSneaking Optional movement-state flag; defaults to false when missing.
|
||||
isJumping Optional movement-state flag; defaults to false when missing.
|
||||
weaponDrawn Optional weapon drawn state; defaults to false when missing.
|
||||
movementSpeed Optional derived movement speed in game units per second; defaults to 0.0 when missing.
|
||||
serverTime Timestamp added by the server before broadcast.
|
||||
```
|
||||
|
||||
@@ -95,6 +107,9 @@ teleport
|
||||
`cell_change` and `worldspace_change` are currently represented through
|
||||
`movementType` inside transform packets. They are not separate packet types yet.
|
||||
|
||||
Movement state fields are data-only for now. Receivers must treat them as
|
||||
optional and must not reject older transform packets when they are absent.
|
||||
|
||||
### Disconnect Packet
|
||||
|
||||
Sent by the server to remaining connected clients when a client disconnects.
|
||||
|
||||
@@ -46,12 +46,21 @@ cellId
|
||||
worldspaceId
|
||||
clientTime
|
||||
serverTime
|
||||
isMoving
|
||||
isSprinting
|
||||
isSneaking
|
||||
isJumping
|
||||
weaponDrawn
|
||||
movementSpeed
|
||||
lastReceivedLocalTime
|
||||
```
|
||||
|
||||
Required transform packet fields are `type`, `playerId`, `x`, `y`, `z`,
|
||||
`angleZ`, and `cellId`. `worldspaceId`, `movementType`, `clientTime`, and
|
||||
`serverTime` are optional; interior test cells may omit `worldspaceId`.
|
||||
Movement state fields are also optional and default to not moving, not
|
||||
sprinting, not sneaking, not jumping, weapon holstered, and speed `0.0` when
|
||||
missing.
|
||||
|
||||
This model proves the data shape and lifecycle before spawning remote actors.
|
||||
For the current visual milestone, the controller represents only one remote
|
||||
@@ -80,6 +89,8 @@ player exists.
|
||||
- Normal proxy movement is smoothed toward the latest received target, while
|
||||
`cell_change`, `worldspace_change`, and `teleport` transforms snap directly to
|
||||
avoid slow movement across large discontinuities.
|
||||
- Transform packets now include basic movement state data for future animation
|
||||
work, but the proxy actor does not apply animations from that state yet.
|
||||
|
||||
## Transform Cadence
|
||||
|
||||
@@ -97,6 +108,7 @@ remote transform state on the networking thread and moves actors only from the
|
||||
game-thread proxy controller.
|
||||
|
||||
No Fallout 4 remote actor is dynamically spawned yet.
|
||||
No animation graph sync or animation application is implemented yet.
|
||||
|
||||
## Planned Later
|
||||
|
||||
|
||||
Reference in New Issue
Block a user