Work in progress

The content of this page was not yet updated for Godot 4.2 and may be outdated. If you know how to improve this page or you can confirm that it's up to date, feel free to open a pull request.

프로젝트 내보내기

왜 내보내나요?

원래, Godot는 프로젝트를 내보내는 수단이 없었습니다. 개발자는 적절한 바이너리를 컴파일하고 각 플랫폼으로 패키지를 수동으로 만들었습니다.

더 많은 개발자가 (그리고 심지어 비프로그래머까지) Godot를 사용하기 시작했고, 우리 회사가 동시에 더 많은 프로젝트를 시작하면서, 이것이 병목 현상인 것이 분명해 졌습니다.

PC에서

Godot로 PC에서 게임 프로젝트를 배포하는 것은 비교적 쉽습니다. Godot 바이너리를 project.godot 파일의 형태로 같은 디렉토리에 드롭하고, 프로젝트 디렉토리를 압축하면 끝입니다.

간단해 보이지만, 개발자들이 이 방식을 원하지 않는 몇 가지 이유가 있을 것입니다. 첫 째로 많은 파일을 배포하는 것은 바람직하지 않을 수 있습니다. 일부 개발자들은 호기심 많은 사용자가 게임이 만들어진 방법을 알아내는 것을 좋아하지 않을 수도 있고, 다른 개발자들이 게임이 잘 만들어지지 않은 것을 발견할 수도 있습니다. 또 다른 이유는 개발자가 특별히 컴파일된 바이너리를 선호하기 때문인데, 크기 면에서 더 작지만 더 많이 최적화되어 있으면서, 편집기와 디버거같은 툴을 갖지 않기 때문입니다.

마지막으로, Godot는 추가 패키지 파일로 DLC를 만드는 간단하면서도 효율적인 :ref:`시스템 <doc_exporting_pcks>`을 갖고 있습니다.

모바일에서

모바일 플랫폼에서의 같은 시나리오는 좀 더 나쁩니다. 이 기기로 프로젝트를 배포하기 위해, 각 플랫폼을 위한 바이너리가 지어지고, 네이티브 프로젝트에 게임 데이터와 함께 추가됩니다.

이것은 개발자가 각 플랫폼의 SDK에 익숙해져야 내보낼 수 있음을 의미하기 때문에 번거로울 수 있습니다. 각 SDK를 배우는 것을 항상 권장하는 반면, 바람직하지 않은 시간에 SDK를 강제 실행하는 것은 방해가 될 수 있습니다.

There is also another problem with this approach: different devices prefer some data in different formats to run. The main example of this is texture compression. All PC hardware uses S3TC (BC) compression and that has been standardized for more than a decade, but mobile devices use different formats for texture compression, such as ETC1 and ETC2.

내보내기 메뉴

다른 내보내기 워크플로에서 여러번 시도한 끝에, 현재의 것이 작업에 가장 좋다는 것을 증명했습니다. 이 글을 쓰는 시점에는, 모든 플랫폼을 지원하고 있지는 않겠지만, 지원되는 플랫폼이 계속 커져 갈 것입니다.

내보내기 메뉴를 열려면, 내보내기 버튼을 클릭하세요:

../../_images/export.png

내보내기 메뉴가 열릴 것입니다. 하지만 완전히 비어있죠. 내보내기 프리셋을 추가해야 되기 때문입니다.

../../_images/export_dialog.png

내보내기 프리셋을 만들기 위해, 내보내기 메뉴 위에 추가… 버튼을 클릭합니다. 그러면 내보내기 프리셋을 고를 수 있는 플랫폼의 드롭 다운 목록이 열립니다.

../../_images/export_preset.png

기본 설정은 대개 내보내기에 충분합니다, 그래서 내보내기를 만져보는 것은 보통은 필수적이지 않습니다. 하지만 많은 플랫폼에서는 내보낼 수 있도록 추가 툴(SDKs)이 설치되어 있어야 합니다. 또한, Godot는 패키지를 만들기 위해 설치된 내보내기 템플릿이 필요합니다. 메뉴가 없으면 내보내기 메뉴가 불평하고 사용자가 문제를 해결할 때까지 해당 플랫폼으로 내보낼 수 없습니다:

../../_images/export_error.png

그 순간, 사용자는 문서를 다시 읽고 플랫폼을 어떻게 정확히 설정하는 지에 대한 설명서를 따라야 한다는 것을 직감합니다.

