Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ An educational, *Uncharted-Waters*-style game that reframes offshore **wind-farm
### Gameplay loop
- **One full work-order loop**: accept order → buy parts → mobilization-readiness check → sail out → board the tower → SCADA diagnosis quiz → SOP steps → finish / multi-day overhaul.
- **Mobilization gate** — no teleporting: repair is locked until you've assigned a vessel, a matching-discipline engineer, the required part in stock and a weather window, then sailed out (travel time + boarding delay in rough seas).
- **Two-layer design** — a graded **7-mission campaign** (teacher opens it week by week) plus an always-open **Ops Center sandbox** that streams endless judgment situations and feeds the leaderboard.
- **Live Fleet Ops room** — every farm has **24 individual turbines**; dispatch engineers to parallel work orders, remote-reset soft faults, and run preventive inspections in real time.
- **Two-layer design** — a graded **7-mission campaign** (teacher opens it week by week) plus an always-open **Ops Center sandbox** that streams endless judgment situations and feeds the leaderboard, with a standalone **Exam Mode** on top for formal assessment.
- **Live Fleet Ops room** — every farm has **24 individual turbines**; dispatch engineers to parallel work orders, remote-reset soft faults, and run preventive inspections in real time. **Crew shortage / strike events bite for real**: a manpower shortfall cuts how many on-site work fronts you can run in parallel (not just a HUD number), recovering as the crew rests.
- **First-time interactive onboarding tutorial** — the assistant **Lily** runs a hand-holding, mobile-game-style coach-mark walkthrough (spotlight the relevant button, dim the rest) through one complete work-order loop. Skippable, and replayable from the settings (⚙) menu.

