Add optional apparel sync (equippedItems)

Introduce an optional equippedItems transform extension to snapshot tracked visible apparel slots. Plugin: capture local equipped ARMO form IDs on the game-thread, include equippedItems in transform packets, parse equippedItems on the networking thread, and apply/clear synced apparel on runtime proxies (with defensive logging for missing forms). Server: fake_client parses and prints equippedItems. Docs and protocol updated; changelog and dev-log entry added. Backwards-compatible: equippedItems is optional and empty formId denotes intentional unequip.
This commit is contained in:
2026-06-29 16:02:03 +12:00
parent d0649667f7
commit ad7f287899
13 changed files with 635 additions and 82 deletions
+11 -5
View File
@@ -12,8 +12,9 @@ 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 derives basic movement state on the game-thread polling path and
sends it as optional data on transform packets.
2. The plugin derives basic movement state and captures a visible equipped
apparel snapshot on the game-thread polling path, then sends both as optional
data on transform packets.
3. The plugin sends transform packets to the Python relay server. The default
dev setup connects to `127.0.0.1:7777` on the same PC; the server itself
listens on `0.0.0.0:7777` so other machines can connect using the host
@@ -71,9 +72,10 @@ both send and receive paths:
actor.
17. Proxy visual updates are independent per slot. Normal movement is smoothed
toward that player’s latest target, while `cell_change`, `worldspace_change`,
and `teleport` snap directly. Movement and animation-related remote state is
still observed and logged only; no visual crouch/sneak, jump, weapon drawn,
locomotion, animation graph, or actor-state application is attempted.
and `teleport` snap directly. Curated locomotion animation graph variables
and optional equipped apparel snapshots are applied on the game thread after
the proxy has loaded 3D. Visual crouch, full weapon model state, power armor,
and raw actor-state bitfield application remain outside the current sync path.
18. When a remote player leaves the cell or disconnects, only that player’s
runtime proxy is moved to the hidden holding position inside
`F4TTestCell01`. Runtime actors are not disabled or deleted. Connected
@@ -164,6 +166,7 @@ The native plugin is responsible for:
- Suppressing local transform sends and remote proxy representation while the
local player is in solo cells such as `COVault109`
- Adding basic data-only movement state to transform packets
- Adding optional visible equipped apparel snapshots 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
@@ -195,6 +198,9 @@ The native plugin is responsible for:
- Applying curated Havok animation graph variables to runtime proxies through
`F4TProxyAnimationSync` from the same remote movement state (writes on
transition and while moving; clears on hold, disconnect, reuse, and reassignment)
- Applying optional `equippedItems` apparel snapshots to runtime proxies after
proxy 3D is ready, including explicit tracked-slot unequips for removed
clothing, hats, and eyewear
- Suppressing exposed AI movement intent for runtime proxies by clearing safe
process target handles and using validated package interruption/do-nothing
calls when combat, pathing, flee/alarm, bump, or package movement state is
+51
View File
@@ -9,6 +9,57 @@ failed experiments, successful tests, and next steps.
---
## 2026-06-29 - Clothing Sync
### Summary
Added the first visible apparel sync path so transform packets can carry equipped clothing/armor slot snapshots and runtime proxies can mirror normal clothing, hat, and eyewear changes.
### Files Changed
- `plugin/include/F4TRemotePlayerState.h`
- `plugin/include/F4TNetworking.h`
- `plugin/src/F4TNetworking.cpp`
- `plugin/src/main.cpp`
- `plugin/src/F4TProxyActorController.cpp`
- `server/fake_client.py`
- `protocol/packets.md`
- `protocol/player-sync.md`
- `docs/protocol.md`
- `docs/architecture.md`
- `changelog.md`
- `docs/dev-log.md`
### Details
- Added optional `equippedItems` transform data as a complete snapshot of tracked visible apparel biped slots. Empty `formId` values explicitly mean the remote player has nothing equipped in that tracked slot.
- Captured local equipment on the game-thread polling path and made equipment changes trigger a transform send even when the player is idle.
- Parsed remote equipment defensively on the networking thread, preserving compatibility with older clients that omit the field.
- Applied synced apparel on the proxy controller's game-thread path after proxy 3D is loaded, with throttled warnings for missing local ARMO forms.
- Cleared synced equipment when runtime proxy slots are held, reused, reassigned, or invalidated so a later remote player does not inherit the previous player's outfit.
### Testing
- Ran `python -m py_compile server\fake_client.py`; syntax check passed.
- Ran `build.bat`; plugin build succeeded. The build still reports pre-existing-style unreachable-code warnings in proxy/local animation debug code.
- In-game testing still needs to be run.
- Expected relay result: `server/fake_client.py` prints `equippedItems` from transform packets and old packets without the field still parse.
- Manual multiplayer checklist:
- Start the Python server and connect one Fallout 4 instance.
- Connect a second Fallout 4 instance in the same playable cell.
- Verify outgoing plugin transform packets include `equippedItems` after connect and after clothing changes.
- Verify the server receives and relays the field without dropping movement fields.
- Verify the receiving plugin parses remote equipment without warnings for valid vanilla apparel forms.
- Equip and unequip body clothing, a hat/helmet, and eyewear; then remove all clothing and confirm the proxy follows visually.
- Check `CommonwealthOnline.log` for equipment apply, missing-form, and proxy 3D recovery messages.
### Known Issues
- Power armor and weapon model visuals are not part of this milestone.
- Legendary instance data, condition, tint/material overrides, and receiver-missing modded forms are not replicated.
- In-game confirmation is still needed to verify `ActorEquipManager` plus 3D refresh reliably updates all target apparel pieces on runtime proxies.
### Next Steps
- Run the two-client in-game checklist.
- If some apparel pieces fail to appear, inspect whether they require equip-slot instance data or a different biped-slot coverage list.
---
## 2026-06-29 - Stale Runtime Proxy Adoption Fix
### Summary
+5
View File
@@ -59,3 +59,8 @@ If UDP discovery is unavailable, the plugin may fall back to probing
## Main Rule
The protocol should be testable outside Fallout 4 before it is used inside the F4SE plugin.
`transform` packets carry position, movement state, and optional
`equippedItems` apparel snapshots for visible clothing/armor proxy sync. The
canonical field list and compatibility rules live in
[`protocol/packets.md`](../protocol/packets.md).