579 lines
38 KiB
Markdown
579 lines
38 KiB
Markdown
# README Template (Source of Truth)
|
|
|
|
This file serves as the master template for the project's root README.md.
|
|
Sections are modularized in the `sections/` directory.
|
|
|
|
# 
|
|
|
|
[](https://unity.com/)
|
|
[](https://www.photonengine.com/fusion)
|
|
[](https://opensource.org/licenses/MIT)
|
|
|
|
> **"Trong bóng tối của sự ảo giác, thị giác là công cụ mạnh mẽ nhất, nhưng sự tin tưởng lại là sai lầm chết người."**
|
|
|
|
**BABA_YAGA** là một dự án game PvP không đối xứng (Asymmetric PvP) đỉnh cao, nơi người chơi bước vào một cuộc đấu trí căng thẳng trong mê cung bóng tối. Một người nắm giữ **Ánh sáng (Seeker)**, người kia điều khiển **Cạm bẫy (Trapper)**. Đây không chỉ là trò chơi trốn tìm, đây là cuộc chiến về tâm lý và khả năng đọc tình huống.
|
|
|
|
---
|
|
|
|
## 
|
|
1. [Tầm nhìn Dự án (Project Vision)](#-tầm-nhìn-dự-án-project-vision)
|
|
2. [Cơ chế Trò chơi (Core Mechanics)](#-cơ-chế-trò-chơi-core-mechanics)
|
|
3. [Kiến trúc Kỹ thuật (Technical Architecture)](#-kiến-trúc-kỹ-thuật-technical-architecture)
|
|
4. [Hệ thống Mê cung (Maze Generation)](#-hệ-thống-mê-cung-maze-generation)
|
|
5. [Đồng bộ Mạng (Networking)](#-đồng-bộ-mạng-networking)
|
|
6. [Hệ thống Comeback (Comeback System)](#-hệ-thống-comeback-đa-tầng-tiered-adaptive-system)
|
|
7. [Lộ trình Phát triển (Roadmap)](#-lộ-trình-phát-triển-roadmap)
|
|
8. [Cấu trúc Thư mục (Folder Structure)](#-cấu-trúc-thư-mục-dự-án-project-folder-structure)
|
|
9. [Hướng dẫn Cài đặt (Installation)](#-hướng-dẫn-cài-đặt-installation)
|
|
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/eye.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Tầm nhìn Dự án (Project Vision)
|
|
|
|

|
|
|
|
Dự án hướng tới việc tạo ra một trải nghiệm **"High-Stakes Hide & Seek"**. Trọng tâm không nằm ở hành động nhanh mà ở sự **kiên nhẫn** và **tính toán**.
|
|
* **Minimalist UI:** Giảm thiểu UI để người chơi tập trung hoàn toàn vào môi trường.
|
|
* **Spatial Audio:** Âm thanh là "bản đồ" thứ hai.
|
|
* **Dynamic Lighting:** Ánh sáng không chỉ để nhìn, mà là công cụ để lộ diện hoặc ẩn mình.
|
|
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/gamepad-2.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Cơ chế Trò chơi (Core Mechanics)
|
|
|
|
### <img src="https://api.iconify.design/lucide/circle-dashed.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Sự bất đối xứng (The Asymmetry)
|
|
|
|
| Chỉ số | Seeker (Người Tìm Đường) | Trapper (Kẻ Đặt Bẫy) |
|
|
| :--- | :--- | :--- |
|
|
| **Vai trò** | Chủ động di chuyển, tìm lối thoát. | Phòng thủ, đặt bẫy, chặn đường. |
|
|
| **Tầm nhìn** | Góc nhìn thứ nhất (FPS), đèn pin giới hạn. | Góc nhìn tổng thể (Top-down) hoặc Camera an ninh. |
|
|
| **Tốc độ** | Nhanh (Sprinting: 9.0m/s). | Chậm hơn nhưng có khả năng dịch chuyển. |
|
|
| **Công cụ** | Đèn pin, Dash, Parkour. | Bẫy kẹp, Bẫy âm thanh, Khóa cửa. |
|
|
|
|
### <img src="https://api.iconify.design/lucide/refresh-cw.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Vòng lặp Gameplay & Kiến trúc Hệ thống (Game Loop & System Architecture)
|
|
|
|
```mermaid
|
|
graph TD
|
|
%% Định nghĩa Style cho các nhóm
|
|
classDef initStyle fill:#e1f5fe,stroke:#01579b,stroke-width:2px,color:#01579b;
|
|
classDef seekerStyle fill:#fff3e0,stroke:#e65100,stroke-width:2px,color:#e65100;
|
|
classDef trapperStyle fill:#f3e5f5,stroke:#4a148c,stroke-width:2px,color:#4a148c;
|
|
classDef netStyle fill:#eceff1,stroke:#263238,stroke-dasharray: 5 5,color:#263238;
|
|
classDef winStyle fill:#e8f5e9,stroke:#1b5e20,stroke-width:3px,color:#1b5e20;
|
|
classDef criticalStyle fill:#ffebee,stroke:#b71c1c,stroke-width:2px,color:#b71c1c;
|
|
|
|
%% Phase 1: Initialization
|
|
subgraph Initialization ["<b>1. KHỞI TẠO HỆ THỐNG (NET-SYNC)</b>"]
|
|
A["<img src="https://api.iconify.design/lucide/rocket.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Bắt đầu Trận đấu"] --> B{"<img src="https://api.iconify.design/lucide/handshake.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Matchmaking<br/>(Photon Fusion)"}
|
|
B --> C["<img src="https://api.iconify.design/lucide/masks-theater.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Phân vai: Seeker vs Trapper"]
|
|
C --> D["<img src="https://api.iconify.design/lucide/puzzle.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Maze Generator<br/>(Prims/Wilsons)"]
|
|
D --> E["<img src="https://api.iconify.design/lucide/building-2.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Baking NavMesh & Colliders"]
|
|
E --> F["<img src="https://api.iconify.design/lucide/user.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Character Auto-Setup"]
|
|
F --> G["<img src="https://api.iconify.design/lucide/map-pin.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Spawn Players"]
|
|
end
|
|
class Initialization,A,B,C,D,E,F,G initStyle;
|
|
|
|
%% Phase 2: Core Loop
|
|
subgraph Active_Round ["<b>2. VÒNG LẶP CHIẾN ĐẤU (CORE LOOP)</b>"]
|
|
G --> Loop((TICK: FixedUpdateNetwork))
|
|
|
|
%% Seeker Branch
|
|
subgraph Seeker_Logic ["<b><img src="https://api.iconify.design/lucide/run.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> SEEKER (POV 1st)</b>"]
|
|
S1["<img src="https://api.iconify.design/lucide/keyboard.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Input: WASD/Space"] --> S2["<img src="https://api.iconify.design/lucide/run.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> State: Move/Dash"]
|
|
S2 --> S3{"<img src="https://api.iconify.design/lucide/zap.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Hành động?"}
|
|
S3 -- "Sprinting" --> S4["<img src="https://api.iconify.design/lucide/volume-2.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Noise Up"]
|
|
S3 -- "Sneaking" --> S5["<img src="https://api.iconify.design/lucide/volume-x.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Noise Down"]
|
|
S3 -- "Flashlight" --> S6["<img src="https://api.iconify.design/lucide/flashlight.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Lộ vị trí"]
|
|
|
|
S4 & S5 & S6 --> S_Check{"<img src="https://api.iconify.design/lucide/search.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Check Env"}
|
|
S_Check -- "Dẫm bẫy" --> S_Trap["<img src="https://api.iconify.design/lucide/alert-triangle.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Bị khống chế"]
|
|
end
|
|
|
|
%% Trapper Branch
|
|
subgraph Trapper_Logic ["<b><img src="https://api.iconify.design/lucide/settings.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> TRAPPER (STRATEGY)</b>"]
|
|
T1["<img src="https://api.iconify.design/lucide/mouse.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Mouse Input"] --> T2["<img src="https://api.iconify.design/lucide/map.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> View: Heatmap/Cams"]
|
|
T2 --> T3{"<img src="https://api.iconify.design/lucide/wrench.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Kỹ năng?"}
|
|
T3 -- "Đặt bẫy" --> T4["<img src="https://api.iconify.design/lucide/binary.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Sync Trap"]
|
|
T3 -- "Scan" --> T5["<img src="https://api.iconify.design/lucide/rss.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Ping Seeker"]
|
|
T3 -- "Lock" --> T6["<img src="https://api.iconify.design/lucide/door-closed.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Khóa cửa"]
|
|
|
|
T4 & T5 & T6 --> T_Check{"<img src="https://api.iconify.design/lucide/eye.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Theo dõi"}
|
|
end
|
|
|
|
%% Networking Layer
|
|
subgraph Network_Sync ["<b><img src="https://api.iconify.design/lucide/globe.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> NETWORK SYNC</b>"]
|
|
Loop --> NS1["⏩ Client Prediction"]
|
|
NS1 --> NS2["<img src="https://api.iconify.design/lucide/refresh-cw.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Server Reconciliation"]
|
|
NS2 --> NS3["<img src="https://api.iconify.design/lucide/package.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> State Sync"]
|
|
end
|
|
end
|
|
class Seeker_Logic,S1,S2,S3,S4,S5,S6,S_Check seekerStyle;
|
|
class Trapper_Logic,T1,T2,T3,T4,T5,T6,T_Check trapperStyle;
|
|
class Network_Sync,NS1,NS2,NS3,Loop netStyle;
|
|
class S_Trap criticalStyle;
|
|
|
|
%% Phase 3: Results
|
|
subgraph Result_Logic ["<b>3. KẾT THÚC & THƯỞNG</b>"]
|
|
S_Check -- "Chạm Exit" --> Win_S["<img src="https://api.iconify.design/lucide/trophy.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> SEEKER THẮNG"]
|
|
T_Check -- "Bắt được Seeker" --> Win_T["<img src="https://api.iconify.design/lucide/trophy.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> TRAPPER THẮNG"]
|
|
Loop -- "Timer = 0" --> Win_T
|
|
|
|
Win_S & Win_T --> Post_Match["<img src="https://api.iconify.design/lucide/bar-chart-3.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Thống kê Rank"]
|
|
Post_Match --> Buff{"<img src="https://api.iconify.design/lucide/scale.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Balance Check"}
|
|
Buff -- "Thua cuộc" --> Buff_Apply["<img src="https://api.iconify.design/lucide/gem.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Kích hoạt Comeback Buff"]
|
|
Buff_Apply --> A
|
|
end
|
|
class Win_S,Win_T winStyle;
|
|
class Result_Logic,Post_Match,Buff,Buff_Apply initStyle;
|
|
|
|
%% Interactions (Dashed Lines)
|
|
S_Trap -.->|Cảnh báo| T_Check
|
|
S4 -.->|Sóng âm| T2
|
|
T4 -.->|Collision ẩn| S_Check
|
|
NS3 --> Loop
|
|
```
|
|
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/building-2.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Kiến trúc Kỹ thuật (Technical Architecture)
|
|
|
|
### 1. Advanced Player & Camera State Machine
|
|
|
|
Hệ thống điều khiển nhân vật không chỉ quản lý hành động mà còn điều phối **Camera Dynamics** để tăng cường cảm giác nhập vai và đồng bộ hóa hướng nhìn qua mạng.
|
|
|
|
```mermaid
|
|
stateDiagram-v2
|
|
direction TB
|
|
|
|
state "<img src="https://api.iconify.design/lucide/flower.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> GROUND" as Ground {
|
|
[*] --> Idle
|
|
|
|
state Idle {
|
|
I_P: <img src="https://api.iconify.design/lucide/file-text.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Vel < 0.1m/s
|
|
I_C: 🌡️ Breathing (0.5Hz)
|
|
}
|
|
|
|
Idle --> Moving : "Input.mag > 0.1"
|
|
state Moving {
|
|
M_P: <img src="https://api.iconify.design/lucide/footprints.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Speed 2-4m/s
|
|
M_C: <img src="https://api.iconify.design/lucide/wind.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Head Bob (1.2Hz)
|
|
}
|
|
|
|
Moving --> Sneaking : "OnSneak (Hold)"
|
|
state Sneaking {
|
|
Sn_P: <img src="https://api.iconify.design/lucide/volume-x.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Noise -50%
|
|
Sn_C: <img src="https://api.iconify.design/lucide/trending-down.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Lower Height
|
|
}
|
|
|
|
Moving --> Sprinting : "OnSprint (Hold)"
|
|
state Sneaking --> Moving : "Release Sneak"
|
|
state Sprinting {
|
|
Sp_P: <img src="https://api.iconify.design/lucide/zap.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Speed > 6.5m/s
|
|
Sp_C: 🌈 Dynamic FOV
|
|
}
|
|
|
|
Sprinting --> Moving : "Stamina Empty"
|
|
}
|
|
|
|
state "☁️ AIRBORNE" as Air {
|
|
state Jump {
|
|
J_P: <img src="https://api.iconify.design/lucide/arrow-up-circle.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> AddForce Up
|
|
}
|
|
state Falling {
|
|
F_P: <img src="https://api.iconify.design/lucide/trending-down.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Gravity x 1.5
|
|
}
|
|
state Landing {
|
|
L_P: 📏 Impact Check
|
|
}
|
|
|
|
Jump --> Falling : "Vel.y < 0"
|
|
Falling --> Landing : "IsGrounded == true"
|
|
}
|
|
|
|
state "<img src="https://api.iconify.design/lucide/zap.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> ACTION" as Utility {
|
|
state Dashing {
|
|
D_P: <img src="https://api.iconify.design/lucide/wind.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Burst 15m/s
|
|
}
|
|
state Interacting {
|
|
Int_P: <img src="https://api.iconify.design/lucide/lock.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Root Motion Lock
|
|
}
|
|
}
|
|
|
|
state "<img src="https://api.iconify.design/lucide/globe.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> NETWORK" as Net {
|
|
state "Input Authority" as IA
|
|
state "State Authority" as SA
|
|
IA --> SA : "Send Input"
|
|
SA --> IA : "Reconcile"
|
|
}
|
|
|
|
%% Transitions chính
|
|
Ground --> Air : "IsGrounded == false"
|
|
Air --> Ground : "OnLand Event"
|
|
Ground --> Utility : "OnAbility"
|
|
Utility --> Ground : "Complete"
|
|
|
|
%% Notes
|
|
note left of Ground
|
|
<img src="https://api.iconify.design/lucide/sparkles.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Sync: Velocity
|
|
<img src="https://api.iconify.design/lucide/sparkles.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> State: MoveState
|
|
end note
|
|
|
|
note right of Net
|
|
<img src="https://api.iconify.design/lucide/settings.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Photon Fusion
|
|
<img src="https://api.iconify.design/lucide/settings.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> FixedUpdateNetwork
|
|
end note
|
|
```
|
|
|
|
### 2. Environment Scanner & Interaction
|
|
Hệ thống quét vật thể (`EnvironmentScanner.cs`) sử dụng **SphereCast** và **OverlapSphere** để phát hiện các đối tượng `IInteractable` trong phạm vi tương tác, đảm bảo tính chính xác ngay cả trong bóng tối.
|
|
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/puzzle.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Hệ thống Mê cung (Maze Generation)
|
|
|
|
Trái tim của **BABA_YAGA** là hệ thống tạo mê cung đa thuật toán, mang lại sự đa dạng vô hạn.
|
|
|
|
| Algorithm | Complexity | Description |
|
|
| :--- | :--- | :--- |
|
|
| **Prims** | O(E log V) | Tạo mê cung "dày", nhiều nhánh ngắn, lý tưởng cho việc đặt bẫy. |
|
|
| **Wilsons** | O(N) | Thuật toán ngẫu nhiên hoàn hảo, không có thiên hướng cấu trúc nhất định. |
|
|
| **Recursive** | O(N) | Tạo ra các hành lang dài và sâu, tăng áp lực cho Seeker. |
|
|
| **Crawler** | O(N) | Tạo ra các không gian mở giống hang động hơn là mê cung truyền thống. |
|
|
|
|
### Quy trình khởi tạo (Maze Generation Pipeline)
|
|
|
|
```mermaid
|
|
graph TD
|
|
%% Định nghĩa Style
|
|
classDef lossStyle fill:#ffebee,stroke:#c62828,stroke-width:2px,color:#c62828;
|
|
classDef tier1Style fill:#fff8e1,stroke:#fbc02d,stroke-width:2px,color:#f57f17;
|
|
classDef tier2Style fill:#fff3e0,stroke:#fb8c00,stroke-width:2px,color:#e65100;
|
|
classDef tier3Style fill:#fbe9e7,stroke:#ff5722,stroke-width:2px,color:#bf360c;
|
|
classDef systemStyle fill:#f5f5f5,stroke:#424242,stroke-width:2px,color:#424242;
|
|
classDef winStyle fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,color:#1b5e20;
|
|
|
|
%% Quy trình chính
|
|
Start(("<img src="https://api.iconify.design/lucide/heart-off.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> <b>PLAYER LOSES ROUND</b>")) --> Streak{{"<img src="https://api.iconify.design/lucide/bar-chart-3.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Check Loss Streak"}}
|
|
|
|
%% Phân tầng Buff
|
|
subgraph Buff_Pools ["<b><img src="https://api.iconify.design/lucide/flame.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> HỆ THỐNG CÂN BẰNG ĐỘNG (COMEBACK POOLS)</b>"]
|
|
Streak -- "1 Trận" --> T1
|
|
Streak -- "2 Trận" --> T2
|
|
Streak -- "3+ Trận" --> T3
|
|
|
|
T1["<img src="https://api.iconify.design/lucide/award.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> <b>Tier 1: Awakening</b><br/>(Small Boosts)"]
|
|
T2["<img src="https://api.iconify.design/lucide/award.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> <b>Tier 2: Evolution</b><br/>(Tactical Advantage)"]
|
|
T3["<img src="https://api.iconify.design/lucide/award.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> <b>Tier 3: Manifestation</b><br/>(Game Changer)"]
|
|
|
|
%% Ví dụ chỉ số (Tooltip-like)
|
|
T1 --- T1_Ex["+10% Speed<br/>+15% Stamina Regen"]
|
|
T2 --- T2_Ex["Bẫy tàng hình (Trapper)<br/>Giảm 50% tiếng ồn (Seeker)"]
|
|
T3 --- T3_Ex["Nhìn xuyên tường 5s<br/>Hồi sinh 1 lần tại chỗ"]
|
|
end
|
|
|
|
%% Giai đoạn áp dụng
|
|
T1 & T2 & T3 --> Selection{{"<img src="https://api.iconify.design/lucide/dice-5.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Selection Mode"}}
|
|
|
|
Selection -- "Manual" --> P1["Người chơi tự chọn 1 trong 3 Buff"]
|
|
Selection -- "Auto" --> P2["Hệ thống chọn ngẫu nhiên"]
|
|
|
|
P1 & P2 --> Apply["<img src="https://api.iconify.design/lucide/sparkles.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> <b>Apply to Next Round Only</b><br/>(Trạng thái: Active)"]
|
|
|
|
%% Kết quả vòng đấu sau
|
|
Apply --> Result{{"<img src="https://api.iconify.design/lucide/flag.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> New Round Result?"}}
|
|
|
|
Result -- "<img src="https://api.iconify.design/lucide/trophy.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> WIN" --> Reset["<img src="https://api.iconify.design/lucide/rotate-ccw.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> <b>Reset Streak</b><br/>Remove All Buffs"]
|
|
Result -- "❌ LOSS" --> Increment["<img src="https://api.iconify.design/lucide/trending-up.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> <b>Increase Streak</b><br/>Progress to Next Tier"]
|
|
|
|
%% Vòng lặp
|
|
Reset --> NewGame(("<img src="https://api.iconify.design/lucide/gamepad-2.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Fair Match"))
|
|
Increment --> Start
|
|
|
|
%% Gán Style
|
|
class Start,Increment lossStyle;
|
|
class T1,T1_Ex tier1Style;
|
|
class T2,T2_Ex tier2Style;
|
|
class T3,T3_Ex tier3Style;
|
|
class Selection,P1,P2,Apply systemStyle;
|
|
class Result,Reset,NewGame winStyle;
|
|
```
|
|
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/globe.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Đồng bộ Mạng (Networking)
|
|
|
|
Sử dụng **Photon Fusion (State Sync)** với cơ chế Client-Side Prediction để đảm bảo trải nghiệm không độ trễ.
|
|
|
|
### Network Data Flow & Synchronization
|
|
```mermaid
|
|
sequenceDiagram
|
|
autonumber
|
|
|
|
participant IR as <img src="https://api.iconify.design/lucide/mouse.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Input
|
|
participant CP as 🎀 Local Player
|
|
participant NT as <img src="https://api.iconify.design/lucide/globe.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Fusion Net
|
|
participant S as <img src="https://api.iconify.design/lucide/crown.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Server
|
|
participant RP as <img src="https://api.iconify.design/lucide/users.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Proxies
|
|
|
|
%% --- GIAI ĐOẠN 1 ---
|
|
Note over IR, CP: [PHASE 1] Thu thập Input
|
|
IR->>CP: OnMove / OnJump / OnSprint
|
|
CP->>CP: <img src="https://api.iconify.design/lucide/package.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Pack NetworkInputData
|
|
|
|
%% --- GIAI ĐOẠN 2 ---
|
|
Note over CP: [PHASE 2] Dự đoán (Prediction)
|
|
CP->>CP: <img src="https://api.iconify.design/lucide/run.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Run Client-Side Physics
|
|
CP->>NT: <img src="https://api.iconify.design/lucide/mail.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Send Input (Tick N)
|
|
|
|
%% --- GIAI ĐOẠN 3 ---
|
|
Note over NT, S: [PHASE 3] Truyền tin mạng
|
|
NT->>S: UDP Packet Delivery
|
|
Note right of S: SERVER SIMULATION
|
|
S->>S: <img src="https://api.iconify.design/lucide/file-text.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Validate & Update State
|
|
S-->>NT: <img src="https://api.iconify.design/lucide/megaphone.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Snapshot (Tick N)
|
|
|
|
%% --- GIAI ĐOẠN 4 ---
|
|
Note over NT, CP: [PHASE 4] Hồi đáp & Đồng bộ
|
|
NT-->>CP: State Snapshot
|
|
Note over CP: <img src="https://api.iconify.design/lucide/refresh-cw.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> RECONCILIATION
|
|
CP->>CP: Fix Position if Error > Threshold
|
|
|
|
%% --- GIAI ĐOẠN 5 ---
|
|
Note over NT, RP: [PHASE 5] Proxy Update
|
|
NT-->>RP: State Snapshot
|
|
Note over RP: <img src="https://api.iconify.design/lucide/film.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> INTERPOLATION (Lerp)
|
|
|
|
%% --- GIAI ĐOẠN 6 ---
|
|
Note over CP, RP: [PHASE 6] Hiển thị (Render)
|
|
CP->>CP: Update Camera Shake/VFX
|
|
RP->>RP: Smooth Mesh Movement
|
|
```
|
|
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/scale.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Hệ thống Comeback Đa tầng (Tiered Adaptive System)
|
|
|
|
Để đảm bảo mỗi trận đấu đều kịch tính đến giây cuối cùng, BABA_YAGA áp dụng hệ thống **"Despair Mechanics"**. Người chơi có chuỗi thua càng dài sẽ nhận được quyền năng từ mê cung càng lớn, tạo ra những khoảnh khắc lật kèo kinh điển.
|
|
|
|
### <img src="https://api.iconify.design/lucide/trending-up.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Phân tầng Buff theo Chuỗi Thua (Tiered Progression)
|
|
|
|
| Chuỗi Thua | Phân tầng | Tên gọi | Quyền năng & Cơ chế |
|
|
| :--- | :--- | :--- | :--- |
|
|
| **1 Trận** | Tier 1 | *Awakening* | Chọn 1 Buff cơ bản (Tăng tốc +15% hoặc Mở rộng tầm nhìn +20%). |
|
|
| **2 Trận** | Tier 2 | *Evolution* | Nhận 1 Buff chủ động (Kỹ năng nhấn nút) + 1 Buff bị động (Nâng cấp chỉ số). |
|
|
| **3+ Trận** | Tier 3 | *Manifestation* | **Ultimate Skill:** Kỹ năng thay đổi luật chơi trong 30s. Mê cung sẽ hỗ trợ bạn trực tiếp. |
|
|
|
|
---
|
|
|
|
### <img src="https://api.iconify.design/lucide/run.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Seeker: Ý chí Sinh tồn (Survival Evolution)
|
|
|
|
Khi Seeker liên tục thất bại, các giác quan của họ sẽ tiến hóa vượt bậc để chống lại bóng tối:
|
|
|
|
* **Tier 1 - Sixth Sense (Linh cảm):** Seeker bắt đầu nghe thấy tiếng tim đập của chính mình nhanh hơn khi Trapper đang ở gần (bán kính 15m), giúp định vị mà không cần nhìn.
|
|
* **Tier 2 - Shadow Step (Bước chân hư vô):** Di chuyển hoàn toàn không gây ra tiếng động (Noise Meter = 0) trong 20 giây đầu của trận đấu. Cho phép Seeker thiết lập vị trí an toàn sớm.
|
|
* **Tier 2 - Trap Reflex (Phản xạ tột độ):** Seeker có 50% cơ hội tự động vô hiệu hóa bẫy kẹp đầu tiên dẫm phải. Nếu thành công, Seeker sẽ được tăng 50% tốc độ chạy trong 3s.
|
|
* **Tier 3 - Ultimate: Chrono Dash:** Trong 15 giây, Seeker có thể thực hiện Dash không giới hạn (No Cooldown) và trở nên miễn nhiễm with mọi loại khống chế. Lúc này, Seeker là kẻ săn lùng lối thoát.
|
|
|
|
---
|
|
|
|
### <img src="https://api.iconify.design/lucide/eye.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Trapper: Quyền năng Bóng tối (Dark Rituals)
|
|
|
|
Khi Trapper để xổng mất con mồi, mê cung sẽ hiến tế sự ổn định của nó để ban cho Trapper những quyền năng thao túng cực hạn:
|
|
|
|
* **Tier 1 - Paranoia Echo (Tiếng vọng ảo giác):** Tự động tạo ra 3 nguồn âm thanh bước chân giả chạy xung quanh Seeker để gây nhiễu loạn khả năng định hướng bằng âm thanh của họ.
|
|
* **Tier 2 - Global Blackout (Bóng tối bao trùm):** Kích hoạt khiến đèn pin của Seeker bị nhiễu (Flicker) hoặc tắt hoàn toàn trong 8 giây. Đây là thời điểm vàng để Trapper thu hẹp khoảng cách.
|
|
* **Tier 2 - Ghosting (Dịch chuyển không gian):** Trapper nhận khả năng đi xuyên qua các cánh cửa đã bị khóa hoặc các bức tường mỏng (Destructible Walls) trong 15 giây.
|
|
* **Tier 3 - Ultimate: Eye of the Abyss:** Hiển thị vị trí thực của Seeker xuyên tường (Wallhack) dưới dạng bóng đen trong 20 giây. Seeker không thể trốn chạy, chỉ có thể cầu nguyện.
|
|
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/rocket.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Lộ trình Phát triển (Roadmap)
|
|
|
|
<!-- START_UPDATES -->
|
|
<!-- END_UPDATES -->
|
|
|
|
- [x] **Phase 1: Foundation**
|
|
- [x] Player State Machine (Idle, Move, Run, Jump).
|
|
- [x] Maze Generation (Multi-algorithm).
|
|
- [x] Photon Fusion Integration.
|
|
- [ ] **Phase 2: Gameplay Core**
|
|
- [ ] Role Selection (Seeker vs Trapper).
|
|
- [ ] Trap Placement System.
|
|
- [ ] Sound & Visual Detection (Noise Meter).
|
|
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/users.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Đội ngũ Phát triển & Phân chia Nhiệm vụ (The Team & WBS)
|
|
|
|
Dự án được thực hiện bởi nhóm 3 thành viên với các vai trò chuyên biệt, đảm bảo tính chuyên môn hóa cao trong quy trình sản xuất Game.
|
|
|
|
| Thành viên | Vai trò | Trách nhiệm chi tiết (Work Breakdown Structure) |
|
|
| :--- | :--- | :--- |
|
|
| **Scove** | **Trưởng nhóm / World Architect** | - Nghiên cứu & triển khai thuật toán Maze (Prims, Wilsons, Crawler).<br/>- Thiết kế hệ thống **Mesh Generation** (Tạo tường, sàn, trần tự động).<br/>- Đảm bảo tính **Solvability** (Mê cung luôn có lối thoát khả thi).<br/>- Xây dựng logic **Comeback Đa tầng** (Despair Mechanics).<br/>- Review Code toàn cục & Quản lý kiến trúc State Machine. |
|
|
| **Duy** | **Phó nhóm / Lead Network Engineer** | - Quản lý hạ tầng **Photon Fusion** (Matchmaking, Session, Relay).<br/>- Đồng bộ hóa trạng thái mạng (`Networked Properties`) cho bẫy, cửa, đèn.<br/>- Xử lý logic phân vai (Role Assignment) & Điều phối Game State.<br/>- Tối ưu hóa băng thông & Xử lý Reconciliation/Interpolation mạng. |
|
|
| **Tuấn** | **Mechanics Developer & Tech Artist** | - Hệ thống **Noise Meter** & Ánh sáng động (Flashlight/Battery System).<br/>- Logic bẫy (Traps): Snare (kẹp), Alarm (báo động), Sound (giả thanh).<br/>- Hệ thống **Camera Dynamics** (FOV Kick, Shake, Tilt, Motion Blur).<br/>- Quản lý hiệu ứng hình ảnh (VFX) & Âm thanh không gian (3D Spatial Audio).<br/>- Thiết kế HUD cho Seeker & Trapper; UI Menu & UX Flow. |
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/ruler.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Tiêu chuẩn Kỹ thuật Nâng cao (Non-functional Requirements)
|
|
|
|
Mỗi thành viên phải tuân thủ nghiêm ngặt các tiêu chuẩn kỹ thuật sau để đảm bảo dự án đạt chất lượng AAA-Indie:
|
|
|
|
### <img src="https://api.iconify.design/lucide/globe.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Networking & Synchronization (Duy)
|
|
* **RTT Optimization:** Duy trì Round Trip Time < 150ms; tối ưu hóa kích thước gói tin bằng `[Networked]` và `Reliable RPCs`.
|
|
* **State Authority:** Mọi logic Thắng/Thua và Trigger bẫy phải được xác thực hoàn toàn tại **Server** để ngăn chặn gian lận.
|
|
* **Interpolation Smoothing:** Đảm bảo di chuyển của đối thủ (Remote Proxies) mượt mà ngay cả khi mất gói tin (Packet Loss).
|
|
|
|
### <img src="https://api.iconify.design/lucide/building-2.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> World Generation & Performance (Scove)
|
|
* **Algorithmic Complexity:** Thuật toán tạo mê cung phải đạt hiệu năng O(N) hoặc O(N log N) để tránh treo Editor/Runtime.
|
|
* **Draw Call Batching:** Tối ưu hóa Mesh mê cung để đạt mức Draw Calls thấp nhất (Sử dụng Static Batching & GPU Instancing).
|
|
* **NavMesh Runtime:** Tự động bake NavMesh sau khi Maze tạo xong để hỗ trợ AI và các tính năng hỗ trợ Trapper.
|
|
|
|
### <img src="https://api.iconify.design/lucide/binary.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Gameplay & Physics (Tuấn)
|
|
* **Input Latency:** Xử lý Input thông qua `FixedUpdateNetwork` để đồng bộ hoàn hảo với Server Simulation.
|
|
* **Physics Matrix:** Tối ưu hóa Collision Matrix; sử dụng Collider đơn giản (Box/Capsule) cho các hành lang mê cung lắt léo.
|
|
* **State Integrity:** Mỗi State trong State Machine phải độc lập, không được can thiệp trực tiếp vào biến nội bộ của State khác.
|
|
|
|
### <img src="https://api.iconify.design/lucide/palette.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Visuals & UI/UX (Tuấn)
|
|
* **Rendering (Unity 6):** Tận dụng **URP (Universal Render Pipeline)** và Render Graph để tạo hiệu ứng bóng tối chất lượng cao.
|
|
* **Asset Compression:** Texture sử dụng chuẩn nén ASTC/DXT5; Mesh polycount tối ưu cho môi trường di động và PC tầm trung.
|
|
* **UX Consistency:** Tín hiệu phản hồi (VFX/SFX/Haptic) phải nhất quán để người chơi nhận biết ngay lập tức các sự kiện trong game.
|
|
|
|
|
|
---
|
|
|
|
## 📂 Cấu trúc Thư mục Dự án (Project Folder Structure)
|
|
|
|
Dự án được tổ chức theo tiêu chuẩn công nghiệp (Standard Industry Practices), tách biệt rõ ràng giữa logic Code, Assets và Configuration.
|
|
|
|
```text
|
|
📦 BABA_YAGA
|
|
├── 🌸 Assets/ (Trái tim của trò chơi)
|
|
│ ├── 📜 Scripts/ (Phép thuật điều khiển logic)
|
|
│ │ ├── 🏷️ Attributes/ # Tùy biến Inspector
|
|
│ │ ├── 🎥 Camera Controller/
|
|
│ │ ├── 🛠️ Debug/
|
|
│ │ ├── 🌐 Fusion/
|
|
│ │ │ └── 🚀 BasicSpawner.cs
|
|
│ │ ├── 🏗️ GameSetup/
|
|
│ │ │ ├── 🌀 Maze/ # Mê cung
|
|
│ │ │ │ ├── 🐾 Crawler.cs
|
|
│ │ │ │ ├── 🌳 Prims.cs
|
|
│ │ │ │ ├── 🧵 Wilsons.cs
|
|
│ │ │ │ └── 🗺️ Maze.cs
|
|
│ │ │ └── 🧍 CharacterAutoSetup.cs
|
|
│ │ ├── 鼠标 Interactables/
|
|
│ │ │ ├── 🚪 DoorInteractable.cs
|
|
│ │ │ ├── 💡 LampInteractable.cs
|
|
│ │ │ └── 💎 BaseInteractable.cs
|
|
│ │ ├── 📐 Interface/
|
|
│ │ ├── 🏃♀️ Player Controller/
|
|
│ │ │ ├── 🧠 PlayerStateMachine.cs
|
|
│ │ │ ├── ⌨️ InputReader.cs
|
|
│ │ │ └── 🎭 States/
|
|
│ │ ├── ⚡ Optimization/
|
|
│ │ ├── 🖥️ UI/
|
|
│ │ └── 🎆 VFX/
|
|
│ ├── 🧸 Prefabs/
|
|
│ ├── 📖 document/
|
|
│ ├── 🎬 Scenes/
|
|
│ ├── 🎨 Materials/
|
|
│ ├── 👸 Models/
|
|
│ ├── 💃 Animation/
|
|
│ ├── 🔌 Photon/
|
|
│ ├── 🅰️ TextMesh Pro/
|
|
│ └── ⚙️ Settings/
|
|
├── 🛠️ ProjectSettings/
|
|
│ ├── 🏷️ TagManager.asset
|
|
│ ├── 🌍 DynamicsManager.asset
|
|
│ └── 📡 MultiplayerManager.asset
|
|
├── 📦 Packages/
|
|
└── 📝 README.md # Creator (。•̀ᴗ-)✧
|
|
```
|
|
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/handshake.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Hướng dẫn Cài đặt & Khởi chạy (Installation & Setup)
|
|
|
|
Để trải nghiệm **BABA_YAGA** một cách mượt mà nhất, vui lòng thực hiện theo các bước chi tiết dưới đây:
|
|
|
|
### 1. Yêu cầu Hệ thống
|
|
* **Unity Editor:** Phiên bản **6000.3.10f1 (Unity 6)** trở lên.
|
|
* **Hệ điều hành:** Windows 10/11 hoặc macOS (M1/M2/Intel).
|
|
* **Disk Space:** Tối thiểu 5GB trống để chứa Project và Library.
|
|
|
|
### 2. Tải về & Mở dự án
|
|
1. **Clone Repository:**
|
|
```bash
|
|
git clone https://github.com/OnlyScove/BABA_YAGA.git
|
|
```
|
|
2. Mở **Unity Hub**, chọn **Add** -> **Add project from disk**.
|
|
3. Tìm đến thư mục vừa clone và nhấn **Open**. Chờ Unity Hub tải các Packages cần thiết (có thể mất vài phút).
|
|
|
|
### 3. Cấu hình Photon Fusion (Bắt buộc)
|
|
Trò chơi yêu cầu **AppID** hợp lệ để hoạt động qua mạng:
|
|
1. Đăng nhập vào [Photon Engine Dashboard](https://dashboard.photonengine.com/).
|
|
2. Tạo một ứng dụng mới với loại App là **Fusion**.
|
|
3. Sao chép **App ID** vừa tạo.
|
|
4. Trong Unity Editor, đi đến: `Photon` -> `Fusion` -> `Network Project Settings`.
|
|
5. Dán App ID vào mục **App Id Fusion** (cho cả Realtime và Fusion).
|
|
6. Đảm bảo **Network Mode** được đặt là `Client/Server` (để hỗ trợ State Authority).
|
|
|
|
### 4. Khởi chạy Trò chơi
|
|
1. Mở Scene chính tại: `Assets/Scenes/Main Scene.unity`.
|
|
2. Sử dụng **Smart Bootstrapper** (nằm ở thanh Menu trên cùng) để tự động cấu hình Runner.
|
|
3. Nhấn nút **Play** trong Unity Editor.
|
|
4. Để test Multiplayer, bạn có thể build ra file `.exe` hoặc sử dụng công cụ **ParrelSync** (nếu đã cài) để chạy hai instance cùng lúc.
|
|
|
|
---
|
|
|
|
## <img src="https://api.iconify.design/lucide/heart.svg?color=%23E0E0E0" width="20" height="20" style="vertical-align: middle;"> Support & Community
|
|
|
|
<p align="center">
|
|
<a href="https://github.com/scove303">
|
|
<img src="https://img.shields.io/github/stars/OnlyScove/BABA_YAGA?style=for-the-badge&logo=github&color=yellow" alt="Stars">
|
|
</a>
|
|
<a href="https://scove-vault.duckdns.org/scove">
|
|
<img src="https://img.shields.io/github/forks/OnlyScove/BABA_YAGA?style=for-the-badge&logo=github&color=blue" alt="Forks">
|
|
</a>
|
|
<a href="https://scove-vault.duckdns.org/scove">
|
|
<img src="https://img.shields.io/github/followers/OnlyScove?style=for-the-badge&logo=github&color=green" alt="Follow">
|
|
</a>
|
|
</p>
|
|
|
|
<p align="center">
|
|
<a href="https://www.buymeacoffee.com/yourname">
|
|
<img src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-Donate-orange?style=for-the-badge&logo=buy-me-a-coffee&logoColor=white" alt="Buy Me A Coffee">
|
|
</a>
|
|
<a href="https://discord.gg/4xCYJvF4S2">
|
|
<img src="https://img.shields.io/badge/Discord-Join%20Community-7289DA?style=for-the-badge&logo=discord&logoColor=white" alt="Discord">
|
|
</a>
|
|
<a href="https://ko-fi.com/yourname">
|
|
<img src="https://img.shields.io/badge/Ko--fi-Support-red?style=for-the-badge&logo=ko-fi&logoColor=white" alt="Ko-fi">
|
|
</a>
|
|
</p>
|
|
|
|
<p align="center">
|
|
<img src="https://scove-vault.duckdns.org/files/share/hARx-n28" alt="Visitors">
|
|
</p>
|
|
|
|
---
|
|
|
|
**© 2026 SCOVANIA STUDIOS.**
|
|
*Baba_Yaga is more than a game, it's a social experiment.*
|
|
|
|
---
|
|
|
|
**Connect with us:**
|
|
[](https://x.com/Scovy303)
|
|
|