### Decision support & learning loop
Expand All @@ -44,12 +44,15 @@ An educational, *Uncharted-Waters*-style game that reframes offshore **wind-farm
### Teaching design
- **Fault-diagnosis quiz + SOP** is the learning core: each fault is a SCADA alarm → 4-choice "what to check FIRST" quiz → 5-step SOP (first two pre-done: confirm weather window, LOTO lock-out).
- **192-template judgment-task engine** across 7 categories (corrective / predictive / preventive / operational / weather / logistics / incident), most with trade-off choices, teaching feedback, and aid charts (trend / spectrum / radar).
- **Exam Mode** — a standalone, no-hint, single-attempt assessment that draws a balanced cross-category set (10 or 20 questions), grades A–F with a per-category breakdown and a miss-review, and feeds knowledge-point mastery & the mistake log **without** touching your game score.
- **Codex** of cleared faults for revision, **Course Mode** for teachers (assign a week's fault, lock graded missions by week), knowledge-point tagging, and a **cloud class leaderboard** (free, no backend) via a Google Apps Script Web App with server-side validation; nickname + class-code login, per-user save isolation.
- **Instructor panel & mastery drill-down** — with a class + teacher code, read the whole class's latest progress (score / days / availability / generation), export CSV, and **click any student to drill into per-discipline / per-category accuracy** synced from the cloud (backend v2.2+).
- **Knowledge-point mastery & active-recall mistake log**, plus a per-discipline ability radar on the profile page.
- **Bilingual (繁中 / English)**, character/dialogue system, procedural Web Audio SFX/BGM.

### Technical
- **Three background modes** — Simulation (animated CSS), Realistic (photos) and Comic (Uncharted-Waters illustrations); plus a 60° **aerial farm view**; turbines, vessels & substation rendered per scene on a 1600×900 scaling stage.
- Pure DOM/CSS UI (no game engine); art is layered SVG/CSS plus transparent PNG portraits.
- **Three background modes** — Simulation (animated CSS), Realistic (photos) and Comic (Uncharted-Waters illustrations); plus a 60° **aerial farm view**; turbines, vessels & substation rendered per scene on a 1600×900 scaling stage. In Realistic / Comic mode the **home-port build-out overlays a real harbour photo**, turning your upgrades into visible growth against a real backdrop.
- **PWA** (installable / offline), a mobile portrait layout, and a boot safety-net that prevents blank screens after an update. Pure DOM/CSS UI (no game engine); art is layered SVG/CSS plus transparent PNG portraits.

## Tech stack
React 18 + TypeScript + Vite 6 + Tailwind CSS. Game state is a pure reducer (`src/state/game.ts`); persistence via localStorage with optional cloud save.
Expand All @@ -60,7 +63,7 @@ npm install
npm run dev # http://localhost:5173
npm run build # type-check + production build
npm run typecheck # tsc --noEmit
npm test # dependency-free game-logic tests (test/run.mjs) — 154 passing
npm test # dependency-free game-logic tests (test/run.mjs) — 164 passing
npm run sim # balance simulator: passive / active / full-crew strategies (test/sim.mjs)
npm run stress # concurrency/load simulation for the cloud leaderboard backend (test/stress.mjs)
```
Expand All @@ -75,15 +78,18 @@ src/
│ ├─ farms.ts # 4 farms × 24 units each
│ ├─ events.ts / incidents.ts # random events & fault catalogue (Fleet Ops)
│ ├─ tasks.ts # 192-template judgment-task engine
│ ├─ exam.ts # Exam Mode engine (draw / grade, pure & deterministic)
│ ├─ mastery.ts / records.ts # knowledge-point mastery, achievements & bests
│ └─ profile.ts / course.ts # login, class code, weekly unlock
├─ ui/
│ ├─ campaign.ts # 7-mission storyline (4 acts)
│ ├─ faults.ts # 5 fault types: quiz + SOP + part + discipline
│ ├─ faults.ts # 25 fault types across 5 disciplines: quiz + SOP + part
│ ├─ data.ts # market parts catalogue
│ ├─ screens/ # Hub / Market / Sail / Repair
│ ├─ FleetOpsModal / OpsCenterModal / FacilityModal # live ops, sandbox, facilities
│ └─ IntroRunner / TopBar / Portrait / Forecast # onboarding, HUD, dialogue, weather
├─ cloud/sheet.ts # Apps Script leaderboard client
│ ├─ FleetOpsModal / OpsCenterModal / ExamModal # live ops, sandbox, exam
│ ├─ TeacherModal / PortModal / FacilityModal # instructor drill-down, port build-out
│ └─ IntroRunner / TopBar / Portrait / Forecast # onboarding, HUD, dialogue, weather
├─ cloud/sheet.ts / cloud/api.ts # Apps Script leaderboard & cloud save / teacher client
public/assets/ # characters, scenes, audio
docs/ # design, manual, roadmap, walkthrough
```
Expand Down
24 changes: 15 additions & 9 deletions README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
### 玩法循環
- **完整工單循環**:接單 → 備料 → 出勤就緒檢查 → 出海航行 → 登塔 → SCADA 診斷答題 → SOP 步驟 → 完工/多回合大修。
- **出勤就緒閘門** — 不能瞬移到風機:維修需先備妥船舶、對應科別技師、必備備品與天氣窗,並航行抵達(含航行時間、浪高登船延誤)。
- **雙層架構** — 計分的**主線 7 關**(教師按週開放)+永遠開放的**自由營運沙盒**(無限判斷型狀況、衝排行榜)。
- **風場戰情室(即時營運層)** — 每座風場 **24 台個體機組**;即時派遣技師執行並行工單、遠端重啟軟性故障、執行預防性定檢。
- **雙層架構** — 計分的**主線 7 關**(教師按週開放)+永遠開放的**自由營運沙盒**(無限判斷型狀況、衝排行榜),另加獨立的**測驗模式**做正式評量
- **風場戰情室(即時營運層)** — 每座風場 **24 台個體機組**;即時派遣技師執行並行工單、遠端重啟軟性故障、執行預防性定檢。**人員短缺/罷工事件會真的影響決策**:缺工會折抵你能同時開的現場作業面(不只是 HUD 數字),並隨班組休整逐日回復。
- **首次互動式新手教學** — 助理**莉莉**以手機遊戲式的「聚光燈引導(coach-mark)」(高亮對應按鈕、其餘變暗)帶你走完一次完整工單循環;可跳過,並可從設定(⚙)選單重新播放。

### 出海決策支援與學習迴路
Expand All @@ -44,12 +44,15 @@
### 教學設計
- **故障診斷測驗 + SOP** 為學習核心:每個故障 = SCADA 告警 → 4 選 1「最先排查什麼」測驗 → 5 步 SOP(前兩步預設完成:確認天氣窗、LOTO 上鎖)。
- **192 題判斷型任務引擎**,七大類(故障搶修/監控判讀/預防保養/營運決策/天候處置/供應鏈人力/突發),多為取捨題+教學回饋+輔助圖(趨勢/頻譜/天氣雷達)。
- **獨立測驗模式** — 跨類別均衡抽題(10 或 20 題)、**作答不給提示、單次作答**,結束才公布 A–F 等第、各類別對錯與錯題覆盤;計入知識點掌握度與錯題本,但**不影響遊戲分數**。
- **圖鑑**(已修故障複習)、**課程模式**(教師指派某週故障、按週鎖計分主線)、知識點標籤,以及**雲端班級排行榜**(免費免後端,Google Apps Script Web App+伺服端防作弊);暱稱+班級碼登入、每人存檔獨立。
- **教師檢視面板與掌握度鑽取** — 輸入班級碼+教師碼即可唯讀檢視全班最新進度(分數/天數/可用率/發電量)、匯出 CSV,並可**點任一學生展開各科別/類別正確率鑽取**(雲端同步,後端 v2.2+)。
- **知識點掌握度與錯題本主動回想**,個人檔案頁另有各科別能力雷達圖。
- **中英雙語**、人物對話系統、Web Audio 合成音效音樂。

### 技術
- **三種背景模式** — 模擬(會動 CSS)、實境(照片)、漫畫(大航海插畫);另有 60° **俯瞰全景**;風機、船舶與變電站逐場景繪製,1600×900 等比舞台。
- 介面為純 DOM/CSS(無遊戲引擎);美術為 SVG/CSS 圖層加透明 PNG 立繪。
- **三種背景模式** — 模擬(會動 CSS)、實境(照片)、漫畫(大航海插畫);另有 60° **俯瞰全景**;風機、船舶與變電站逐場景繪製,1600×900 等比舞台。實境/漫畫模式下,**母港建設會疊在母港實景照片上**,把升級成果化為看得見的成長。
- **PWA**(可安裝/離線)、手機直向精簡版面,以及防止更新後空白的啟動安全網。介面為純 DOM/CSS(無遊戲引擎);美術為 SVG/CSS 圖層加透明 PNG 立繪。

## 技術棧
React 18 + TypeScript + Vite 6 + Tailwind CSS。遊戲狀態為純 reducer(`src/state/game.ts`);以 localStorage 存檔,可選雲端同步。
Expand All @@ -60,7 +63,7 @@ npm install
npm run dev # http://localhost:5173
npm run build # 型別檢查 + 正式打包
npm run typecheck # tsc --noEmit
npm test # 免相依的遊戲邏輯測試(test/run.mjs)— 154 項全綠
npm test # 免相依的遊戲邏輯測試(test/run.mjs)— 164 項全綠
npm run sim # 平衡模擬器:passive / active / full-crew 三策略(test/sim.mjs)
npm run stress # 雲端排行榜後端的併發/負載模擬(test/stress.mjs)
```
Expand All @@ -75,15 +78,18 @@ src/
│ ├─ farms.ts # 4 座風場 × 每座 24 機組
│ ├─ events.ts / incidents.ts # 突發事件與故障型錄(戰情室)
│ ├─ tasks.ts # 192 題判斷型任務引擎
│ ├─ exam.ts # 測驗模式引擎(抽題/判分,純函式、可決定性)
│ ├─ mastery.ts / records.ts # 知識點掌握度、成就與最佳紀錄
│ └─ profile.ts / course.ts # 登入、班級碼、每週開放
├─ ui/
│ ├─ campaign.ts # 主線 7 關(四幕)
│ ├─ faults.ts # 5 種故障:測驗 + SOP + 備品 + 科別
│ ├─ faults.ts # 25 種故障、五大科別:測驗 + SOP + 備品
│ ├─ data.ts # 交易所備品型錄
│ ├─ screens/ # 母港 / 交易所 / 出海 / 維修
│ ├─ FleetOpsModal / OpsCenterModal / FacilityModal # 戰情室、沙盒、設施
│ └─ IntroRunner / TopBar / Portrait / Forecast # 新手教學、HUD、對話、天氣
├─ cloud/sheet.ts # Apps Script 排行榜用戶端
│ ├─ FleetOpsModal / OpsCenterModal / ExamModal # 戰情室、沙盒、測驗
│ ├─ TeacherModal / PortModal / FacilityModal # 教師鑽取、母港建設、設施
│ └─ IntroRunner / TopBar / Portrait / Forecast # 新手教學、HUD、對話、天氣
├─ cloud/sheet.ts / cloud/api.ts # Apps Script 排行榜與雲端存檔/教師用戶端
public/assets/ # 角色、場景、音訊
docs/ # 設計、手冊、藍圖、攻略
```
Expand Down
Loading
Loading