Repo ↗ · 原始 README ↗ · 文件包(Markdown/授權)

封面參考(原作): The Elder Scrolls V: Skyrim - Special Edition · 原作宣傳圖,由 IGDB 提供。圖片版權屬原權利人,供辨識原作使用,不代表此重寫/模組專案的實際畫面。

來源維護者: Mudcrab-Team · 版本: 0f48d2965c05 · 整理日期: 2026-10-12

文件授權: MIT · LICENSE-APACHE · LICENSE-MIT · 本文形式: README 翻譯

下文為來源 README 的繁中翻譯,由 Kirikirin 使用 AI 輔助整理;功能、完成度與測試結果均為原作者描述,本站未逐項實機驗證。圖片改為來源連結,指令與技術識別保留原文。


Mudcrab

README 圖片:CodeRabbit Pull Request Reviews
[README 圖片:Rust](https://www.rust-lang.org/)
[README 圖片:Engine](https://bevyengine.org/)
[README 圖片:License: MIT](https://github.com/Mudcrab-Team/mudcrab/blob/0f48d2965c057dcfeb5ae7fe73b3b845b95dce93/LICENSE-MIT)
[README 圖片:License: Apache 2.0](https://github.com/Mudcrab-Team/mudcrab/blob/0f48d2965c057dcfeb5ae7fe73b3b845b95dce93/LICENSE-APACHE)
[README 圖片:CI Status](https://github.com/Mudcrab-Team/mudcrab/blob/0f48d2965c057dcfeb5ae7fe73b3b845b95dce93/README.md#-quick-start-development-setup)
[README 圖片:Platforms](https://github.com/Mudcrab-Team/mudcrab/blob/0f48d2965c057dcfeb5ae7fe73b3b845b95dce93/docs/specs/meta/platforms.md)

一個開源、高效能的遊戲引擎重實作,相容於 The Elder Scrolls V: Skyrim (Special Edition) 的資產,以 Rust 從零打造,並使用 Bevy Engine。

受到 OpenMW 等開源引擎重實作啟發,Mudcrab 將 Bethesda 的舊式遊戲格式(.esm、.bsa、.nif、.dds、.pex)現代化為 GPU 原生、適合串流的格式(glTF 2.0、KTX2 Basis、SQLite 3 / libSQL、Luau),以實現 60+ FPS 高效能遊戲體驗,且沒有載入畫面。

[!IMPORTANT]
法律免責聲明: Mudcrab 是一個獨立的開源專案,並非隸屬於、受其背書或與 Bethesda Softworks LLC、ZeniMax Media Inc. 或 Microsoft Corporation 有任何關聯。「The Elder Scrolls」與「Skyrim」是 Bethesda Softworks / ZeniMax Media 的註冊商標。本儲存庫不散布任何專有遊戲資產。需要合法購買的原版遊戲才能提供遊戲資料。完整法律聲明請見 LEGAL.md。


✨ 功能與架構亮點

  • 🚀 零載入畫面: 室內與室外城市轉換透過 libSQL 空間 R-Tree 索引與 rkyv 零複製記憶體映射,100% 即時無縫載入。
  • ⚡ 高 FPS Vercidium 渲染: 批次化實例化間接繪製呼叫(DrawMeshInstancedIndirect)將 5,000+ 個個別繪製呼叫降至每幀 100 個以下。
  • 📜 Luau 腳本引擎(mlua): 以沙箱化、JIT 編譯的 Luau 腳本取代單執行緒 Papyrus。包含非同步 HTTP 網路功能,可連接即時 Web API(例如真實世界天氣同步模組)。
  • 📱 跨平台(桌上型與行動裝置): 原生支援 Windows、Linux、macOS(Apple Silicon)與 Android(ARM64 / POCO F5)。
  • 🎨 現代化 UI(Bevy 0.19 bsn!): 將過時的 Flash(.gfx)選單轉譯為硬體加速的宣告式 Bevy UI 節點樹。
  • 🎮 整合式模組管理器: 內建啟動器,支援拖放壓縮檔安裝,以及依優先權加權的 .esp/.esl 外掛載入順序。

🏗️ 工作區 Crate 架構

Mudcrab 組織為模組化的 Cargo 工作區:

mudcrab/
├── Cargo.toml                  # Workspace Root Manifest
├── LEGAL.md                    # Legal & Trademark Disclaimers
├── crates/
│   ├── launcher/      # GUI Setup Wizard & Built-in Mod Manager
│   ├── converter/     # Asset Converter Pipeline (.nif ➔ .glb, .dds ➔ KTX2, .esm ➔ libSQL)
│   ├── shared/        # Versioned coordinate, database, and cell-cache contracts
│   ├── engine/        # Bevy Game Engine Binary (Render, Physics, Luau, Audio)
│   └── dummy-content/ # Synthetic mock asset generation for tests & CI
Crate 職責
launcher 首次執行設定精靈、遊戲路徑偵測、內建模組管理器 UI、觸發轉換器進度條,並啟動引擎。
converter 重量級離線資產轉換器(mesh-tools、basis-universal、ddsfile、nom 二進位解析器)。
shared 轉換與執行階段共用的版本化契約,包括座標與地形 cell 快取。
engine 輕量、極快速的遊戲二進位檔(Bevy 0.19+、wgpu、libsql、mlua Luau JIT)。
dummy-content 程序化、合成資產 fixture,用於在沒有專有遊戲檔案的情況下進行自動化測試。

🗺️ 專案藍圖

Mudcrab 正依 5 個核心階段系統性地建構。在 docs/roadmap/ 中探索完整藍圖規格。


🚀 快速開始(開發環境設定)

先決條件

  • Rust(2024 Edition)
  • CMake 與 Ninja / GCC(用於原生 libSQL / SQLite 編譯)

建置與執行

  1. 複製儲存庫:

    git clone https://github.com/Mudcrab-Team/mudcrab.git
    cd mudcrab
    
  2. 檢查工作區編譯:

    cargo check --workspace
    
  3. 執行啟動器應用程式:

    cargo run -p launcher
    

選擇 Skyrim Data 以轉換實體 Data 資料夾,或選擇 MO2 profile 以疊加 Mod Organizer 2 設定檔。開啟 MO2 設定,拖入包含 ModOrganizer.ini 的執行個體資料夾,並從下拉式選單中選擇偵測到的設定檔(MO2 的作用中設定檔預設會被選取,若無則退回至第一個偵測到的設定檔)。Skyrim Data 資料夾仍必須作為基底。在拖入輸出資料夾前請先關閉設定。來源設定會套用至 Start 與 Resume,並依每次啟動器工作階段選取。MO2 來源會就地讀取;不支援原生 SKSE 外掛。執行個體必須宣告支援的 Skyrim gameName。設定的目錄可透過 junction 解析,但設定檔、已啟用模組與資產的 reparse point 會被拒絕。

在不重建世界的情況下修復失敗的轉換

cargo run -p converter --bin converter -- repair-failed "<Skyrim Data>" "<output directory>" --mo2-instance "<MO2 instance>" --mo2-profile "<profile>"

這會讀取原始 manifest,並將失敗的輸入、來自失敗壓縮檔的資產,以及必要的貼圖與骨架相依項目,暫存到唯一的 <output>/.repair--<timestamp> 目錄中。鬆散的 MO2 檔案會就地讀取。修復會暫存 pack 以供驗證,在支援的情況下連結未變更的資產,重新 finalize skyrim_world.db 以更新網格邊界,並重新執行整合;它不會從外掛重建世界。請為修復後的資產、重寫的中繼資料,以及無法使用硬連結時的複本預留磁碟空間。若為實體 Data,請省略 MO2 選項。

預設為預覽:檢查 repair-report.json 與暫存的 assets/ 資料夾;已發布的 pack 不會變更,除非是在復原先前中斷的發布。加上 --apply 重複執行,以驗證現有成品雜湊並發布修復。轉換與修復共用獨佔輸出鎖定,且無法在引擎持有其執行階段讀取鎖定時執行。發布會在取代檔案前寫入回復日誌,並最後更新 manifest;下一次轉換或修復會復原中斷的修復。發布是可復原的,但對未取得鎖定的讀取者而言並非原子性。

設定必須與原始轉換相符,且未解決的失敗或失敗的整合會阻止發布。必要時提供原始編碼設定:--texture-encoder、--texture-fallback-quality、--texture-uastc-level 與 --texture-zstd-level(以及對應的 GPU 選項)。GPU 修復使用與轉換相同的 GPU 編碼 worker,包括設定的品質與 CPU 後備。變更 MO2 視窗設定或停用的模組項目不會使整個轉換快取失效;勝出的資產與外掛變更會分別追蹤。

資產相容性變更

相容性變更也適用於實體 Data 資料夾轉換:CalienteTools 下的 BodySlide/Outfit Studio 資源會作為作者資料被排除,manifest 會記錄 excluded_inputs,且不支援的 NIF 版本會被明確拒絕。粒子大小解析與動態形狀復原會還原先前被省略的幾何。

動態頭部、頭髮與眼睛網格現在會產生幾何。PR #154 審查 回報總 GLB 大小從 209 MB 增加至 451 MB;這些是審查者提供的測量值,並非此處重現的基準測試。腳本快照差異來自指令分派分塊,而非 Mudcrab 標頭重新命名,後者早已在 main 中。

GPU 貼圖編碼

轉換器會將 DDS 區塊可被 GPU 直接取樣的貼圖(DXT1–DXT5、BC1–BC7)原樣複製到 KTX2。其他所有貼圖,主要是 Skyrim 的未壓縮地形與 LOD 貼圖,預設在 CPU 上轉換:未壓縮的 8 位元 RGB(A)(24-bit、X8R8G8B8、A8R8G8B8、A8B8G8R8、DXGI BGRA/BGRX)會區塊壓縮為原生 BC7,其餘貼圖則編碼為 UASTC(Basis Universal)。使用 --texture-encoder gpu 時,wgpu 運算著色器會將它接收的每個貼圖(包括未壓縮 RGB(A))改為編碼為 UASTC,並寫入具有相同 Zstandard 超壓縮的 KTX2,因此引擎不需要任何變更:

cargo run --release -p converter -- "<Skyrim Data>" "<output directory>" --texture-encoder gpu

由編碼器作者在完整的 Skyrim SE 轉換上測量(Ryzen 5 5600G、RTX 5090、NVMe),從零開始:

CPU 編碼器 GPU 編碼器
整體轉換 28 分 08 秒 8 分 55 秒
貼圖階段(10,236 個編碼、22,709 個複製) 20 分 37 秒 1 分 29 秒

CPU 時間是在 CPU 路徑為未壓縮貼圖寫入原生 BC 之前測量的(截至 #119);它們描述的是 CPU 上的 UASTC 編碼。

在作者的 20 個樣本貼圖上,品質約比 CPU 編碼器的 UASTC level 2 低 0.3–0.5 dB PSNR,且皆是在 BC7 轉碼後(桌上型)與作為 ASTC(行動裝置)。比較工具並非本儲存庫的一部分,因此請將這些數據視為參考。

  • --gpu-quality N — 端點細化傳遞次數,0–8(預設 2)。
  • --gpu-batch-mb N — 打包進單一 GPU 分派的來源 MB 數(預設 256)。

GPU 路徑無法處理的貼圖(體積貼圖、無法解碼的格式)會使用 CPU 編碼器,在沒有可用硬體 GPU 時,整次執行也是如此。若 GPU 在執行中途失敗(驅動程式錯誤或裝置遺失),所有尚未完成的內容會改在 CPU 上編碼。編碼後的貼圖會依編碼器分別快取,因此切換編碼器只會重新轉換它們;複製的貼圖與網格則會重複使用。


📚 技術規格(docs/specs/)

如需詳細技術規格、格式解析與架構指南,請探索 docs/specs/ 目錄:


🤝 貢獻

我們歡迎社群貢獻!無論你是在修正資產轉換器的錯誤、增強 Bevy 渲染管線,或撰寫文件,在提交 PR 前請先查看我們的指南:

  • 📖 CONTRIBUTING.md — 開發工作流程、程式碼風格(cargo fmt/clippy)與 PR 準則的指南。
  • 📜 LEGAL.md — 智慧財產權政策與相容性準則。
  • 🐛 Issue Tracker — 搜尋現有問題,或使用我們的範本回報新錯誤。

⚖️ 法律免責聲明與授權條款

授權條款

Mudcrab 依您的選擇,採用下列任一條款進行雙重授權:

法律聲明與商標免責聲明

Mudcrab 是一個獨立的開源遊戲引擎重實作。它不包含或散布任何屬於 Bethesda Softworks LLC 或 ZeniMax Media Inc. 的受著作權保護之遊戲資產、美術作品、3D 模型、音訊或遊戲資料。使用者必須自備其合法持有的 The Elder Scrolls V: Skyrim 副本,以擷取遊戲資料。

所有商標均為其各自所有人之財產,並嚴格依據指名性合理使用原則,用於相容性描述。請參閱 LEGAL.md 中的完整聲明。


授權與來源聲明

原始 README 與翻譯沿用 MIT 授權;本次修改為繁中翻譯、連結與排版調整。可修改的 Markdown、原始 README、LICENSE 與 NOTICE 收錄於頂部文件包。原作遊戲內容與商標不因此獲得授權。

LICENSE-APACHE

Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

LICENSE-MIT

MIT License

Copyright (c) 2026 Mudcrab Contributors

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 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.