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

@@ -326,6 +326,41 @@ flowchart TD
- The drain rate map supports runtime modification for buffs/debuffs (e.g. Adrenaline reduces sprint cost).
- UI widgets should bind to OnStaminaChanged for smooth bar animation, not tick polling.
- For multiplayer: Server authorises all DrainStamina calls; client predicts and corrects on repnotify.
---
## 11. Multiplayer Networking (Expanded)
### Server RPCs
| RPC | Direction | Description |
|-----|-----------|-------------|
| `Server_DrainStamina` | Client→Server | Client requests stamina drain for action. Server validates MinStamina, applies. |
| `Server_StartContinuousDrain` | Client→Server | Client starts sprinting. Server begins drain timer. |
| `Server_StopContinuousDrain` | Client→Server | Client stops sprinting. Server stops drain, begins regen. |
| `Server_RestoreStamina` | Client→Server | Client uses stamina item. Server validates item, applies restore. |
### Authority Gates
```
Function DrainStamina(ActionType)
If HasAuthority:
→ Check cooldown, MinStamina
→ Apply drain, update exhaustion, fire dispatchers
Else:
→ Client predicts stamina bar decrease for responsiveness
→ Server_ RPC called; server corrects via OnRep if wrong
Function SetMaxStamina(NewMax, bMaintainRatio)
If NOT HasAuthority → Return
→ Apply change, fire dispatchers, auto-replicates
```
### Client Prediction
- **Stamina bar:** Client predicts decrease on sprint/jump. Server corrects via `OnRep_CurrentStamina`.
- **Exhaustion:** ExhaustionState replicated. Client plays breathing audio locally.
- **Cooldowns:** Server-authoritative. Client shows cooldown timer after server confirms action.
- Exhaustion state can drive conditional audio: heavy breathing, heart-beat, fatigue voice lines.
---