プロジェクトのエクスポート¶
エクスポートする理由は?¶
当初、Godotにはプロジェクトをエクスポートする手段がありませんでした。 開発者は適切なバイナリをコンパイルし、各プラットフォーム用のパッケージを手動でビルドします。
より多くの開発者(さらには非プログラマ)がそれを使用し始め、当社が同時により多くのプロジェクトを取り始めたとき、これがボトルネックであることが明らかになりました。
PC上¶
Godotを使用してPC上でゲームプロジェクトを配布することはかなり簡単です。Godotバイナリを project.godot
ファイルと同じディレクトリにドロップし、プロジェクトディレクトリを圧縮すれば完了です。
これは簡単に聞こえますが、おそらく開発者がこれをしたくない理由がいくつかあります。 1つ目は、ファイルの読み込みを分散することが望ましくない場合があることです。一部の開発者は、好奇心旺盛なゲームユーザーがゲームの作成方法を覗き見るのを好まない場合があり、また他の開発者はゲームが洗練されていないなどと感じるかもしれません。もう1つの理由は、開発者が特別にコンパイルされたバイナリを好む可能性があることです。バイナリはサイズが小さく、より最適化されており、エディタやデバッガなどのツールは含まれません。
Finally, Godot has a simple but efficient system for creating DLCs as extra package files.
モバイル上¶
モバイルプラットフォームでの同じシナリオは少し厄介です。これらのデバイスでプロジェクトを配布するには、これらの各プラットフォームのバイナリがビルドされ、ゲームデータと共にネイティブプロジェクトに追加されます。
これは、開発者がエクスポートする前に各プラットフォームのSDKに精通している必要があることを意味するため、面倒な場合があります。各SDKを学ぶことは常に奨励されていますが、望ましくない時間にそれを行うことを余儀なくされることはイライラする可能性があります。
このアプローチには別の問題もあります。異なるデバイスは、実行するのに異なる形式のデータを好みます。この主な例は、テクスチャ圧縮です。すべてのPCハードウェアはS3TC(BC)圧縮を使用し、10年以上にわたって標準化されていますが、モバイルデバイスはPVRTC(iOS)やETC(Android)などのさまざまな形式のテクスチャ圧縮を使用します。
コマンドラインからエクスポート¶
制作においては自動ビルドが便利ですが、Godotではコマンドラインのパラメータ--export
および--export-debug
を使うことで可能になります。コマンドラインからのエクスポートでも、設定のためにエクスポート用プリセットを指定する必要があります。コマンドラインでの基本的な呼び出し方はこうです:
godot --export "Windows Desktop" some_name.exe
This will export to some_name.exe
, assuming there is a preset
called "Windows Desktop" and the template can be found. (The export preset name
must be written within quotes if it contains spaces or special characters.)
The output path is relative to the project path or absolute;
it does not respect the directory the command was invoked from.
The output file extension should match the one used by the Godot export process:
Windows:
.exe
macOS:
.zip
(from all platforms) or.dmg
(only when exporting from macOS)..app
is not supported directly, although the generated ZIP archive contains an.app
bundle.Linux: Any extension (including none).
.x86_64
is typically used for 64-bit x86 binaries.HTML5:
.zip
Android:
.apk
iOS:
.zip
You can also configure it to export only the PCK or ZIP file, allowing a single exported main pack file to be used with multiple Godot executables. When doing so, the export preset name must still be specified on the command line:
godot --export-pack "Windows Desktop" some_name.pck
It is often useful to combine the --export
flag with the --path
flag, so that you do not need to cd
to the project folder before running
the command:
godot --path /path/to/project --export "Windows Desktop" some_name.exe
参考
See コマンドラインチュートリアル for more information about using Godot from the command line.
PCK versus ZIP pack file formats¶
Each format has its upsides and downsides. PCK is the default and recommended format for most use cases, but you may want to use a ZIP archive instead depending on your needs.
PCK format:
Uncompressed format. Larger file size, but faster to read/write.
Not readable and writable using tools normally present on the user's operating system, even though there are third-party tools to extract and create PCK files.
ZIP format:
Compressed format. Smaller file size, but slower to read/write.
Readable and writable using tools normally present on the user's operating system. This can be useful to make modding easier (see also Pack、パッチ、そしてModをエクスポートする).
警告
Due to a known bug, when using a ZIP file as a pack file, the exported binary will not try to use it automatically. Therefore, you have to create a launcher script that the player can double-click or run from a terminal to launch the project:
:: launch.bat (Windows)
@echo off
my_project.exe --main-pack my_project.zip
# launch.sh (Linux)
./my_project.x86_64 --main-pack my_project.zip
Save the launcher script and place it in the same folder as the exported binary.
On Linux, make sure to give executable permissions to the launcher script using
the command chmod +x launch.sh
.