Godot: project structure¶
Folders and file names, file formats, version control, addons, export presets and per-platform settings. Version control for large binary assets in any engine is in Game development, and keeping secrets out of repositories is in Security.
Entries are sorted by score from 1 to 10 (criteria): 9โ10 start here or strongly recommended, 6โ8 recommended, 1โ5 further reading or conditional.
Adopted references¶
- 7 Project organization and Version control systems (Godot docs): folder layout, file naming, and which files to commit or ignore.
- 7 Exporting projects (Godot docs): export presets and templates, which files an export includes, where the export configuration and credentials are kept, and exporting from the command line.
Key rules¶
Version control¶
- 9
GODOT-1Commit the.importfiles next to your assets and the.uidfiles next to your scripts and shaders, and ignore the.godot/folder. Generate the.gitignoreand.gitattributesfrom the project manager or Project > Version Control. This is how Godot projects applyGAMEDEV-22. (Godot, Version control systems, Import process, UID changes coming to Godot 4.4) - 7
GODOT-31Save scenes and resources in the text formats,.tscnand.tres, rather than the binary.scnand.res, so that they stay readable and easy to manage in version control. Exports still convert them to binary, because theeditor/export/convert_text_resources_to_binaryproject setting is on by default. (Godot, TSCN file format, ProjectSettings, convert_text_resources_to_binary) - 6
GODOT-32If you store large assets in Git LFS (GAMEDEV-15), set it up before the first commit, starting from the example.gitattributesin Godot's version control documentation, which also tracks Godot's binary formats such as.scn,.res,.meshand.lmbake. Files committed before LFS was set up stay in normal Git history until you re-add or migrate them. (Godot, Version control systems: Git LFS)
Folders, files and addons¶
- 6
GODOT-2Use snake_case for file and folder names (C# scripts excepted), and keep third-party code inaddons/. Exported projects use a case-sensitive file system, so a case mismatch can break the game only after export. (Godot, Project organization) - 6
GODOT-33Keep scripts and assets close to the scenes that use them, and move, rename or delete files only in Godot's FileSystem dock, so that references to them don't break. If you move a script or shader outside Godot, move its.uidfile with it and re-save the scenes that use it. (Godot, Project organization, File system: drawbacks, UID changes coming to Godot 4.4) - 5
GODOT-34Install third-party addons from the Asset Library or a tagged stable release, not from a repository's latest commit, and keep each one in its ownaddons/<name>/folder. An editor plugin'splugin.cfgrecords its version. Package your own systems that several projects share the same way. (Godot, Installing plugins, Making plugins)
Export and platform settings¶
- 7
GODOT-35Commitexport_presets.cfg, keep signing keys, passwords and encryption keys out of the repository, and automate release builds with--export-release. Godot keeps those secrets in.godot/export_credentials.cfg, which is ignored with the rest of.godot/, and CI can pass them in environment variables such asGODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD. This appliesSEC-2. (Godot, Exporting projects: configuration files, exporting from the command line, Exporting for Android: environment variables) - 5
GODOT-36Put platform- and build-specific project settings in feature-tag overrides, such as.mobile,.web,.debugor a custom tag set in an export preset, and read those settings withProjectSettings.get_setting_with_override().get_setting()ignores the overrides, and custom feature tags apply only to exported builds, not when you run the project from the editor. (Godot, Feature tags)