2026-06-07 21:17:51 +07:00
<div id="mechanics"></div>
2026-06-07 19:41:43 +07:00
## <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
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 ;
2026-06-07 21:17:51 +07:00
classDef netStyle fill:#111111 ,stroke:#888888 ,stroke-dasharray:5 5,color:#E0E0E0 ;
2026-06-07 19:41:43 +07:00
classDef winStyle fill:#003311 ,stroke:#00FF55 ,stroke-width:3px,color:#00FF55 ;
classDef criticalStyle fill:#4d0000 ,stroke:#FF0000 ,stroke-width:2px,color:#FF0000 ;
2026-06-07 21:17:51 +07:00
subgraph Initialization ["1. KHỞI TẠO HỆ THỐNG (NET-SYNC)"]
A["🚀 Bắt đầu Trận đấu"] --> B{"🤝 Matchmaking\nPhoton Fusion"}
B --> C["🎭 Phân vai: Seeker vs Trapper"]
C --> D["🧩 Maze Generator\nPrims/Wilsons"]
D --> E["🏛️ Baking NavMesh & Colliders"]
E --> F["👤 Character Auto-Setup"]
F --> G["📍 Spawn Players"]
2026-06-07 19:41:43 +07:00
end
2026-06-07 21:17:51 +07:00
class A,B,C,D,E,F,G initStyle;
subgraph Active_Round ["2. VÒNG LẶP CHIẾN ĐẤU (CORE LOOP)"]
G --> Loop(["⚙️ TICK: FixedUpdateNetwork"])
subgraph Seeker_Logic ["⚡ SEEKER - POV 1st Person"]
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í"]
S4 & S5 & S6 --> S_Check{"🔍 Check Env"}
S_Check -- "Dẫm bẫy" --> S_Trap["⚠️ Bị khống chế"]
2026-06-07 19:41:43 +07:00
end
2026-06-07 21:17:51 +07:00
subgraph Trapper_Logic ["🔧 TRAPPER - Strategy View"]
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"]
T4 & T5 & T6 --> T_Check{"👁️ Theo dõi"}
2026-06-07 19:41:43 +07:00
end
2026-06-07 21:17:51 +07:00
subgraph Network_Sync ["🌐 NETWORK SYNC LAYER"]
2026-06-07 19:41:43 +07:00
Loop --> NS1["⏩ Client Prediction"]
2026-06-07 21:17:51 +07:00
NS1 --> NS2["🔄 Server Reconciliation"]
NS2 --> NS3["📦 State Sync"]
2026-06-07 19:41:43 +07:00
end
end
2026-06-07 21:17:51 +07:00
class S1,S2,S3,S4,S5,S6,S_Check seekerStyle;
class T1,T2,T3,T4,T5,T6,T_Check trapperStyle;
class NS1,NS2,NS3,Loop netStyle;
2026-06-07 19:41:43 +07:00
class S_Trap criticalStyle;
2026-06-07 21:17:51 +07:00
subgraph Result_Logic ["3. KẾT THÚC & THƯỞNG"]
S_Check -- "Chạm Exit" --> Win_S["🏆 SEEKER THẮNG"]
T_Check -- "Bắt được Seeker" --> Win_T["🏆 TRAPPER THẮNG"]
2026-06-07 19:41:43 +07:00
Loop -- "Timer = 0" --> Win_T
2026-06-07 21:17:51 +07:00
Win_S & Win_T --> Post_Match["📊 Thống kê Match"]
Post_Match --> Buff{"⚖️ Hệ thống Adaptive"}
Buff -- "Thua liên tiếp" --> Buff_Apply["💎 Kích hoạt Comeback Buff"]
2026-06-07 19:41:43 +07:00
Buff_Apply --> A
end
class Win_S,Win_T winStyle;
2026-06-07 21:17:51 +07:00
class Post_Match,Buff,Buff_Apply initStyle;
2026-06-07 19:41:43 +07:00
2026-06-07 21:17:51 +07:00
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
```