1
This commit is contained in:
70
README.md
70
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
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user