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
|
stateDiagram-v2
|
||||||
direction TB
|
direction TB
|
||||||
|
|
||||||
state "🌸 GROUND LOCOMOTION" as Ground {
|
state "🌸 GROUND" as Ground {
|
||||||
[*] --> Idle
|
[*] --> Idle
|
||||||
|
|
||||||
state Idle {
|
state Idle {
|
||||||
@@ -170,7 +170,7 @@ stateDiagram-v2
|
|||||||
Sneaking --> Moving : "Release Sneak"
|
Sneaking --> Moving : "Release Sneak"
|
||||||
}
|
}
|
||||||
|
|
||||||
state "☁️ AIRBORNE & IMPACT" as Air {
|
state "☁️ AIRBORNE" as Air {
|
||||||
state Jump {
|
state Jump {
|
||||||
J_P: 🆙 AddForce Up
|
J_P: 🆙 AddForce Up
|
||||||
}
|
}
|
||||||
@@ -185,7 +185,7 @@ stateDiagram-v2
|
|||||||
Falling --> Landing : "IsGrounded == true"
|
Falling --> Landing : "IsGrounded == true"
|
||||||
}
|
}
|
||||||
|
|
||||||
state "⚡ ACTION LAYER" as Utility {
|
state "⚡ ACTION" as Utility {
|
||||||
state Dashing {
|
state Dashing {
|
||||||
D_P: 💨 Burst 15m/s
|
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 "Input Authority" as IA
|
||||||
state "State Authority" as SA
|
state "State Authority" as SA
|
||||||
IA --> SA : "Send [Networked] Rotation"
|
IA --> SA : "Send Input"
|
||||||
SA --> IA : "Reconciliation if Error"
|
SA --> IA : "Reconcile"
|
||||||
}
|
}
|
||||||
|
|
||||||
%% Transitions chính - Đã sửa lỗi tại đây ✨
|
%% Transitions chính
|
||||||
Ground --> Air : "IsGrounded == false"
|
Ground --> Air : "IsGrounded == false"
|
||||||
Air --> Ground : "OnLand Event"
|
Air --> Ground : "OnLand Event"
|
||||||
Ground --> Utility : "OnAbilityTrigger"
|
Ground --> Utility : "OnAbility"
|
||||||
Utility --> Ground : "Action Complete"
|
Utility --> Ground : "Complete"
|
||||||
|
|
||||||
note left of Ground : ✨ Sync: Velocity, MoveState
|
%% Sửa lỗi Note bằng cấu trúc block ✨
|
||||||
note right of Net : ⚙️ Fusion: FixedUpdateNetwork
|
note left of Ground
|
||||||
|
✨ Sync: Velocity
|
||||||
|
✨ State: MoveState
|
||||||
|
end note
|
||||||
|
|
||||||
|
note right of Net
|
||||||
|
⚙️ Photon Fusion
|
||||||
|
⚙️ FixedUpdateNetwork
|
||||||
|
end note
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Environment Scanner & Interaction
|
### 2. Environment Scanner & Interaction
|
||||||
@@ -297,50 +305,40 @@ sequenceDiagram
|
|||||||
autonumber
|
autonumber
|
||||||
|
|
||||||
participant IR as 🖱️ Input
|
participant IR as 🖱️ Input
|
||||||
box #E3F2FD "CLIENT"
|
box #E3F2FD "🌸 CLIENT"
|
||||||
participant CP as 🎀 Local Player
|
participant CP as 🎀 Player
|
||||||
end
|
end
|
||||||
box #FFF3E0 "NET"
|
box #FFF3E0 "🌐 NET"
|
||||||
participant NT as ✨ Fusion
|
participant NT as ✨ Fusion
|
||||||
end
|
end
|
||||||
box #E8F5E9 "SERVER"
|
box #E8F5E9 "🖥️ SERVER"
|
||||||
participant S as 👑 Authority
|
participant S as 👑 Authority
|
||||||
end
|
end
|
||||||
box #F3E5F5 "OTHERS"
|
|
||||||
participant RP as 🍭 Proxies
|
|
||||||
end
|
|
||||||
|
|
||||||
Note over IR, CP: [TICK N] Thu thập Input ✨
|
Note over IR, CP: [TICK N] Thu thập Input ✨
|
||||||
IR->>CP: OnMove / OnJump
|
IR->>CP: OnMove / OnJump
|
||||||
CP->>CP: 📦 Pack NetworkInputData
|
CP->>CP: 📦 Pack Data
|
||||||
|
|
||||||
rect rgb(255, 250, 240)
|
rect rgb(255, 250, 240)
|
||||||
Note over CP, NT: Prediction Mode 🚀
|
Note over CP, NT: Prediction Mode 🚀
|
||||||
CP->>CP: 🏃 Client-Side Prediction
|
CP->>CP: 🏃 Local Prediction
|
||||||
CP->>NT: ✉️ Send Packet
|
CP->>NT: ✉️ Send Packet
|
||||||
NT-->>S: UDP Transport
|
|
||||||
end
|
end
|
||||||
|
|
||||||
rect rgb(240, 255, 240)
|
rect rgb(240, 255, 240)
|
||||||
Note right of S: SERVER VALIDATION ⚖️
|
Note right of S: SERVER VALIDATION ⚖️
|
||||||
S->>S: 📝 Check Collision & Move
|
S->>S: 📝 Check Physics
|
||||||
S->>S: 💾 Update [Networked] State
|
S->>S: 💾 Update State
|
||||||
end
|
end
|
||||||
|
|
||||||
S-->>NT: 📣 Broadcast Snapshot
|
S-->>NT: 📣 Broadcast Snapshot
|
||||||
|
|
||||||
par 💫 To Local
|
NT-->>CP: Snapshot
|
||||||
NT-->>CP: Snapshot
|
Note over CP: 🔄 RECONCILE (Fix Lag)
|
||||||
Note over CP: 🔄 RECONCILE
|
|
||||||
and 🌈 To Proxies
|
|
||||||
NT-->>RP: Snapshot
|
|
||||||
Note over RP: 🎞️ INTERPOLATE
|
|
||||||
end
|
|
||||||
|
|
||||||
rect rgb(250, 245, 255)
|
rect rgb(250, 245, 255)
|
||||||
Note over CP, RP: [LateUpdate] Rendering 🎨
|
Note over CP: [LateUpdate] Rendering 🎨
|
||||||
CP->>CP: Camera Shake
|
CP->>CP: Shake & VFX
|
||||||
RP->>RP: Smooth Mesh Lerp
|
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user