Document local networking prototype and protocol

Expand documentation to describe the current local networking prototype and its protocol. Adds a Current Architecture section and Fake Client responsibilities, clarifies that the Fallout 4 plugin currently only sends transforms (no receive loop yet), and documents implemented message types (welcome, transform, disconnect) with packet field descriptions and examples. Update player-sync and packets docs to reflect movementType, server/client timestamps, and the in-memory remote player state model used by server/fake_client.py. Flesh out server/README with run/test flow and implemented behavior. Revise dev-log with milestone entries, testing notes, and an entry template for future updates.
This commit is contained in:
2026-05-31 19:28:58 +12:00
parent 52d934dab0
commit d724d7404c
6 changed files with 435 additions and 172 deletions
+58 -1
View File
@@ -1,5 +1,30 @@
# Architecture
## Current Architecture
```text
Fallout 4 Plugin
↓
Local Python Server
↓
Fake Client Remote Player State
```
The current system is one-way from the Fallout 4 plugin to the fake client:
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`.
3. The server assigns `playerId` values and sends `welcome` packets.
4. The server adds `playerId` and `serverTime` to transform packets.
5. The server broadcasts transform packets to other connected clients.
6. `server/fake_client.py` stores remote player state by `playerId`.
7. The server broadcasts `disconnect` packets when clients disconnect.
8. The fake client removes disconnected players from its remote player table.
The Fallout 4 plugin does not yet receive remote transforms from the server.
There is no plugin receive loop and no remote actor spawning yet.
## Main Components
### F4SE Plugin
@@ -9,8 +34,13 @@ The native plugin is responsible for:
- Loading into Fallout 4
- Reading local player state
- Sending local player data to the server
Planned later:
- Receiving remote player data
- Storing remote player state inside the plugin
- Applying remote player updates safely
- Spawning or moving remote actors
### External Server
@@ -18,13 +48,28 @@ The server is responsible for:
- Accepting client connections
- Assigning player IDs
- Sending welcome packets
- Receiving player state
- Broadcasting player state
- Tracking disconnects
- Broadcasting disconnect packets
### Fake Client
The fake client is responsible for:
- Connecting to the local server
- Receiving welcome packets
- Receiving broadcast transform packets
- Storing remote player state by `playerId`
- Removing remote players when disconnect packets arrive
The fake client is a temporary receiver for testing the networking lifecycle. It
does not spawn remote actors or represent playable multiplayer.
### Creation Kit Plugin
The Creation Kit side is responsible for:
The Creation Kit side is planned later and may be responsible for:
- Test cells
- Placeholder actors
@@ -34,6 +79,8 @@ The Creation Kit side is responsible for:
## Threading Model
This is planned for the Fallout 4 receiving client. It is not implemented yet.
Networking should run separately from game update logic.
Recommended approach:
@@ -46,3 +93,13 @@ Game update applies actor movement
```
The networking thread should avoid directly modifying Fallout 4 game objects unless the operation is known to be safe.
## Out Of Scope For Current Prototype
- Fallout 4 receive-loop processing
- Remote actor spawning
- Combat sync
- Quest sync
- Inventory sync
- Settlement sync
- Public servers or matchmaking
+128 -68
View File
@@ -1,19 +1,20 @@
# Development Log
This file tracks the development progress of Fallout 4 Together.
This file tracks development progress for Fallout 4 Together.
Use this log to record setup decisions, tool versions, technical discoveries, failed experiments, and successful tests.
Use this log to record setup decisions, tool versions, technical discoveries,
failed experiments, successful tests, and next steps.
---
## 2026-05-30
## 2026-05-30 - Repository Setup
### Repo Setup
### What Changed
* Created the Fallout 4 Together repository.
* Added the initial repository folder structure.
* Added starter Markdown documentation files.
* Added project roadmap, disclaimer, setup notes, protocol notes, and plugin planning documents.
- Created the Fallout 4 Together repository.
- Added the initial repository folder structure.
- Added starter Markdown documentation files.
- Added project roadmap, disclaimer, setup notes, protocol notes, and plugin planning documents.
### Current Focus
@@ -21,21 +22,21 @@ The current focus is setting up the early development environment before writing
The immediate priority is to make sure the project has:
* A documented target Fallout 4 version
* A documented F4SE version
* A chosen CommonLibF4 plugin template
* A clean Fallout 4 test profile
* A basic native plugin that can load through F4SE
- A documented target Fallout 4 version
- A documented F4SE version
- A chosen CommonLibF4 plugin template
- A clean Fallout 4 test profile
- A basic native plugin that can load through F4SE
### Decisions Made
* Project name: Fallout 4 Together
* Internal prefix: F4T
* Primary target platform: Steam Fallout 4
* First prototype goal: two clients in a controlled test cell, with each player visible as a synced remote actor
* Early test cell name: F4TTestCell01
* Early test ESP name: Fallout4Together_Test.esp
* Early plugin DLL name: Fallout4Together.dll
- Project name: Fallout 4 Together
- Internal prefix: F4T
- Primary target platform: Steam Fallout 4
- First prototype goal: two clients in a controlled test cell, with each player visible as a synced remote actor
- Early test cell name: F4TTestCell01
- Early test ESP name: Fallout4Together_Test.esp
- Early plugin DLL name: Fallout4Together.dll
### Current Status
@@ -50,46 +51,19 @@ No Creation Kit test cell yet
### Next Steps
* Add `docs/version-targets.md` to the repository.
* Fill in the exact installed Fallout 4 version.
* Fill in the exact installed F4SE version.
* Choose a CommonLibF4 plugin template.
* Create the first GitHub milestones.
* Create the first GitHub issues.
* Set up a clean Fallout 4 test profile.
* Build an empty F4SE plugin.
* Confirm the empty plugin loads in Fallout 4.
- Add `docs/version-targets.md` to the repository.
- Fill in the exact installed Fallout 4 version.
- Fill in the exact installed F4SE version.
- Choose a CommonLibF4 plugin template.
- Create the first GitHub milestones.
- Create the first GitHub issues.
- Set up a clean Fallout 4 test profile.
- Build an empty F4SE plugin.
- Confirm the empty plugin loads in Fallout 4.
---
## Template Entry
Use this format for future updates:
```markdown
## YYYY-MM-DD
### What Changed
-
### What Worked
-
### What Broke
-
### Notes
-
### Next Steps
-
```
## 2026-05-31
## 2026-05-31 - Initial DLL Load
### What Changed
@@ -120,8 +94,9 @@ Use this format for future updates:
- Launch through F4SE again.
- Confirm `Fallout4Together.log` is created.
---
## 2026-05-31
## 2026-05-31 - Plugin Identity Renamed
### What Changed
@@ -151,7 +126,9 @@ Use this format for future updates:
- Confirm the updated message appears in `Fallout4Together.log`.
- Begin testing local player position readout.
## 2026-05-31
---
## 2026-05-31 - Local Player Position Readout
### What Changed
@@ -174,10 +151,14 @@ Use this format for future updates:
### Notes
- The first successful player position log was:
```text
Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
```
---
## 2026-05-31
## 2026-05-31 - Movement Logging Throttled
### What Changed
@@ -207,7 +188,9 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
- Send player transform data from the plugin to the server.
- Keep the first network test local-only.
## 2026-05-31
---
## 2026-05-31 - Local Server Connection
### What Changed
@@ -243,7 +226,9 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
- Have the server echo/broadcast transform packets to connected clients.
- Add a fake test client before attempting a second Fallout 4 client.
## 2026-05-31
---
## 2026-05-31 - Transform Metadata Added
### What Changed
@@ -278,7 +263,10 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
- Add server-side client IDs.
- Make the server broadcast transform packets to other connected clients.
- Create a fake client to receive broadcast packets.
## 2026-05-31
---
## 2026-05-31 - Server Broadcast And Fake Client
### What Changed
@@ -317,7 +305,9 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
- Add protocol documentation for `playerId`, `clientTime`, and `serverTime`.
- Begin planning remote player state storage on the receiving client.
## 2026-05-31
---
## 2026-05-31 - Full Broadcast Flow Tested
### What Changed
@@ -355,7 +345,9 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
- Store position, rotation, cellId, worldspaceId, movementType, and last update time.
- Print a readable remote player state table.
## 2026-05-31
---
## 2026-05-31 - Fake Client Remote State
### What Changed
@@ -388,7 +380,9 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
- Add disconnect packet broadcasting so fake clients can remove disconnected remote players.
- Then begin planning a plugin receive loop for server messages.
## 2026-05-31
---
## 2026-05-31 - Client Time Fixed
### What Changed
@@ -418,7 +412,9 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
- Add disconnect packets when a client leaves.
- Have fake clients remove remote players when disconnect packets are received.
## 2026-05-31
---
## 2026-05-31 - Disconnect Lifecycle
### What Changed
@@ -449,4 +445,68 @@ Player position: X=2048.00, Y=2048.00, Z=0.00, AngleZ=0.00
- Add protocol documentation for welcome, transform, and disconnect packets.
- Begin planning a Fallout 4 plugin receive loop.
- Store remote player state inside the plugin, without spawning actors yet.
- Store remote player state inside the plugin, without spawning actors yet.
---
## 2026-05-31 - Protocol Documentation Updated
### What Changed
- Documented the current networking protocol.
- Documented welcome, transform, and disconnect packets.
- Documented the fake client remote player state model.
- Documented the current server and fake client test flow.
### What Worked
- The networking lifecycle now includes connect, welcome, transform broadcast, disconnect broadcast, and remote-player cleanup.
- `clientTime` and `serverTime` are both present in transform packets.
- The fake client can store and remove remote player state.
### What Broke
- Nothing recorded.
### Notes
- The Fallout 4 plugin does not yet receive server packets.
- The current receiver is `server/fake_client.py`.
- The next technical milestone is a Fallout 4 plugin receive loop that stores remote player state internally.
### Next Steps
- Add a plugin receive loop.
- Parse welcome, transform, and disconnect packets in the plugin.
- Store remote player state inside the plugin.
- Do not spawn remote actors yet.
---
## Entry Template
Use this format for future updates:
```markdown
## YYYY-MM-DD - Milestone Title
### What Changed
- ...
### What Worked
- ...
### What Broke
- ...
### Notes
- ...
### Next Steps
- ...
```