feat: Add multiplayer networking architecture and documentation updates

- Updated Master Blueprint Index to include Multiplayer Networking support.
- Added detailed Multiplayer Networking sections across all developer documentation (01-11).
- Introduced authority maps, key patterns, and RPC guidelines for each system.
- Established a comprehensive multiplayer networking architecture document outlining core principles, replication strategies, and anti-cheat considerations.
- Enhanced UI documentation to clarify local-only behavior and binding to replicated dispatchers.
- Implemented client prediction strategies and RPC naming conventions for consistency across the framework.
This commit is contained in:
Lefteris Notas
2026-05-19 17:15:57 +03:00
parent b2b6e1e7c7
commit 8bc731e5ae
35 changed files with 1259 additions and 11 deletions

View File

@@ -379,4 +379,29 @@ flowchart TD
---
## 11. Multiplayer Networking (Expanded)
### Replication
| Variable | Condition | Purpose |
|----------|-----------|---------|
| `CurrentTarget` | `Replicated` | Synced target for UI (other players see what you're looking at) |
### Server RPCs
| RPC | Direction | Description |
|-----|-----------|-------------|
| `Server_PerformInteraction` | Client→Server | Client requests interaction. Server validates range, conditions, then calls I_Interactable. |
### Authority
- **Detection** (trace, sorting, target selection): runs locally per client.
- **Interaction execution**: server-authoritative. Client calls `Server_PerformInteraction`; server validates and executes.
- `ForceSetTarget`: server-only for scripted interactions.
- `HighlightTarget`: local cosmetic effect per client.
### Client Prediction
- Interaction prompt: shown immediately based on local trace.
- Hold progress: shown locally; server confirms completion.
- Blocked feedback: shown locally if conditions fail client-side; server may also reject.
---
*Blueprint Spec: Interaction Detector. Conforms to TEMPLATE.md v1.0 — part of the UE5 Modular Game Framework.*

View File

@@ -283,4 +283,26 @@ sequenceDiagram
---
## 10. Multiplayer Networking
### Replicated Variables
| Variable | Condition | Purpose |
|----------|-----------|---------|
| `bOccupied` | `Replicated` | Other clients see spot as occupied |
| `LockedByPlayer` | `Replicated` | Synced lock state |
| `OccupantPawn` | `Replicated` | Who is hiding here (for third-person visibility) |
| `bIsVisible` | `Replicated` | Spot availability synced |
### Authority
- `OnPlayerEntered`/`OnPlayerExited` are called by the server-authoritative `BPC_HidingSystem`.
- `LockSpot`/`UnlockSpot` are server-only.
- `GetOccupancyStatus` is read-only, safe for any side.
### Server RPCs
| RPC | Direction | Description |
|-----|-----------|-------------|
| `Server_ClaimSpot` | Client→Server | Client requests occupying spot. Server validates availability. |
---
*Blueprint Spec: Hiding Spot Interface & Actor. Conforms to TEMPLATE.md v1.0 — part of the UE5 Modular Game Framework.*

View File

@@ -336,4 +336,38 @@ Player Presses Interact
- This renamed file (formerly `BPC_InteractableDoorComponent`) is now an Actor-based system (`BP_DoorActor`) as per Master Section 3.5.
- The door actor encapsulates all door logic directly rather than as an ActorComponent.
- Cross-references updated: `BPC_InventoryComponent``BPC_InventorySystem`, `BPC_LeverPuzzleComponent``BP_PuzzleDeviceActor`.
- Cross-references updated: `BPC_InventoryComponent``BPC_InventorySystem`, `BPC_LeverPuzzleComponent``BP_PuzzleDeviceActor`.
---
## 13. Multiplayer Networking (Expanded)
### Server RPCs
| RPC | Direction | Description |
|-----|-----------|-------------|
| `Server_Interact` | Client→Server | Client requests door interaction. Server validates range, state, lock, then executes TryOpen/TryClose. |
| `Server_DamageBarricade` | Client→Server | Client deals damage to barricade. Server validates damage source, applies to barricade health. |
| `Server_TryUnlock` | Client→Server | Client attempts unlock with key item. Server validates inventory, consumes item if configured. |
### Authority Gates
```
Interact_Implementation
If NOT HasAuthority:
→ Call Server_Interact(DoorActor)
→ Return (client prediction: show prompt, wait for OnRep)
// Server executes authoritative logic
→ TryOpen / TryClose / TryUnlock
→ OnRep broadcasts to all clients
```
### Client Prediction
- **Interaction:** Client calls `Server_Interact` RPC; server validates and changes state.
- **Animation:** `OnRep_DoorState` triggers animation on all clients identically.
- **Locked feedback:** Played locally by client when server rejects interaction.
### Anti-Cheat
- Server validates player is within interaction range before opening door.
- Server validates key item is in player inventory before unlocking.
- Server validates barricade damage source.