Files
Commonwealth-Online-Public/server
andrew 46b2fa8b9b 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.
2026-05-31 22:21:39 +12:00
..
2026-05-30 18:13:54 +12:00
2026-05-30 18:13:54 +12:00

Server

This folder is for the external multiplayer test server.

The current server is a tiny local-only TCP test server. It listens on 127.0.0.1:7777, accepts one or more clients, reads newline-separated JSON packets, assigns incrementing playerId values, sends welcome packets, adds playerId and serverTime to transform packets, broadcasts transform packets to every other connected client, and broadcasts disconnect packets when clients disconnect.

This is still a local prototype. It does not make Fallout 4 multiplayer playable yet.

Run

cd server
python server.py

Then launch Fallout 4 through F4SE and move the player. The plugin should send local player transform packets, and this server should print matching transform packets.

If the server is not running, the plugin should log a warning and Fallout 4 should continue launching normally.

Current Test Flow

Terminal 1:

cd server
python server.py

Terminal 2:

cd server
python fake_client.py

Then launch Fallout 4 through F4SE and move the player.

Expected behavior:

  • The server assigns a playerId to each connected client and sends each client a welcome packet.
  • The server receives transforms from the Fallout 4 plugin.
  • The server adds playerId and serverTime to each transform packet before broadcast.
  • The server broadcasts those transform packets to connected clients except the sender.
  • fake_client.py receives broadcast transform packets.
  • fake_client.py stores remote player state by playerId.
  • When a client disconnects, the server removes that client and broadcasts a disconnect packet with the departed playerId to the remaining clients.
  • fake_client.py removes disconnected players from its in-memory remote_players table.

The fake client exists so broadcast behavior can be tested before coordinating a second Fallout 4/F4SE instance. It stores remote player transform state only; it does not spawn remote actors or send movement.

Implemented

  • Start local server
  • Accept client connections
  • Assign server-owned player IDs
  • Send welcome packets
  • Receive transform packets
  • Add server timestamps
  • Broadcast transforms to other connected clients
  • Broadcast disconnect packets
  • Handle disconnect cleanup

Working In Fake Client Only

  • Receiving welcome packets
  • Receiving transform broadcasts
  • Storing remote player state
  • Removing disconnected remote players

The Fallout 4 plugin does not yet receive remote transforms from the server.

Planned Later

  • Fallout 4 plugin receive loop
  • Plugin-side remote player state storage
  • Remote actor spawning
  • Gameplay synchronization
  • Authentication
  • Public matchmaking
  • Anti-cheat
  • Persistence
  • Quest state
  • Settlement state
  • Large-scale world simulation