exporting_projects.rst 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. .. _doc_exporting_projects:
  2. Exporting projects
  3. ==================
  4. Why exporting?
  5. --------------
  6. Originally, Godot did not have any means to export projects. The
  7. developers would compile the proper binaries and build the packages for
  8. each platform manually.
  9. When more developers (and even non-programmers) started using it, and
  10. when our company started taking more projects at the same time, it
  11. became evident that this was a bottleneck.
  12. On PC
  13. ~~~~~
  14. Distributing a game project on PC with Godot is rather easy. Just drop
  15. the godot.exe (or godot) binary together in the same place as the
  16. engine.cfg file, zip it and you are done. This can be taken advantage of to
  17. make custom installers.
  18. It sounds simple, but there are probably a few reasons why the developer
  19. may not want to do this. The first one is that it may not be desirable
  20. to distribute loads of files. Some developers may not like curious users
  21. peeking at how the game was made, others may just find it inelegant,
  22. etc.
  23. Another reason is that, for distribution, the developer might prefer a
  24. specially compiled binary, which is smaller in size, more optimized and
  25. does not include tools inside (like the editor, debugger, etc.).
  26. Finally, Godot has a simple but efficient system for creating DLCs as
  27. extra package files.
  28. On mobile
  29. ~~~~~~~~~
  30. The same scenario in mobile is a little worse. To distribute a project
  31. in those devices, a binary for each of those platforms is built, then
  32. added to a native project together with the game data.
  33. This can be troublesome because it means that the developer must be
  34. familiarized with the SDK of each platform before even being able to
  35. export. While learning each SDK is always encouraged, it can be
  36. frustrating to be forced to do it at an undesired time.
  37. There is also another problem with this approach. Different devices
  38. prefer some data in different formats to run. The main example of this
  39. is texture compression. All PC hardware uses S3TC (BC) compression and
  40. that has been standardized for more than a decade, but mobile devices
  41. use different formats for texture compression, such as PVRCT (iOS) or
  42. ETC (Android).
  43. Export dialog
  44. -------------
  45. After many attempts at different export workflows, the current one has
  46. proven to work the best. At the time of this writing, not all platforms are
  47. supported yet, but the supported platforms continue to grow.
  48. To open the export dialog, just click the "Export" button:
  49. .. image:: /img/export.png
  50. The dialog will open, showing all the supported export platforms:
  51. .. image:: /img/export_dialog.png
  52. The default options are often enough to export, so tweaking them is not
  53. necessary, but provide extra control. However, many platforms require additional
  54. tools (SDKs) to be installed to be able to export. Additionally, Godot
  55. needs export templates installed to create packages. The export dialog
  56. will complain when something is missing and will not allow the user to
  57. export for that platform until they resolve it:
  58. .. image:: /img/export_error.png
  59. At that time, the user is expected to come back to the documentation and follow
  60. instructions on how to properly set up that platform.
  61. Export templates
  62. ~~~~~~~~~~~~~~~~
  63. Apart from setting up the platform, the export templates must be
  64. installed to be able to export projects. They can be obtained as a
  65. .tpz (a renamed .zip) file from the `download page of the website
  66. <https://www.godotengine.org/download>`_.
  67. Once downloaded, they can be installed using the "Install Export
  68. Templates" option under the "Settings" menu in the top right corner
  69. of the editor:
  70. .. image:: /img/exptemp.png
  71. Export mode
  72. ~~~~~~~~~~~
  73. When exporting, Godot makes a list of all the files to export and then
  74. creates the package. There are 3 different modes for exporting:
  75. - Export every single file in the project
  76. - Export only resources (+custom filter), this is default.
  77. - Export only selected resources (+custom filter)
  78. .. image:: /img/expres.png
  79. - **Export every single file** - This mode exports every single file in
  80. the project. This is good to test if something is being forgotten,
  81. but developers often have a lot of unrelated stuff around in the dev
  82. directory, which makes it a bad idea.
  83. - **Export only resources** - Only resources are exported. For most
  84. projects, this is enough. However many developers like to use custom
  85. datafiles in their games. To compensate for this, filters can be
  86. added for extra extensions (like, *.txt,*.csv, etc.).
  87. - **Export only selected resources** - Only select resources from a
  88. list are exported. This is probably overkill for most projects, but
  89. in some cases it is justified (usually huge projects). This mode
  90. offers total control of what is exported. Individual resources can be
  91. selected and dependency detection is performed to ensure that
  92. everything needed is added. As a plus, this mode allows to
  93. "Bundle" scenes and dependencies into a single file, which is
  94. *really* useful for games distributed on optical media.
  95. .. image:: /img/expselected.png