Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

為 Linux 匯出

也參考

這個頁面描述的是如何將 Godot 專案匯出到 Linux。如果你想要找的是從源碼編譯編輯器或匯出範本二進位檔案,請閱讀 在 Linux、*BSD 上編譯

要為 PC 發行遊戲最簡單的方法就是複製可執行檔 (Windows 上為 godot.exe ,其餘為 godot),壓縮資料夾並將壓縮檔傳送給其他人。但我們通常不想這麼做。

通過匯出系統,Godot 提供一種更優雅的方法來在 PC 平台上發行。為 PC 平台匯出時 (Linux, Windows, macOS),匯出工具會以所有的專案檔案建立成一個 data.pck 檔案。該檔案會內涵一個特別最佳化過的二進位,這個二進位檔更小、更快,而且不包含編輯器與除錯工具。

架構

There are 7 different processor architectures that exported Godot projects can run on in Linux:

  • x86_64

  • x86_32

  • arm64

  • arm32

  • rv64

  • ppc64

  • loongarch64

The default is x86_64, this is the most common architecture of PC processors today. All modern Intel and AMD processors as of writing this are x86_64.

x86_32 will give you a 32bit executable that can run on 32bit only distributions of Linux as well as some modern distributions that are 64bit. It is NOT recommended to use this option unless you are trying to get your project to run on an old 32bit distribution and processor. It should also be noted that several prominent distributions, such as Fedora, have been discussing removing their 32bit libraries which would prevent executables made this way from running on future versions of that distribution.

arm64 executables can run on 64bit ARM processors. If you're familiar with the Raspberry Pi, those have utilized 64bit ARM processors since the Pi 3 (older versions used 32bit ARM processors). If you're uploading to a platform that supports multiple executables, such as itch.io, and you're confident your game could run on a common ARM computer, such as the Pi 5, then we'd recommend exporting this version and providing it as an option.

arm32 executables are for older 32bit arm processors, such as what the Raspberry Pi 1 and 2 used. Given that they're not common at all these days we do not recommend exporting for this unless you have a computer with one of these processors you know you can, and want to have your game running on.

rv64 is for RISC-V processors, ppc64 is for 64bit PowerPC processors, and loongarch64 is for 64bit LoongArch processors. All of these architectures are substantially more niche when it comes to running videogames on them. And we only recommend exporting for them if you have a reason to, such as if you're an enthusiast who owns hardware. Official export templates are not provided by Godot, you will have to create them on your own. Instructions for compiling the engine for RISC-V and creating export templates can be found on the 在 Linux、*BSD 上編譯 page.

環境變數

您可以使用下列環境變數在編輯器外部設定匯出選項。在匯出過程中,這些值會覆寫您在匯出選單中設定的值。

Linux 匯出環境變數

匯出選項

環境變數

加密/加密金鑰

GODOT_SCRIPT_ENCRYPTION_KEY

匯出選項

完整的可用匯出選項列表請見 EditorExportPlatformLinuxBSD 類別參考。