This commit is contained in:
2026-06-07 19:41:43 +07:00
parent 696d091efa
commit 6af1c8bf20
23 changed files with 1691 additions and 108 deletions

File diff suppressed because one or more lines are too long

View File

@@ -5,8 +5,8 @@
</component>
<component name="ChangeListManager">
<list default="true" id="d308d1cb-09fc-4331-ba20-00f7b43d1576" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.gemini-workspace-history/active-context.md" beforeDir="false" afterPath="$PROJECT_DIR$/.gemini-workspace-history/active-context.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.BABA_YAGA/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.BABA_YAGA/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/BABA_YAGA_Updater/mappers/markdown_builder.py" beforeDir="false" afterPath="$PROJECT_DIR$/BABA_YAGA_Updater/mappers/markdown_builder.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@@ -98,7 +98,7 @@
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1780826181670</updated>
<workItem from="1780826183468" duration="4921000" />
<workItem from="1780826183468" duration="8401000" />
</task>
<servers />
</component>

View File

@@ -1,5 +0,0 @@
SPREADSHEET_ID=your_spreadsheet_id_here
SHEET_RANGE=Sheet1!A2:E
CREDENTIALS_FILE=credentials.json
TOKEN_FILE=token.json
README_PATH=../README.md

View File

@@ -0,0 +1 @@
No previous session history found for this workspace.

578
BABA_YAGA_Updater/README.md Normal file
View File

