project_organization.rst 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. .. _doc_project_organization:
  2. Project organization
  3. ====================
  4. Introduction
  5. ------------
  6. Since Godot has no restrictions on project structure or filesystem usage,
  7. organizing files when learning the engine can seem challenging. This
  8. tutorial suggests a workflow which should be a good starting point.
  9. We will also cover using version control with Godot.
  10. Organization
  11. ------------
  12. Godot is scene-based in nature, and uses the filesystem as-is,
  13. without metadata or an asset database.
  14. Unlike other engines, many resources are contained within the scene
  15. itself, so the amount of files in the filesystem is considerably lower.
  16. Considering that, the most common approach is to group assets as close
  17. to scenes as possible; when a project grows, it makes it more
  18. maintainable.
  19. As an example, one can usually place into a single folder their basic assets,
  20. such as sprite images, 3D model meshes, materials, and music, etc.
  21. They can then use a separate folder to store built levels that use them.
  22. ::
  23. /project.godot
  24. /docs/.gdignore # See "Ignoring specific folders" below
  25. /docs/learning.html
  26. /models/town/house/house.dae
  27. /models/town/house/window.png
  28. /models/town/house/door.png
  29. /characters/player/cubio.dae
  30. /characters/player/cubio.png
  31. /characters/enemies/goblin/goblin.dae
  32. /characters/enemies/goblin/goblin.png
  33. /characters/npcs/suzanne/suzanne.dae
  34. /characters/npcs/suzanne/suzanne.png
  35. /levels/riverdale/riverdale.scn
  36. Importing
  37. ---------
  38. Godot versions prior to 3.0 did the import process from files outside
  39. the project. While this can be useful in large projects, it
  40. resulted in an organization hassle for most developers.
  41. Because of this, assets are now transparently imported from within the project
  42. folder.
  43. Ignoring specific folders
  44. ~~~~~~~~~~~~~~~~~~~~~~~~~
  45. To prevent Godot from importing files contained in a specific folder, create
  46. an empty file called ``.gdignore`` in the folder (the leading ``.`` is required).
  47. This can be useful to speed up the initial project importing.
  48. .. note::
  49. To create a file whose name starts with a dot on Windows, you can use a
  50. text editor such as Notepad++ or use the following command in a
  51. command prompt: ``type nul > .gdignore``
  52. Once the folder is ignored, resources in that folder can't be loaded anymore
  53. using the ``load()`` and ``preload()`` methods.
  54. Ignoring a folder will also automatically hide it from the FileSystem dock,
  55. which can be useful to reduce clutter.