From dec07d993e1fb52b10a5c823c5db1eecad04910b Mon Sep 17 00:00:00 2001 From: scove Date: Wed, 8 Apr 2026 12:24:14 +0700 Subject: [PATCH] 1 --- README.md | 70 +++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 006d37ef..cee386b6 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ Hệ thống điều khiển nhân vật không chỉ quản lý hành động m stateDiagram-v2 direction TB - state "🌸 GROUND LOCOMOTION" as Ground { + state "🌸 GROUND" as Ground { [*] --> Idle state Idle { @@ -170,7 +170,7 @@ stateDiagram-v2 Sneaking --> Moving : "Release Sneak" } - state "☁️ AIRBORNE & IMPACT" as Air { + state "☁️ AIRBORNE" as Air { state Jump { J_P: 🆙 AddForce Up } @@ -185,7 +185,7 @@ stateDiagram-v2 Falling --> Landing : "IsGrounded == true" } - state "⚡ ACTION LAYER" as Utility { + state "⚡ ACTION" as Utility { state Dashing { D_P: 💨 Burst 15m/s } @@ -194,21 +194,29 @@ stateDiagram-v2 } } - state "🌐 NETWORK SYNC" as Net { + state "🌐 NETWORK" as Net { state "Input Authority" as IA state "State Authority" as SA - IA --> SA : "Send [Networked] Rotation" - SA --> IA : "Reconciliation if Error" + IA --> SA : "Send Input" + SA --> IA : "Reconcile" } - %% Transitions chính - Đã sửa lỗi tại đây ✨ + %% Transitions chính Ground --> Air : "IsGrounded == false" Air --> Ground : "OnLand Event" - Ground --> Utility : "OnAbilityTrigger" - Utility --> Ground : "Action Complete" + Ground --> Utility : "OnAbility" + Utility --> Ground : "Complete" - note left of Ground : ✨ Sync: Velocity, MoveState - note right of Net : ⚙️ Fusion: FixedUpdateNetwork + %% Sửa lỗi Note bằng cấu trúc block ✨ + note left of Ground + ✨ Sync: Velocity + ✨ State: MoveState + end note + + note right of Net + ⚙️ Photon Fusion + ⚙️ FixedUpdateNetwork + end note ``` ### 2. Environment Scanner & Interaction @@ -297,50 +305,40 @@ sequenceDiagram autonumber participant IR as 🖱️ Input - box #E3F2FD "CLIENT" - participant CP as 🎀 Local Player + box #E3F2FD "🌸 CLIENT" + participant CP as 🎀 Player end - box #FFF3E0 "NET" + box #FFF3E0 "🌐 NET" participant NT as ✨ Fusion end - box #E8F5E9 "SERVER" + box #E8F5E9 "🖥️ SERVER" participant S as 👑 Authority end - box #F3E5F5 "OTHERS" - participant RP as 🍭 Proxies - end Note over IR, CP: [TICK N] Thu thập Input ✨ IR->>CP: OnMove / OnJump - CP->>CP: 📦 Pack NetworkInputData + CP->>CP: 📦 Pack Data rect rgb(255, 250, 240) - Note over CP, NT: Prediction Mode 🚀 - CP->>CP: 🏃 Client-Side Prediction - CP->>NT: ✉️ Send Packet - NT-->>S: UDP Transport + Note over CP, NT: Prediction Mode 🚀 + CP->>CP: 🏃 Local Prediction + CP->>NT: ✉️ Send Packet end rect rgb(240, 255, 240) - Note right of S: SERVER VALIDATION ⚖️ - S->>S: 📝 Check Collision & Move - S->>S: 💾 Update [Networked] State + Note right of S: SERVER VALIDATION ⚖️ + S->>S: 📝 Check Physics + S->>S: 💾 Update State end S-->>NT: 📣 Broadcast Snapshot - par 💫 To Local - NT-->>CP: Snapshot - Note over CP: 🔄 RECONCILE - and 🌈 To Proxies - NT-->>RP: Snapshot - Note over RP: 🎞️ INTERPOLATE - end + NT-->>CP: Snapshot + Note over CP: 🔄 RECONCILE (Fix Lag) rect rgb(250, 245, 255) - Note over CP, RP: [LateUpdate] Rendering 🎨 - CP->>CP: Camera Shake - RP->>RP: Smooth Mesh Lerp + Note over CP: [LateUpdate] Rendering 🎨 + CP->>CP: Shake & VFX end ```