@@ -0,0 +1,578 @@
# 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.
# ![Header](https://img.shields.io/badge/PROJECT-BABA_YAGA-black?style=for-the-badge&logo=shadow)
[![Unity 6000.3.10f1](https://img.shields.io/badge/Unity-6000.3.10f1_LTS-black?logo=unity&logoColor=white)](https://unity.com/)
[![Photon Fusion](https://img.shields.io/badge/Networking-Photon_Fusion-blue?style=flat-square)](https://www.photonengine.com/fusion)
[![License: MIT](https://img.shields.io/badge/License-MIT-lightgrey?style=flat-square)](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.
---
## ![Docs](https://img.shields.io/badge/--Mục_lục-black?style=flat-square&logo=read-the-docs&logoColor=white)
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)
![Game Concept Art](https://scove-vault.duckdns.org/files/share/vakALUeH)
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****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****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]``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:**
[![Twitter](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/Scovy303)

View File

@@ -0,0 +1,107 @@
<div align="center">
<!-- ANIMATED BANNER (Sử dụng SVG Pulse hoặc GIF) -->
<p align="center">
<img src="https://capsule-render.vercel.app/render?type=koding&color=000000&customColorList=10&text=BABA_YAGA&fontSize=80&animation=fadeIn&fontAlignY=40&fontColor=FF0000" alt="Animated Header" />
</p>
### ⚡ THE ASYMMETRIC PSYCHOLOGICAL SURVIVAL ENGINE
**"Thị giác là một lời nói dối. Bóng tối là sự thật duy nhất."**
<p align="center">
<img src="https://img.shields.io/badge/VERSION-6000.3.10f1_LTS-white?style=for-the-badge&logo=unity&logoColor=black" />
<img src="https://img.shields.io/badge/NETWORKING-PHOTON_FUSION-0055FF?style=for-the-badge&logo=purescript&logoColor=white" />
<img src="https://img.shields.io/badge/STATUS-ACTIVE_DEVELOPMENT-FFD700?style=for-the-badge&logo=pulse&logoColor=black" />
</p>
---
<!-- GRID LAYOUT CHO CÁC CHỈ SỐ DỰ ÁN -->
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr style="border: none;">
<td align="center" style="border: none; padding: 20px;">
<img src="https://api.iconify.design/lucide/brain-circuit.svg?color=%23FF3333" width="40" height="40"><br>
<strong>Cognitive War</strong><br><small>Tâm lý chiến</small>
</td>
<td align="center" style="border: none; padding: 20px;">
<img src="https://api.iconify.design/lucide/audio-lines.svg?color=%2333FF33" width="40" height="40"><br>
<strong>Spatial Audio</strong><br><small>Âm thanh 3D</small>
</td>
<td align="center" style="border: none; padding: 20px;">
<img src="https://api.iconify.design/lucide/expand.svg?color=%2333CCFF" width="40" height="40"><br>
<strong>Procedural Maze</strong><br><small>Mê cung vô tận</small>
</td>
</tr>
</table>
---
</div>
## <img src="https://api.iconify.design/lucide/eye.svg?color=%23FF3333&flip=horizontal" width="28" height="28" style="vertical-align: middle;"> Tầm nhìn Dự án (Project Vision)
<div align="center">
<img src="https://scove-vault.duckdns.org/files/share/vakALUeH" width="100%" style="border-radius: 10px; border: 1px solid #333;">
</div>
> **BABA_YAGA** không chỉ là một trò chơi; nó là một thí nghiệm về sự cô lập. Dự án được xây dựng trên triết lý **"High-Stakes Hide & Seek"**, nơi mỗi giây im lặng đều mang trọng lượng ngàn cân.
### 💠 Các Trụ Cột Cốt Lõi (Core Pillars)
- 🎛️ **Minimalist UI (The "Invisible" HUD):** Chúng tôi loại bỏ mọi rào cản giữa người chơi và môi trường. Không thanh máu, không bản đồ con. Mọi thông tin đều được phản hồi qua nhịp tim, nhịp thở và độ mờ của tầm nhìn.
- 🔊 **Spatial Audio Positioning:** Âm thanh là vũ khí. Seeker phải học cách "nhìn bằng tai", trong khi Trapper có thể sử dụng tiếng động giả để điều hướng con mồi vào bẫy.
- 💡 **Dynamic Lighting & Shadow Manipulation:** Ánh sáng trong BABA_YAGA là một tài nguyên hữu hạn. Việc bật đèn pin có thể giúp bạn thấy đường, nhưng đồng thời biến bạn thành một ngọn hải đăng cho kẻ đi săn.
---
<div align="center">
### <img src="https://api.iconify.design/lucide/command.svg?color=%23FFFFFF" width="22" height="22" style="vertical-align: middle;"> DANH MỤC HỆ THỐNG
<!-- TABLE OF CONTENTS 2 COLUMNS NO BORDER -->
<table border="0" cellpadding="0" cellspacing="0" style="border: none; border-collapse: collapse; width: 90%;">
<tr style="border: none;">
<td style="border: none; padding: 12px;" width="50%">
<img src="https://api.iconify.design/lucide/telescope.svg?color=%23888888" width="18" style="vertical-align: middle;"> &nbsp;
<a href="#vision" style="text-decoration: none; color: #E0E0E0; font-weight: bold;">Tầm nhìn & Triết lý</a>
</td>
<td style="border: none; padding: 12px;" width="50%">
<img src="https://api.iconify.design/lucide/box.svg?color=%23888888" width="18" style="vertical-align: middle;"> &nbsp;
<a href="#mechanics" style="text-decoration: none; color: #E0E0E0; font-weight: bold;">Cơ chế Core Gameplay</a>
</td>
</tr>
<tr style="border: none;">
<td style="border: none; padding: 12px;">
<img src="https://api.iconify.design/lucide/git-branch.svg?color=%23888888" width="18" style="vertical-align: middle;"> &nbsp;
<a href="#arch" style="text-decoration: none; color: #E0E0E0; font-weight: bold;">Kiến trúc Technical</a>
</td>
<td style="border: none; padding: 12px;">
<img src="https://api.iconify.design/lucide/network.svg?color=%23888888" width="18" style="vertical-align: middle;"> &nbsp;
<a href="#networking" style="text-decoration: none; color: #E0E0E0; font-weight: bold;">Đồng bộ Photon Fusion</a>
</td>
</tr>
<tr style="border: none;">
<td style="border: none; padding: 12px;">
<img src="https://api.iconify.design/lucide/activity.svg?color=%23888888" width="18" style="vertical-align: middle;"> &nbsp;
<a href="#comeback" style="text-decoration: none; color: #E0E0E0; font-weight: bold;">Hệ thống Adaptive Difficulty</a>
</td>
<td style="border: none; padding: 12px;">
<img src="https://api.iconify.design/lucide/map-pinned.svg?color=%23888888" width="18" style="vertical-align: middle;"> &nbsp;
<a href="#roadmap" style="text-decoration: none; color: #E0E0E0; font-weight: bold;">Lộ trình Roadmap</a>
</td>
</tr>
<tr style="border: none;">
<td style="border: none; padding: 12px;">
<img src="https://api.iconify.design/lucide/terminal.svg?color=%23888888" width="18" style="vertical-align: middle;"> &nbsp;
<a href="#install" style="text-decoration: none; color: #E0E0E0; font-weight: bold;">Hướng dẫn Triển khai</a>
</td>
<td style="border: none; padding: 12px;">
<img src="https://api.iconify.design/lucide/files.svg?color=%23888888" width="18" style="vertical-align: middle;"> &nbsp;
<a href="#folders" style="text-decoration: none; color: #E0E0E0; font-weight: bold;">Cấu trúc Workspace</a>
</td>
</tr>
</table>
---
</div>

View File

@@ -0,0 +1,44 @@
## <img src="https://api.iconify.design/lucide/eye.svg?color=%23FF3333" width="28" height="28" style="vertical-align: middle;"> Tầm nhìn Dự án (Project Vision)
<div align="center">
<img src="https://scove-vault.duckdns.org/files/share/vakALUeH" width="100%" style="border-radius: 12px; border: 1px solid #222; box-shadow: 0 4px 20px rgba(0,0,0,0.5);">
<br>
<img src="https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png" width="100%" height="2px">
</div>
> **BABA_YAGA** được định nghĩa là một trải nghiệm **"Psychological Asymmetric Survival"**. Chúng tôi không xây dựng một trò chơi hành động nhanh, mà xây dựng một môi trường nơi **sự kiên nhẫn** là vũ khí và **tư duy logic** là chìa khóa để sống sót. Trọng tâm của dự án xoay quanh việc thao túng nhận thức của người chơi thông qua ba trụ cột kỹ thuật:
<br>
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse;">
<tr style="border: none;">
<td width="33%" align="center" style="border: none; padding: 15px; background: rgba(255,255,255,0.03); border-radius: 10px 0 0 10px;">
<img src="https://api.iconify.design/lucide/monitor-off.svg?color=%23888888" width="32" height="32" />
<br><br>
<strong>The "Zero-UI" Philosophy</strong>
<br>
<p style="font-size: 13px; color: #999;">Triệt tiêu hoàn toàn các yếu tố HUD truyền thống. Người chơi phải quan sát nhịp thở, vết máu và môi trường để tự đánh giá trạng thái nhân vật.</p>
</td>
<td width="33%" align="center" style="border: none; padding: 15px; background: rgba(255,255,255,0.05);">
<img src="https://api.iconify.design/lucide/audio-waveform.svg?color=%2344FF44" width="32" height="32" />
<br><br>
<strong>Acoustic Navigation</strong>
<br>
<p style="font-size: 13px; color: #999;">Hệ thống Spatial Audio biến âm thanh thành "bản đồ thị giác thứ hai". Tận dụng HRTF để định vị chính xác đối phương qua các tiếng động siêu nhỏ.</p>
</td>
<td width="33%" align="center" style="border: none; padding: 15px; background: rgba(255,255,255,0.03); border-radius: 0 10px 10px 0;">
<img src="https://api.iconify.design/lucide/lightbulb.svg?color=%23FFD700" width="32" height="32" />
<br><br>
<strong>Tactical Photometry</strong>
<br>
<p style="font-size: 13px; color: #999;">Ánh sáng là tài nguyên chiến thuật. Việc quản lý photon (đèn pin, nến, lửa) quyết định ranh giới giữa kẻ đi săn và con mồi.</p>
</td>
</tr>
</table>
<br>
<div align="right">
<img src="https://api.iconify.design/lucide/info.svg?color=%23555555" width="14" style="vertical-align: middle;">
<small><i>Dự án đang trong giai đoạn Technical Alpha, tập trung tối ưu hóa hệ thống Perception.</i></small>
</div>

View File

@@ -0,0 +1,165 @@
## <img src="https://api.iconify.design/lucide/gamepad-2.svg?color=%2333CCFF" width="28" height="28" style="vertical-align: middle;"> Cơ chế Cốt lõi (Core Mechanics)
> Kiến trúc gameplay của **BABA_YAGA** được xây dựng dựa trên nguyên lý **"Thông tin Bất xứng" (Information Asymmetry)**. Hai phe tham gia không chỉ khác biệt về công cụ, mà còn trải nghiệm trò chơi ở hai chiều không gian và logic hoàn toàn trái ngược nhau.
<br>
### <img src="https://api.iconify.design/lucide/scale-3d.svg?color=%23E0E0E0" width="22" height="22" style="vertical-align: middle;"> Hệ sinh thái Bất đối xứng (The Asymmetric Paradigm)
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: none;">
<!-- HEADER ROW -->
<tr>
<td width="50%" align="left" style="background: rgba(255,215,0,0.05); padding: 15px; border-radius: 8px 0 0 0; border-bottom: 2px solid rgba(255,215,0,0.3);">
<h3 style="margin: 0; color: #FFD700;">
<img src="https://api.iconify.design/lucide/footprints.svg?color=%23FFD700" width="24" style="vertical-align: middle;"> THE SEEKER
</h3>
<small style="color: #999;">Thực thể Động (Kinetic Survivor)</small>
</td>
<td width="50%" align="left" style="background: rgba(255,51,51,0.05); padding: 15px; border-radius: 0 8px 0 0; border-bottom: 2px solid rgba(255,51,51,0.3);">
<h3 style="margin: 0; color: #FF3333;">
<img src="https://api.iconify.design/lucide/cctv.svg?color=%23FF3333" width="24" style="vertical-align: middle;"> THE TRAPPER
</h3>
<small style="color: #999;">Kiến trúc sư Bóng tối (Environment Architect)</small>
</td>
</tr>
<!-- ROW 1: VAI TRÒ -->
<tr>
<td style="padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);">
<strong><img src="https://api.iconify.design/lucide/crosshair.svg?color=%23888888" width="16" style="vertical-align: middle;"> Vai trò (Role)</strong><br>
Chủ động điều hướng (Navigation), quản lý tài nguyên sinh tồn và tìm điểm Extraction Point. Phải di chuyển liên tục để tránh bị cô lập.
</td>
<td style="padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);">
<strong><img src="https://api.iconify.design/lucide/shield-ban.svg?color=%23888888" width="16" style="vertical-align: middle;"> Vai trò (Role)</strong><br>
Thiết lập hệ thống phòng ngự tĩnh, chặn luồng di chuyển (Choke points) và dồn ép tâm lý con mồi vào bẫy tử thần.
</td>
</tr>
<!-- ROW 2: TẦM NHÌN -->
<tr>
<td style="padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);">
<strong><img src="https://api.iconify.design/lucide/eye.svg?color=%23888888" width="16" style="vertical-align: middle;"> Tầm nhìn (Perception)</strong><br>
Góc nhìn thứ nhất <b>(Immersive FPS)</b>. Bị giới hạn hoàn toàn bởi bóng tối, chỉ thấy được những gì chùm sáng đèn pin quét qua.
</td>
<td style="padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);">
<strong><img src="https://api.iconify.design/lucide/monitor.svg?color=%23888888" width="16" style="vertical-align: middle;"> Tầm nhìn (Perception)</strong><br>
Góc nhìn Thượng đế <b>(Top-down / Surveillance Cams)</b>. Quản lý bản đồ qua hệ thống Heatmap và Camera an ninh đa điểm.
</td>
</tr>
<!-- ROW 3: ĐỘNG LỰC HỌC -->
<tr>
<td style="padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);">
<strong><img src="https://api.iconify.design/lucide/wind.svg?color=%23888888" width="16" style="vertical-align: middle;"> Cơ động (Mobility)</strong><br>
Tốc độ bứt tốc cao <b>(Sprinting: 9.0m/s)</b>. Khả năng tương tác vật lý trực tiếp với môi trường (Vaulting, Sliding).
</td>
<td style="padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);">
<strong><img src="https://api.iconify.design/lucide/ghost.svg?color=%23888888" width="16" style="vertical-align: middle;"> Cơ động (Mobility)</strong><br>
Tốc độ vật lý thấp, nhưng bù đắp bằng khả năng <b>Dịch chuyển Tức thời (Teleportation)</b> qua các node mạng lưới bóng tối.
</td>
</tr>
<!-- ROW 4: CÔNG CỤ -->
<tr>
<td style="padding: 12px 15px; border-radius: 0 0 0 8px;">
<strong><img src="https://api.iconify.design/lucide/wrench.svg?color=%23888888" width="16" style="vertical-align: middle;"> Khí tài (Arsenal)</strong><br>
<img src="https://img.shields.io/badge/-Flashlight-black?style=flat&logo=dcent&logoColor=white"/>
<img src="https://img.shields.io/badge/-Dash_Mechanic-black?style=flat&logo=dash&logoColor=white"/>
<img src="https://img.shields.io/badge/-Parkour_Rig-black?style=flat&logo=framer&logoColor=white"/>
</td>
<td style="padding: 12px 15px; border-radius: 0 0 8px 0;">
<strong><img src="https://api.iconify.design/lucide/server-cog.svg?color=%23888888" width="16" style="vertical-align: middle;"> Khí tài (Arsenal)</strong><br>
<img src="https://img.shields.io/badge/-Bear_Traps-black?style=flat&logo=target&logoColor=red"/>
<img src="https://img.shields.io/badge/-Decoy_Audio-black?style=flat&logo=audacity&logoColor=red"/>
<img src="https://img.shields.io/badge/-Door_Override-black?style=flat&logo=lock&logoColor=red"/>
</td>
</tr>
</table>
<br>
### <img src="https://api.iconify.design/lucide/refresh-cw.svg?color=%23E0E0E0" width="22" height="22" style="vertical-align: middle;"> Vòng lặp Gameplay & Đồng bộ Hóa (Deterministic Game Loop)
> Toàn bộ logic bên dưới được xử lý trong `FixedUpdateNetwork()` của Photon Fusion. Chúng tôi sử dụng kiến trúc **Server Reconciliation** kết hợp **Client Prediction** để đảm bảo Seeker di chuyển mượt mà (không delay), trong khi Trapper vẫn có quyền kiểm soát toàn vẹn trạng thái bản đồ (Server Authority).
*(Lưu ý kỹ thuật: Sơ đồ dưới đây đã được cấu trúc lại thuộc tính HTML bên trong để đảm bảo khả năng render không bị lỗi trên các bộ phân tích Markdown của GitHub/Gitea)*
```mermaid
graph TD
%% Định nghĩa Style cho các nhóm (Dark Theme Optimized)
classDef initStyle fill:#1a2b3c,stroke:#33CCFF,stroke-width:2px,color:#E0E0E0;
classDef seekerStyle fill:#332200,stroke:#FFD700,stroke-width:2px,color:#FFD700;
classDef trapperStyle fill:#2b0000,stroke:#FF3333,stroke-width:2px,color:#FF3333;
classDef netStyle fill:#111111,stroke:#888888,stroke-dasharray: 5 5,color:#E0E0E0;
classDef winStyle fill:#003311,stroke:#00FF55,stroke-width:3px,color:#00FF55;
classDef criticalStyle fill:#4d0000,stroke:#FF0000,stroke-width:2px,color:#FF0000;
%% 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=%2333CCFF' 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=%23FFD700' width='20' height='20' style='vertical-align: middle;'> SEEKER (POV 1st)</b>"]
S1["<img src='https://api.iconify.design/lucide/keyboard.svg?color=%23FFD700' width='20' height='20' style='vertical-align: middle;'> Input: WASD/Space"] --> S2["<img src='https://api.iconify.design/lucide/run.svg?color=%23FFD700' width='20' height='20' style='vertical-align: middle;'> State: Move/Dash"]
S2 --> S3{"<img src='https://api.iconify.design/lucide/zap.svg?color=%23FFD700' 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=%23FFD700' width='20' height='20' style='vertical-align: middle;'> Noise Up"]
S3 -- "Sneaking" --> S5["<img src='https://api.iconify.design/lucide/volume-x.svg?color=%23FFD700' width='20' height='20' style='vertical-align: middle;'> Noise Down"]
S3 -- "Flashlight" --> S6["<img src='https://api.iconify.design/lucide/flashlight.svg?color=%23FFD700' 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=%23FFD700' 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=%23FF0000' 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=%23FF3333' width='20' height='20' style='vertical-align: middle;'> TRAPPER (STRATEGY)</b>"]
T1["<img src='https://api.iconify.design/lucide/mouse.svg?color=%23FF3333' width='20' height='20' style='vertical-align: middle;'> Mouse Input"] --> T2["<img src='https://api.iconify.design/lucide/map.svg?color=%23FF3333' width='20' height='20' style='vertical-align: middle;'> View: Heatmap/Cams"]
T2 --> T3{"<img src='https://api.iconify.design/lucide/wrench.svg?color=%23FF3333' 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=%23FF3333' width='20' height='20' style='vertical-align: middle;'> Sync Trap"]
T3 -- "Scan" --> T5["<img src='https://api.iconify.design/lucide/rss.svg?color=%23FF3333' width='20' height='20' style='vertical-align: middle;'> Ping Seeker"]
T3 -- "Lock" --> T6["<img src='https://api.iconify.design/lucide/door-closed.svg?color=%23FF3333' 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=%23FF3333' 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 LAYER</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=%2300FF55' 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=%2300FF55' 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=%2333CCFF' width='20' height='20' style='vertical-align: middle;'> Thống kê Match"]
Post_Match --> Buff{"<img src='https://api.iconify.design/lucide/scale.svg?color=%23E0E0E0' width='20' height='20' style='vertical-align: middle;'> Hệ thống Adaptive"}
Buff -- "Thua liên tiếp" --> Buff_Apply["<img src='https://api.iconify.design/lucide/gem.svg?color=%23FFD700' 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 State| T_Check
S4 -.->|Phát xạ Sóng âm| T2
T4 -.->|Collision Vô hình| S_Check
NS3 --> Loop

View File

@@ -0,0 +1,113 @@
## <img src="https://api.iconify.design/lucide/cpu.svg?color=%2333CCFF" width="28" height="28" style="vertical-align: middle;"> Kiến trúc Kỹ thuật (Technical Architecture)
> Hệ thống của **BABA_YAGA** được thiết kế theo chuẩn **Modular Architecture** (Kiến trúc Module), tách biệt hoàn toàn giữa logic xử lý vật lý (Kinematics), trạng thái mạng (Net-State) và phản hồi thị giác (Visual Feedbacks). Điều này đảm bảo hiệu năng cao (High Tickrate) ngay cả trong các môi trường mê cung phức tạp.
<br>
### <img src="https://api.iconify.design/lucide/git-merge.svg?color=%23E0E0E0" width="22" height="22" style="vertical-align: middle;"> 1. Advanced Kinematic FSM & Camera Dynamics
Hệ thống điều khiển nhân vật cốt lõi được xây dựng trên mô hình **Finite State Machine (FSM)** phân cấp. Không chỉ xử lý nội suy vật lý mượt mà, hệ thống còn tích hợp trực tiếp với **Procedural Camera Dynamics** (Head-bob, Dynamic FOV, Tilt) để tạo ra sự cộng hưởng về cảm giác nhập vai, đồng thời duy trì tính đồng bộ tuyệt đối qua lớp mạng (Networking Layer).
*(Lưu ý: Sơ đồ trạng thái dưới đây đã được tối ưu hóa cho thuật toán dự đoán phía Client)*
```mermaid
stateDiagram-v2
direction TB
state "<img src='https://api.iconify.design/lucide/footprints.svg?color=%23FFD700' width='16' style='vertical-align: middle;'> KINEMATIC GROUND" as Ground {
[*] --> Idle
state Idle {
I_P: <img src='https://api.iconify.design/lucide/anchor.svg?color=%23E0E0E0' width='16' style='vertical-align: middle;'> Vel < 0.1m/s
I_C: <img src='https://api.iconify.design/lucide/activity.svg?color=%23E0E0E0' width='16' style='vertical-align: middle;'> Breathing Cam (0.5Hz)
}
Idle --> Moving : Input.mag > 0.1
state Moving {
M_P: <img src='https://api.iconify.design/lucide/move.svg?color=%23E0E0E0' width='16' style='vertical-align: middle;'> Speed 2-4m/s
M_C: <img src='https://api.iconify.design/lucide/video.svg?color=%23E0E0E0' width='16' style='vertical-align: middle;'> Head Bob (1.2Hz)
}
Moving --> Sneaking : Hold [Sneak]
state Sneaking {
Sn_P: <img src='https://api.iconify.design/lucide/volume-x.svg?color=%2300FF55' width='16' style='vertical-align: middle;'> Acoustic Profile -50%
Sn_C: <img src='https://api.iconify.design/lucide/arrow-down-to-line.svg?color=%23E0E0E0' width='16' style='vertical-align: middle;'> Collider Height ↓
}
Moving --> Sprinting : Hold [Sprint]
Sneaking --> Moving : Release [Sneak]
state Sprinting {
Sp_P: <img src='https://api.iconify.design/lucide/zap.svg?color=%23FFD700' width='16' style='vertical-align: middle;'> Speed > 6.5m/s
Sp_C: <img src='https://api.iconify.design/lucide/aperture.svg?color=%2333CCFF' width='16' style='vertical-align: middle;'> Dynamic FOV Warp
}
Sprinting --> Moving : Stamina Depleted
}
state "<img src='https://api.iconify.design/lucide/feather.svg?color=%2333CCFF' width='16' style='vertical-align: middle;'> AIRBORNE DYNAMICS" as Air {
state Jump {
J_P: <img src='https://api.iconify.design/lucide/arrow-up-circle.svg?color=%23E0E0E0' width='16' style='vertical-align: middle;'> AddForce Up
}
state Falling {
F_P: <img src='https://api.iconify.design/lucide/trending-down.svg?color=%23FF3333' width='16' style='vertical-align: middle;'> Gravity x1.5
}
state Landing {
L_P: <img src='https://api.iconify.design/lucide/ruler.svg?color=%23E0E0E0' width='16' style='vertical-align: middle;'> Impact Raycast
}
Jump --> Falling : Vel.y < 0
Falling --> Landing : KCC.IsGrounded == true
}
state "<img src='https://api.iconify.design/lucide/crosshair.svg?color=%23FF3333' width='16' style='vertical-align: middle;'> UTILITY / ACTION" as Utility {
state Dashing {
D_P: <img src='https://api.iconify.design/lucide/wind.svg?color=%23FFD700' width='16' style='vertical-align: middle;'> Vector Burst (15m/s)
}
state Interacting {
Int_P: <img src='https://api.iconify.design/lucide/lock.svg?color=%23FF3333' width='16' style='vertical-align: middle;'> Root Motion Lock
}
}
state "<img src='https://api.iconify.design/lucide/globe.svg?color=%2333CCFF' width='16' style='vertical-align: middle;'> NET-SYNC LAYER" as Net {
state "Input Authority (Client)" as IA
state "State Authority (Server)" as SA
IA --> SA : Send Input Tick
SA --> IA : Force Reconcile
}
%% Main Transitions
Ground --> Air : KCC.IsGrounded == false
Air --> Ground : OnLandEvent.Fire()
Ground --> Utility : InvokeAbility()
Utility --> Ground : Action Complete
%% Sticky Notes for Technical Context
note left of Ground
<img src='https://api.iconify.design/lucide/database.svg?color=%23FFD700' width='14' style='vertical-align: middle;'> Sync: KCC Velocity
<img src='https://api.iconify.design/lucide/layers.svg?color=%23E0E0E0' width='14' style='vertical-align: middle;'> State: Networked Enum
end note
note right of Net
<img src='https://api.iconify.design/lucide/server-cog.svg?color=%2333CCFF' width='14' style='vertical-align: middle;'> Photon Fusion
<img src='https://api.iconify.design/lucide/shield-check.svg?color=%2300FF55' width='14' style='vertical-align: middle;'> Anti-Cheat Validated
end note
```
<br>
<img src="https://api.iconify.design/lucide/radar.svg?color=%23E0E0E0" width="22" height="22" style="vertical-align: middle;"> 2. Tactical Environment Scanner & Interaction
Việc tương tác trong một môi trường bị giới hạn hoàn toàn về tầm nhìn đòi hỏi một hệ thống truy vấn không gian (Spatial Querying) cực kỳ chính xác. Chúng tôi từ chối sử dụng cơ chế Raycast điểm đơn thông thường.
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; margin-top: 10px;">
<tr>
<td width="80px" align="center" style="background: rgba(51, 204, 255, 0.1); border-radius: 8px 0 0 8px; border-left: 3px solid #33CCFF;">
<img src="https://api.iconify.design/lucide/scan-line.svg?color=%2333CCFF" width="40" height="40">
</td>
<td style="background: rgba(255,255,255,0.03); padding: 15px; border-radius: 0 8px 8px 0;">
<h4 style="margin: 0 0 5px 0; color: #E0E0E0;">Hệ thống lõi: <code>EnvironmentScanner.cs</code></h4>
<p style="font-size: 14px; color: #999; margin: 0; line-height: 1.5;">
Sử dụng kết hợp <code>Physics.OverlapSphereNonAlloc</code> để tối ưu hóa bộ nhớ (Zero Garbage Collection) và <code>SphereCast</code> để tính toán đường đạn thể tích. Hệ thống tự động phân tích và trích xuất các đối tượng thỏa mãn đa hình <strong>Interface <code>IInteractable</code></strong>, đảm bảo người chơi có thể kích hoạt các thiết bị (Cửa, Máy phát điện, Bẫy) một cách mượt mà ngay cả khi chúng hoàn toàn chìm trong bóng tối.
</p>
</td>
</tr>
</table>
```

View File

@@ -0,0 +1,138 @@
## <img src="https://api.iconify.design/lucide/layers.svg?color=%23B026FF" width="28" height="28" style="vertical-align: middle;"> Hệ thống Mê cung (Procedural Maze Generation)
> Trái tim của **BABA_YAGA** là bộ máy kiến tạo môi trường ngẫu nhiên đa thuật toán (Multi-Algorithm Procedural Engine). Môi trường sẽ không bao giờ lặp lại, tước đoạt hoàn toàn khả năng ghi nhớ bản đồ của người chơi và ép họ phải dựa vào các giác quan sinh tồn.
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: none;">
<tr>
<!-- Prims -->
<td width="50%" style="padding: 15px; background: rgba(176,38,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05); border-right: 1px solid rgba(255,255,255,0.05);">
<strong style="color: #E0E0E0;"><img src="https://api.iconify.design/lucide/network.svg?color=%23B026FF" width="18" style="vertical-align: middle;"> Prim's Algorithm</strong>
<span style="color: #888; font-size: 12px; float: right;">| O(E log V)</span><br>
<p style="font-size: 13px; color: #999; margin-top: 8px;">Tạo cấu trúc mê cung "dày đặc", nhiều nhánh cụt đan xen. Tuyệt vời để Trapper thiết lập các choke-points (điểm thắt nút) và đặt bẫy bất ngờ.</p>
</td>
<!-- Wilsons -->
<td width="50%" style="padding: 15px; background: rgba(176,38,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.05);">
<strong style="color: #E0E0E0;"><img src="https://api.iconify.design/lucide/shuffle.svg?color=%2333CCFF" width="18" style="vertical-align: middle;"> Wilson's Algorithm</strong>
<span style="color: #888; font-size: 12px; float: right;">| O(N)</span><br>
<p style="font-size: 13px; color: #999; margin-top: 8px;">Sử dụng <i>Loop-Erased Random Walks</i> tạo ra cây khung ngẫu nhiên hoàn hảo, triệt tiêu mọi thiên hướng cấu trúc dự đoán được của Seeker.</p>
</td>
</tr>
<tr>
<!-- Recursive Backtracker -->
<td style="padding: 15px; background: rgba(176,38,255,0.02); border-right: 1px solid rgba(255,255,255,0.05);">
<strong style="color: #E0E0E0;"><img src="https://api.iconify.design/lucide/git-merge.svg?color=%23FF3333" width="18" style="vertical-align: middle;"> Recursive Backtracker</strong>
<span style="color: #888; font-size: 12px; float: right;">| O(N)</span><br>
<p style="font-size: 13px; color: #999; margin-top: 8px;">Kiến tạo các hành lang sâu, dài và quanh co. Gia tăng tối đa áp lực tâm lý cho Seeker khi phải đi dạo trong các đường hầm không lối rẽ.</p>
</td>
<!-- Crawler -->
<td style="padding: 15px; background: rgba(176,38,255,0.05);">
<strong style="color: #E0E0E0;"><img src="https://api.iconify.design/lucide/spider.svg?color=%23FFD700" width="18" style="vertical-align: middle;"> Cellular Crawler</strong>
<span style="color: #888; font-size: 12px; float: right;">| O(N)</span><br>
<p style="font-size: 13px; color: #999; margin-top: 8px;">Thuật toán đục khoét ngẫu nhiên tạo ra các không gian mở (Open Arenas) giống hang động tự nhiên, phá vỡ cấu trúc dạng Grid (lưới) cứng nhắc.</p>
</td>
</tr>
</table>
<br>
### <img src="https://api.iconify.design/lucide/cpu.svg?color=%23E0E0E0" width="22" height="22" style="vertical-align: middle;"> Quy trình Khởi tạo (Maze Generation Pipeline)
```mermaid
graph TD
%% Định nghĩa Style Dark Theme
classDef initStyle fill:#1a1025,stroke:#B026FF,stroke-width:2px,color:#E0E0E0;
classDef algoStyle fill:#0d1b2a,stroke:#33CCFF,stroke-width:2px,color:#33CCFF;
classDef matrixStyle fill:#331100,stroke:#FFD700,stroke-width:2px,color:#FFD700;
classDef unityStyle fill:#111111,stroke:#888888,stroke-dasharray: 5 5,color:#E0E0E0;
classDef readyStyle fill:#003311,stroke:#00FF55,stroke-width:2px,color:#00FF55;
Start["<img src='https://api.iconify.design/lucide/server.svg?color=%23E0E0E0' width='20'> Server Match Init"] --> Cfg["<img src='https://api.iconify.design/lucide/settings-2.svg?color=%23E0E0E0' width='20'> Seed & Ruleset Config"]
Cfg --> Engine{"<img src='https://api.iconify.design/lucide/cpu.svg?color=%23E0E0E0' width='20'> Algorithm Selector"}
subgraph Generators ["<b>CORE ALGORITHMS (DATA MATRIX)</b>"]
Engine -- "High Density" --> A1["<img src='https://api.iconify.design/lucide/share-2.svg?color=%2333CCFF' width='16'> Prim's Algorithm"]
Engine -- "True Random" --> A2["<img src='https://api.iconify.design/lucide/shuffle.svg?color=%2333CCFF' width='16'> Wilson's Algorithm"]
Engine -- "Long Paths" --> A3["<img src='https://api.iconify.design/lucide/git-merge.svg?color=%2333CCFF' width='16'> Recursive Backtracker"]
end
A1 & A2 & A3 --> Matrix["<img src='https://api.iconify.design/lucide/grid.svg?color=%23FFD700' width='20'> Logical 2D Grid Matrix<br>(0: Wall, 1: Path, 2: Room)"]
subgraph Environment ["<b>UNITY 3D INSTANTIATION</b>"]
Matrix --> Wall["<img src='https://api.iconify.design/lucide/box.svg?color=%23E0E0E0' width='16'> Spawn Walls/Floors"]
Wall --> Props["<img src='https://api.iconify.design/lucide/lamp.svg?color=%23E0E0E0' width='16'> Scatter Props & Traps"]
Props --> NavMesh["<img src='https://api.iconify.design/lucide/layers.svg?color=%23E0E0E0' width='16'> Bake Runtime NavMesh"]
end
NavMesh --> Sync["<img src='https://api.iconify.design/lucide/wifi.svg?color=%23E0E0E0' width='20'> Network Sync State"]
Sync --> Ready["<img src='https://api.iconify.design/lucide/play-circle.svg?color=%2300FF55' width='20'> MATCH READY"]
class Start,Cfg initStyle;
class Engine,A1,A2,A3 algoStyle;
class Matrix matrixStyle;
class Wall,Props,NavMesh unityStyle;
class Sync,Ready readyStyle;
<img src="https://api.iconify.design/lucide/activity.svg?color=%23FF3333" width="28" height="28" style="vertical-align: middle;"> Hệ thống Comeback (Tiered Adaptive System)
Để duy trì tính cạnh tranh và giảm thiểu sự chán nản, BABA_YAGA tích hợp một hệ thống cân bằng động ngầm. Khi một người chơi rơi vào chuỗi thua (Loss Streak), hệ thống sẽ cung cấp các đặc quyền sinh tồn tăng dần theo từng cấp bậc.
<br>
```
```mermaid
graph TD
%% Định nghĩa Style Dark Theme cho hệ thống Comeback
classDef lossStyle fill:#2b0000,stroke:#FF3333,stroke-width:2px,color:#FF3333;
classDef tier1Style fill:#332200,stroke:#FFD700,stroke-width:2px,color:#FFD700;
classDef tier2Style fill:#331a00,stroke:#FF8C00,stroke-width:2px,color:#FF8C00;
classDef tier3Style fill:#4d0000,stroke:#FF0000,stroke-width:2px,color:#FF4500;
classDef systemStyle fill:#111111,stroke:#888888,stroke-width:2px,color:#E0E0E0;
classDef winStyle fill:#003311,stroke:#00FF55,stroke-width:2px,color:#00FF55;
%% Quy trình chính
Start(("<img src='https://api.iconify.design/lucide/heart-crack.svg?color=%23FF3333' width='20'> <b>PLAYER LOSES ROUND</b>")) --> Streak{{"<img src='https://api.iconify.design/lucide/bar-chart-3.svg?color=%23E0E0E0' width='20'> Check Loss Streak"}}
%% Phân tầng Buff
subgraph Buff_Pools ["<b><img src='https://api.iconify.design/lucide/flame.svg?color=%23FF8C00' width='20'> 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=%23FFD700' width='16'> <b>Tier 1: Awakening</b><br/>(Small Boosts)"]
T2["<img src='https://api.iconify.design/lucide/shield-alert.svg?color=%23FF8C00' width='16'> <b>Tier 2: Evolution</b><br/>(Tactical Advantage)"]
T3["<img src='https://api.iconify.design/lucide/skull.svg?color=%23FF0000' width='16'> <b>Tier 3: Manifestation</b><br/>(Game Changer)"]
%% Ví dụ chỉ số
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["Wallhack (Nhìn xuyên) 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'> 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'> <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'> New Round Result?"}}
Result -- "<img src='https://api.iconify.design/lucide/trophy.svg?color=%2300FF55' width='20'> WIN" --> Reset["<img src='https://api.iconify.design/lucide/rotate-ccw.svg?color=%2300FF55' width='20'> <b>Reset Streak</b><br/>Remove All Buffs"]
Result -- "❌ LOSS" --> Increment["<img src='https://api.iconify.design/lucide/trending-up.svg?color=%23FF3333' width='20'> <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=%2300FF55' width='20'> 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;
```

View File

@@ -0,0 +1,48 @@
## <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
```

View File

@@ -0,0 +1,33 @@
## <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.

View File

@@ -0,0 +1,13 @@
## <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).

View File

@@ -0,0 +1,35 @@
## <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]``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.

View File

@@ -0,0 +1,48 @@
## 📂 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 (。•̀ᴗ-)✧
```

View File

@@ -0,0 +1,73 @@
## <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:**
[![Twitter](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/Scovy303)

203
README.md
View File

@@ -1,3 +1,8 @@
# 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.
# ![Header](https://img.shields.io/badge/PROJECT-BABA_YAGA-black?style=for-the-badge&logo=shadow)
[![Unity 6000.3.10f1](https://img.shields.io/badge/Unity-6000.3.10f1_LTS-black?logo=unity&logoColor=white)](https://unity.com/)
@@ -21,9 +26,10 @@
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)
---
## 👁️ Tầm nhìn Dự án (Project Vision)
## <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)
![Game Concept Art](https://scove-vault.duckdns.org/files/share/vakALUeH)
@@ -32,11 +38,12 @@ Dự án hướng tới việc tạo ra một trải nghiệm **"High-Stakes Hid
* **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.
---
## 🎮 Cơ chế Trò chơi (Core Mechanics)
## <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)
### 🌓 Sự bất đối xứng (The Asymmetry)
### <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) |
| :--- | :--- | :--- |
@@ -45,7 +52,7 @@ Dự án hướng tới việc tạo ra một trải nghiệm **"High-Stakes Hid
| **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. |
### 🔄 Vòng lặp Gameplay & Kiến trúc Hệ thống (Game Loop & System Architecture)
### <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
@@ -59,12 +66,12 @@ graph TD
%% Phase 1: Initialization
subgraph Initialization ["<b>1. KHỞI TẠO HỆ THỐNG (NET-SYNC)</b>"]
A["🚀 Bắt đầu Trận đấu"] --> B{"🤝 Matchmaking<br/>(Photon Fusion)"}
B --> C["🎭 Phân vai: Seeker vs Trapper"]
C --> D["🧩 Maze Generator<br/>(Prims/Wilsons)"]
D --> E["🏗️ Baking NavMesh & Colliders"]
E --> F["🧍 Character Auto-Setup"]
F --> G["📍 Spawn Players"]
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;
@@ -73,33 +80,33 @@ graph TD
G --> Loop((TICK: FixedUpdateNetwork))
%% Seeker Branch
subgraph Seeker_Logic ["<b>🏃 SEEKER (POV 1st)</b>"]
S1["⌨️ Input: WASD/Space"] --> S2["🏃 State: Move/Dash"]
S2 --> S3{" Hành động?"}
S3 -- "Sprinting" --> S4["🔊 Noise Up"]
S3 -- "Sneaking" --> S5["🤫 Noise Down"]
S3 -- "Flashlight" --> S6["🔦 Lộ vị trí"]
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{"🔍 Check Env"}
S_Check -- "Dẫm bẫy" --> S_Trap["⚠️ Bị khống chế"]
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>🕸️ TRAPPER (STRATEGY)</b>"]
T1["🖱️ Mouse Input"] --> T2["🗺️ View: Heatmap/Cams"]
T2 --> T3{"🛠️ Kỹ năng?"}
T3 -- "Đặt bẫy" --> T4["🪤 Sync Trap"]
T3 -- "Scan" --> T5["📡 Ping Seeker"]
T3 -- "Lock" --> T6["🚪 Khóa cửa"]
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{"👁️ Theo dõi"}
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>🌐 NETWORK SYNC</b>"]
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["🔄 Server Reconciliation"]
NS2 --> NS3["📦 State Sync"]
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;
@@ -109,13 +116,13 @@ graph TD
%% Phase 3: Results
subgraph Result_Logic ["<b>3. KẾT THÚC & THƯỞNG</b>"]
S_Check -- "Chạm Exit" --> Win_S["🏆 SEEKER THẮNG"]
T_Check -- "Bắt được Seeker" --> Win_T["🏆 TRAPPER THẮNG"]
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["📊 Thống kê Rank"]
Post_Match --> Buff{"⚖️ Balance Check"}
Buff -- "Thua cuộc" --> Buff_Apply["💎 Kích hoạt Comeback Buff"]
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;
@@ -128,9 +135,10 @@ graph TD
NS3 --> Loop
```
---
## 🏗️ Kiến trúc Kỹ thuật (Technical Architecture)
## <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
@@ -140,42 +148,42 @@ 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" as Ground {
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: 📝 Vel < 0.1m/s
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: 👟 Speed 2-4m/s
M_C: 🎢 Head Bob (1.2Hz)
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: 🤫 Noise -50%
Sn_C: 📉 Lower Height
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: Speed > 6.5m/s
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"
Sneaking --> Moving : "Release Sneak"
}
state "☁️ AIRBORNE" as Air {
state Jump {
J_P: 🆙 AddForce Up
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: 📉 Gravity x 1.5
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
@@ -185,16 +193,16 @@ stateDiagram-v2
Falling --> Landing : "IsGrounded == true"
}
state " ACTION" as Utility {
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: 💨 Burst 15m/s
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: 🔒 Root Motion Lock
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 "🌐 NETWORK" as Net {
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"
@@ -207,24 +215,25 @@ stateDiagram-v2
Ground --> Utility : "OnAbility"
Utility --> Ground : "Complete"
%% Sửa lỗi Note bằng cấu trúc block ✨
%% Notes
note left of Ground
Sync: Velocity
State: MoveState
<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
⚙️ Photon Fusion
⚙️ FixedUpdateNetwork
<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****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.
---
## 🧩 Hệ thống Mê cung (Maze Generation)
## <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.
@@ -248,17 +257,17 @@ graph TD
classDef winStyle fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,color:#1b5e20;
%% Quy trình chính
Start(("💔 <b>PLAYER LOSES ROUND</b>")) --> Streak{{"📊 Check Loss Streak"}}
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>🔥 HỆ THỐNG CÂN BẰNG ĐỘNG (COMEBACK POOLS)</b>"]
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["🥉 <b>Tier 1: Awakening</b><br/>(Small Boosts)"]
T2["🥈 <b>Tier 2: Evolution</b><br/>(Tactical Advantage)"]
T3["🥇 <b>Tier 3: Manifestation</b><br/>(Game Changer)"]
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"]
@@ -267,21 +276,21 @@ graph TD
end
%% Giai đoạn áp dụng
T1 & T2 & T3 --> Selection{{"🎲 Selection Mode"}}
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[" <b>Apply to Next Round Only</b><br/>(Trạng thái: Active)"]
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{{"🏁 New Round Result?"}}
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 -- "🏆 WIN" --> Reset["♻️ <b>Reset Streak</b><br/>Remove All Buffs"]
Result -- "❌ LOSS" --> Increment["📈 <b>Increase Streak</b><br/>Progress to Next Tier"]
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(("🎮 Fair Match"))
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
@@ -293,9 +302,10 @@ graph TD
class Result,Reset,NewGame winStyle;
```
---
## 🌐 Đồng bộ Mạng (Networking)
## <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ễ.
@@ -304,40 +314,39 @@ Sử dụng **Photon Fusion (State Sync)** với cơ chế Client-Side Predictio
sequenceDiagram
autonumber
%% Định nghĩa các bên tham gia (Rút gọn để tránh lỗi render)
participant IR as 🖱️ Input
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 🌐 Fusion Net
participant S as 👑 Server
participant RP as 👥 Proxies
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: 📦 Pack NetworkInputData
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: 🏃 Run Client-Side Physics
CP->>NT: ✉️ Send Input (Tick N)
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: 📝 Validate & Update State
S-->>NT: 📣 Snapshot (Tick N)
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: 🔄 RECONCILIATION
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: 🎞️ INTERPOLATION (Lerp)
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)
@@ -345,34 +354,35 @@ sequenceDiagram
RP->>RP: Smooth Mesh Movement
```
---
## ⚖️ Hệ thống Comeback Đa tầng (Tiered Adaptive System)
## <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.
### 📈 Phân tầng Buff theo Chuỗi Thua (Tiered Progression)
### <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 \%)$. |
| **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. |
---
### 🏃 Seeker: Ý chí Sinh tồn (Survival Evolution)
### <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 với mọi loại khống chế. Lúc này, Seeker là kẻ săn lùng lối thoát.
* **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.
---
### 👁️ Trapper: Quyền năng Bóng tối (Dark Rituals)
### <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:
@@ -381,9 +391,10 @@ Khi Trapper để xổng mất con mồi, mê cung sẽ hiến tế sự ổn đ
* **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.
---
## 🚀 Lộ trình Phát triển (Roadmap)
## <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 -->
@@ -397,9 +408,10 @@ Khi Trapper để xổng mất con mồi, mê cung sẽ hiến tế sự ổn đ
- [ ] Trap Placement System.
- [ ] Sound & Visual Detection (Noise Meter).
---
## 👥 Đội ngũ Phát triển & Phân chia Nhiệm vụ (The Team & WBS)
## <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.
@@ -411,30 +423,31 @@ Dự án được thực hiện bởi nhóm 3 thành viên với các vai trò c
---
## 📐 Tiêu chuẩn Kỹ thuật Nâng cao (Non-functional Requirements)
## <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:
### 🌐 Networking & Synchronization (Duy)
### <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]``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).
### 🏗️ World Generation & Performance (Scove)
### <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.
### 🪤 Gameplay & Physics (Tuấn)
### <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.
### 🎨 Visuals & UI/UX (Tuấn)
### <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)
@@ -457,7 +470,7 @@ Dự án được tổ chức theo tiêu chuẩn công nghiệp (Standard Indust
│ │ │ │ ├── 🧵 Wilsons.cs
│ │ │ │ └── 🗺️ Maze.cs
│ │ │ └── 🧍 CharacterAutoSetup.cs
│ │ ├── 🖱️ Interactables/
│ │ ├── 鼠标 Interactables/
│ │ │ ├── 🚪 DoorInteractable.cs
│ │ │ ├── 💡 LampInteractable.cs
│ │ │ └── 💎 BaseInteractable.cs
@@ -486,9 +499,10 @@ Dự án được tổ chức theo tiêu chuẩn công nghiệp (Standard Indust
└── 📝 README.md # Creator (。•̀ᴗ-)✧
```
---
## 🤝 Hướng dẫn Cài đặt & Khởi chạy (Installation & Setup)
## <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:
@@ -522,7 +536,7 @@ Trò chơi yêu cầu **AppID** hợp lệ để hoạt động qua mạng:
---
## 💖 Support & Community
## <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">
@@ -561,3 +575,4 @@ Trò chơi yêu cầu **AppID** hợp lệ để hoạt động qua mạng:
**Connect with us:**
[![Twitter](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://x.com/Scovy303)