The buttons at the bottom of the menu allow you to export the project in a few different ways:

  • Export All: Export the project as a playable build (Godot executable and project data) for all the presets defined. All presets must have an Export Path defined for this to work.

  • Export Project: Export the project as a playable build (Godot executable and project data) for the selected preset.

  • Export PCK/ZIP: Export the project resources as a PCK or ZIP package. This is not a playable build, it only exports the project data without a Godot executable.

템플릿 내보내기

플랫폼 설정 외에도, 내보내기 템플릿은 프로젝트를 내보내기 위해 반드시 설치되어 있어야 합니다. 이들은 웹사이트의 다운로드 페이지에서 (ZIP 아카이브에서 이름을 바꾼) TPZ 파일에 들어있습니다.

다운로드 했다면, 편집기에서 내보내기 템플릿 관리 설정으로 설치할 수 있습니다:

../../_images/exptemp.png

Resource options

내보낼 때, Godot는 내보내고 패키지를 만들기 위한 모든 파일의 목록을 만듭니다. 내보내기 위한 3가지 다른 모드가 있습니다:

  • 프로젝트의 모든 리소스 내보내기

  • 선택한 씬 내보내기 (종속된 리소스 포함)

  • 선택한 리소스 내보내기 (종속된 리소스 포함)

../../_images/expres.png

Export all resources in the project 옵션으로 프로젝트의 모든 리소스를 내보낼 수 있습니다. Export selected scenesExport selected resources 를 사용하면 각각 씬 또는 리소스의 목록이 나타나며, 내보내고 싶은 씬 혹은 리소스를 선택하시면 됩니다.

../../_images/expselected.png

참고

Files and folders whose name begin with a period will never be included in the exported project. This is done to prevent version control folders like .git from being included in the exported PCK file.

Below the list of resources are two filters that can be setup. The first allows non resource files such as .txt, .json and .csv to be exported with the project. The second filter can be used to exclude every file of a certain type without manually deselecting every one. For example, .png files.

Configuration files

The export configuration is stored in two files that can both be found in the project directory:

  • export_presets.cfg: This file contains the vast majority of the export configuration and can be safely committed to version control. There is nothing in here that you would normally have to keep secret.

  • .godot/export_credentials.cfg: This file contains export options that are considered confidential, like passwords and encryption keys. It should generally not be committed to version control or shared with others unless you know exactly what you are doing.

Since the credentials file is usually kept out of version control systems, some export options will be missing if you clone the project to a new machine. The easiest way to deal with this is to copy the file manually from the old location to the new one.

명령줄에서 내보내기

개발에 있어, 빌드를 자동화하는 것이 유용합니다, 그리고 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 명령줄(Command line) 튜토리얼 for more information about using Godot from the command line.

PCK와 ZIP 파일 포맷의 비교

두 포맷은 각각의 장단점을 갖고 있습니다. PCK는 기본 설정이며 대부분의 상황에서 사용이 권장되는 포맷입니다. 하지만 경우에 따라 ZIP을 사용하는 것이 좋은 경우도 있습니다.

PCK 포맷:

  • 압축되지 않은 포맷입니다. 파일 용량이 크지만 읽기/쓰기 속도가 빠릅니다.

  • 일반 사용자가 갖고 있는 툴로는 읽기나 쓰기가 불가능하지만 PCK를 생성 및 압축해제 할 수 있는`서드파티 툴 <https://github.com/hhyyrylainen/GodotPckTool>`__ 이 존재합니다.

ZIP 포맷:

  • 압축 포맷입니다. 파일의 용량이 작지만 읽기/쓰기가 느립니다.

  • 일반 사용자가 갖고 있는 툴로 읽기 및 쓰기가 가능합니다. 때문에 모딩이 쉬워지는 장점이 있습니다(:ref:`doc_exporting_pcks`를 참고하십시오).

경고

버그 로 인해 ZIP 파일을 팩 파일로 사용하면 내보낸 이진 파일이 이를 자동으로 찾아 사용하지 않습니다. 따라서 플레이어가 직접 클릭 혹은 터미널에서 사용할 수 있는 런처 스크립트 를 다음과 같이 따로 생성해야 합니다:

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

런처 스크립트를 이진 파일과 동일한 폴더에 저장하십시오. Linux의 경우, 런처 스크립트가 chmod +x launch.sh 명령을 사용할 권한이 있는지 확인해야 합니다.