diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e59ec63 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Preserve the accepted upstream standalone viewer bytes on every platform. +public/architecture/hex-tactics/*.html -text diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ce2a867..6e2d7b4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,15 +3,15 @@ name: Deploy static site to GitHub Pages on: push: branches: [main] + pull_request: + branches: [main] workflow_dispatch: permissions: contents: read - pages: write - id-token: write concurrency: - group: pages + group: pages-${{ github.ref }} cancel-in-progress: false jobs: @@ -27,16 +27,25 @@ jobs: cache: npm - name: Install dependencies run: npm ci + - name: Verify accepted architecture bundle + run: node scripts/check-architecture-bundle.mjs - name: Build run: npm run build env: NEXT_PUBLIC_GOATCOUNTER_CODE: ${{ vars.GOATCOUNTER_CODE }} + - name: Verify architecture files survive static export + run: node scripts/check-architecture-bundle.mjs --export - name: Upload Pages artifact uses: actions/upload-pages-artifact@v3 with: path: out deploy: + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + permissions: + contents: read + pages: write + id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/README.md b/README.md index 0708a52..74d07c4 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,17 @@ npm run dev 3. Push to `main`; the workflow at `.github/workflows/deploy.yml` will publish the generated `out/` folder. 4. Add a custom domain later in GitHub Pages settings when the domain is ready. +## Interactive architecture + +The Projects page links to the Hex Tactics Archify viewers: + +- Chinese: https://bibi45c.github.io/architecture/hex-tactics/ +- English: https://bibi45c.github.io/architecture/hex-tactics/en.html + +These self-contained HTML files are published from `public/architecture/hex-tactics/` without modifying their accepted upstream bytes. Editable JSON and source evidence remain in [the game repository](https://github.com/bibi45c/UEA-CMP-SEM2-GAME-Turn_Based_Strategy); `provenance.json` records the delivery commit, architecture evidence commit and file hashes. Do not hand-edit the generated viewers. To refresh them, validate and deliver in the game repository, copy the accepted HTML/preview files here and update the provenance hashes. Run `node scripts/check-architecture-bundle.mjs`, build, then run it again with `--export` before publishing. + +The older `/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/` and `/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/en.html` paths redirect to these blog-hosted viewers, keeping existing game README links usable. No separate game-repository Pages site or DNS change is needed. If a separate game Pages site is enabled later, it may take precedence over those compatibility paths; use the canonical architecture URLs above. + ## Visit counts The site uses GoatCounter for per-post counts and the site total. Create a GoatCounter diff --git a/app/project/page.js b/app/project/page.js index dd71d7b..37be550 100644 --- a/app/project/page.js +++ b/app/project/page.js @@ -1,5 +1,6 @@ import Description from "@/components/Description"; import MotionDivWrapper from "@/components/MotionDivWrapper"; +import Image from "next/image"; export default function ProjectPage() { return ( @@ -10,6 +11,25 @@ export default function ProjectPage() { className="flex flex-col gap-10" > +
+ + + + Hex Tactics runtime architecture: exploration, shared combat rules and synchronous event feedback + + +
+

Hex Tactics — Interactive architecture / 交互架构图

+

Explore the Unity tactical RPG's exploration and combat systems, shared rules and source references. Both language editions include theme controls, search and export.

+

查看探索与战斗系统、共用规则和源码证据。中英文版本均支持主题切换、搜索与导出。

+ +

Architecture evidence: main 42f3a2b. This map is a pinned runtime snapshot, not a gameplay acceptance result.

+
+

Case studies are being prepared.

diff --git a/public/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/en.html b/public/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/en.html new file mode 100644 index 0000000..d0adf99 --- /dev/null +++ b/public/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/en.html @@ -0,0 +1,14 @@ + + + + + + + + Hex Tactics — Interactive architecture + + +

The viewer is now hosted on the blog. Open the English architecture

+ + + diff --git a/public/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/index.html b/public/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/index.html new file mode 100644 index 0000000..5c2391b --- /dev/null +++ b/public/UEA-CMP-SEM2-GAME-Turn_Based_Strategy/index.html @@ -0,0 +1,14 @@ + + + + + + + + Hex Tactics — 交互架构图 + + +

架构图已迁移至博客。打开中文架构图

+ + + diff --git a/public/architecture/hex-tactics/ARCHIFY-LICENSE.md b/public/architecture/hex-tactics/ARCHIFY-LICENSE.md new file mode 100644 index 0000000..0f9f939 --- /dev/null +++ b/public/architecture/hex-tactics/ARCHIFY-LICENSE.md @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2026 tt-a1i (Archify) +Copyright (c) 2025 Cocoon AI + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/public/architecture/hex-tactics/en.html b/public/architecture/hex-tactics/en.html new file mode 100644 index 0000000..05376b3 --- /dev/null +++ b/public/architecture/hex-tactics/en.html @@ -0,0 +1,15019 @@ + + + + + + + Hex Tactics — Runtime Architecture Diagram + + + + + + + + +
+ +
+
+
+

Hex Tactics — Runtime Architecture

+
+
+ + + + + + + +
+ + Hex Tactics — Runtime Architecture + An architecture diagram generated by Archify. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Player input & HUD · Select, move, cast, end turn · Architecture component + + + + Player input & HUD + Select, move, cast, end turn + + + + Exploration · Movement, party, encounters · Architecture component + + + + Exploration + Movement, party, encounters + + + + GameBootstrap · Scene entry & system setup · Architecture component + + + + GameBootstrap + Scene entry & system setup + + + + CombatSceneController · Combat lifecycle & services · Architecture component + + + + CombatSceneController + Combat lifecycle & services + + + + Combat services · Turns, AP, abilities & effects · Architecture component + + + + Combat services + Turns, AP, abilities & effects + + + + ScriptableObject · Unit, ability, status, surface · Architecture component + + + + ScriptableObject + Unit, ability, status, surface + + + + Enemy AI · Scoring, movement & abilities · Architecture component + + + + Enemy AI + Scoring, movement & abilities + + + + Unit runtime state · Stats, HP/AP, faction & position · Architecture component + + + + Unit runtime state + Stats, HP/AP, faction & position + + + + Hex tactical world · Grid, paths, cover & surfaces · Architecture component + + + + Hex tactical world + Grid, paths, cover & surfaces + + + + EventBus · Synchronous in-process dispatch · Architecture component + + + + EventBus + Synchronous in-process dispatch + + + + Presentation · Combat UI, VFX, audio & camera · Architecture component + + + + Presentation + Combat UI, VFX, audio & camera + + + + + + Commands + + + + Call rules + + + + Turn events + + + + Subscribers + + + + Encounter callback + + + + Set up combat + + + + Read definitions + + + + Shared actions & abilities + + + + Update HP / AP + + + + Grid & surface queries + + + + + + + + Legend + + + Input & presentation + + + + Game systems + + + + Definitions + + + + Event bus + + + +

+ + + + + + + + + +
+ + +
+
+
+
+

Responsibilities & data

+
+
    +
  • • MonoBehaviour binds scenes; plain C# owns rules and state
  • +
  • • ScriptableObject defines units, abilities, statuses and surfaces
  • +
  • • AP pool: movement costs per cell; abilities consume ApCost
  • +
+
+ +
+
+
+

Calls & feedback

+
+
    +
  • • TurnManager publishes turn events directly
  • +
  • • AbilityExecutor returns results; controller / AI publish damage events
  • +
  • • EventBus synchronously notifies UI, VFX and audio; not an async queue
  • +
+
+ +
+
+
+

Scope & revision

+
+
    +
  • • Exploration and combat runtime; intro story and editor tools omitted
  • +
  • • Based on main 42f3a2b; SRC links are pinned to that revision
  • +
  • • After architecture changes, update JSON, regenerate and validate HTML
  • +
+
+
+ +
+ + + + diff --git a/public/architecture/hex-tactics/index.html b/public/architecture/hex-tactics/index.html new file mode 100644 index 0000000..0db5c64 --- /dev/null +++ b/public/architecture/hex-tactics/index.html @@ -0,0 +1,15019 @@ + + + + + + + Hex Tactics — 运行时架构 + + + + + + + + +
+ +
+
+
+

Hex Tactics — 运行时架构

+
+
+ + + + + + + +
+ + Hex Tactics — 运行时架构 + 由 Archify 生成的架构图。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 玩家输入与 HUD · 选择、移动、技能、结束回合 · 架构组件 + + + + 玩家输入与 HUD + 选择、移动、技能、结束回合 + + + + 探索阶段 · 自由移动、队伍跟随、遭遇 · 架构组件 + + + + 探索阶段 + 自由移动、队伍跟随、遭遇 + + + + GameBootstrap · 场景入口、系统装配与切换 · 架构组件 + + + + GameBootstrap + 场景入口、系统装配与切换 + + + + CombatSceneController · 战斗生命周期与服务编排 · 架构组件 + + + + CombatSceneController + 战斗生命周期与服务编排 + + + + 共享战斗服务 · 回合、AP、技能与效果结算 · 架构组件 + + + + 共享战斗服务 + 回合、AP、技能与效果结算 + + + + ScriptableObject 定义 · 单位、技能、状态与地表 · 架构组件 + + + + ScriptableObject 定义 + 单位、技能、状态与地表 + + + + 敌方 AI · 目标评分、移动与技能决策 · 架构组件 + + + + 敌方 AI + 目标评分、移动与技能决策 + + + + 单位运行时状态 · 属性、HP/AP、阵营与位置 · 架构组件 + + + + 单位运行时状态 + 属性、HP/AP、阵营与位置 + + + + 六边形战术世界 · 网格、寻路、掩体与地表 · 架构组件 + + + + 六边形战术世界 + 网格、寻路、掩体与地表 + + + + EventBus · 进程内同步事件分发 · 架构组件 + + + + EventBus + 进程内同步事件分发 + + + + 表现与反馈层 · 战斗 UI、VFX、音频与相机 · 架构组件 + + + + 表现与反馈层 + 战斗 UI、VFX、音频与相机 + + + + + + 战术命令 + + + + 调用规则服务 + + + + 发布回合事件 + + + + 订阅事件反馈 + + + + 遭遇回调 + + + + 装配战斗系统 + + + + 读取定义资产 + + + + 共用行动与技能 + + + + 更新 HP / AP + + + + 查询网格与地表 + + + + + + + + 图例 + + + 输入与表现 + + + + 游戏系统 + + + + 定义资产 + + + + 事件总线 + + + +

+ + + + + + + + + +
+ + +
+
+
+
+

职责与数据

+
+
    +
  • • MonoBehaviour 绑定场景;纯 C# 服务承载规则与状态
  • +
  • • ScriptableObject 保存单位、技能、状态和地表定义
  • +
  • • AP 池驱动行动;移动按格子、技能按 ApCost 消耗
  • +
+
+ +
+
+
+

调用与反馈

+
+
    +
  • • TurnManager 直接发布回合事件
  • +
  • • AbilityExecutor 返回结果;控制器 / AI 发布伤害等事件
  • +
  • • EventBus 同步通知 UI、VFX 和音频;不是异步队列
  • +
+
+ +
+
+
+

范围与版本

+
+
    +
  • • 聚焦探索 → 战斗运行时;省略开场故事与编辑器工具
  • +
  • • 基于 main 提交 42f3a2b;SRC 链接固定到该版本
  • +
  • • 架构调整后需更新 JSON 并重新生成、验证 HTML
  • +
+
+
+ +
+ + + + diff --git a/public/architecture/hex-tactics/preview-dark.png b/public/architecture/hex-tactics/preview-dark.png new file mode 100644 index 0000000..0ebf3e2 Binary files /dev/null and b/public/architecture/hex-tactics/preview-dark.png differ diff --git a/public/architecture/hex-tactics/preview-light.png b/public/architecture/hex-tactics/preview-light.png new file mode 100644 index 0000000..4d3f04a Binary files /dev/null and b/public/architecture/hex-tactics/preview-light.png differ diff --git a/public/architecture/hex-tactics/provenance.json b/public/architecture/hex-tactics/provenance.json new file mode 100644 index 0000000..077b554 --- /dev/null +++ b/public/architecture/hex-tactics/provenance.json @@ -0,0 +1,12 @@ +{ + "sourceRepository": "https://github.com/bibi45c/UEA-CMP-SEM2-GAME-Turn_Based_Strategy", + "deliveryRevision": "55ed3db26cce287c6326080a625e165723e430cc", + "evidenceRevision": "42f3a2b8d6bc3e4b847abec1f34cae841fda204d", + "generator": "Archify 2.17.0-dev.1", + "files": { + "index.html": {"source": "site/index.html", "sha256": "0c337d055885387bc23aaf8a6a513ffdea9cea3d26230c1606df3fcca26bf9f8"}, + "en.html": {"source": "site/en.html", "sha256": "60f7cf49bd77fb530e9d87d550d12cb5b61d16dc87a62989694c372ac09d1e2a"}, + "preview-light.png": {"source": "Docs/Architecture_Preview_EN.png", "sha256": "85a768e580fde30fb55adc1d3d3dff0b0dc93a3079fc74facf3c20b9e2cdeec9"}, + "preview-dark.png": {"source": "Docs/Architecture_Preview_EN_Dark.png", "sha256": "2f529703847f78170c4c68a4d07dc6e784d6de16b29ebf32c4b494c6297696bb"} + } +} diff --git a/scripts/check-architecture-bundle.mjs b/scripts/check-architecture-bundle.mjs new file mode 100644 index 0000000..2757ef2 --- /dev/null +++ b/scripts/check-architecture-bundle.mjs @@ -0,0 +1,37 @@ +import assert from 'node:assert/strict'; +import { createHash } from 'node:crypto'; +import { readFileSync } from 'node:fs'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +const bundle = 'architecture/hex-tactics/'; +const read = (path) => readFileSync(resolve(root, path)); +const manifest = JSON.parse(read(`public/${bundle}provenance.json`)); +assert.match(manifest.deliveryRevision, /^[a-f0-9]{40}$/); +assert.match(manifest.evidenceRevision, /^[a-f0-9]{40}$/); +for (const [file, record] of Object.entries(manifest.files)) { + assert.ok(['index.html', 'en.html', 'preview-light.png', 'preview-dark.png'].includes(file)); + const bytes = read(`public/${bundle}${file}`); + assert.equal(createHash('sha256').update(bytes).digest('hex'), record.sha256, file); + if (file.endsWith('.html')) { + const html = bytes.toString('utf8'); + assert.ok(html.includes(manifest.evidenceRevision)); + assert.ok(html.includes(file === 'en.html' ? ']*(?:src|href)=["'](?:https?:)?\/\//i.test(html)); + } + if (process.argv.includes('--export')) { + assert.ok(bytes.equals(read(`out/${bundle}${file}`)), `Static export changed ${file}`); + } +} +assert.equal(Object.keys(manifest.files).length, 4); +assert.ok(read(`public/${bundle}ARCHIFY-LICENSE.md`).toString('utf8').includes('MIT License')); +for (const [file, destination] of [['index.html', `/${bundle}`], ['en.html', `/${bundle}en.html`]]) { + const path = `UEA-CMP-SEM2-GAME-Turn_Based_Strategy/${file}`; + const bytes = read(`public/${path}`); + assert.ok(bytes.toString('utf8').includes(`url=${destination}`), `Invalid legacy redirect ${file}`); + if (process.argv.includes('--export')) assert.ok(bytes.equals(read(`out/${path}`))); +} +const projects = read(process.argv.includes('--export') ? 'out/project/index.html' : 'app/project/page.js').toString('utf8'); +for (const path of [`/${bundle}`, `/${bundle}en.html`]) assert.ok(projects.includes(path)); +console.log('Architecture bundle passed: accepted EN/ZH hashes, themes, license, project links and legacy redirects' + (process.argv.includes('--export') ? ', including static export.' : '.'));