6. Where things live
3 minKnow what every file in a Godot project is before you open it.
- res://
- res://scenes/
- res://scripts/
- res://art/
- res://data/
- user://
res://project.godot The project file. Input Map actions, autoloads, the main scene, window size and physics settings all live here, as plain INI-style text.
- Coming from
- Unity: the ProjectSettings folder. Unreal: DefaultEngine.ini and DefaultInput.ini.
- Editing it
- Edit through Project Settings in the editor; it is safe to read in git diffs.
A Godot project is a folder of plain text files. Scenes, scripts, resources and import settings are all readable and diff cleanly in git. Open each file in the tree to see what it is, what it maps to in the engine you know, and which ones you should never edit by hand.
Coming from res:// is your project folder and is read-only once exported. user:// is the per-user writable folder where saves go.
To finish: Open all six files.
Notes
The written version of this lesson, for after you have done it.A Godot project is a folder of plain text files, which is why it diffs cleanly in git and why you can read any of them without the editor. res:// is that folder, and it is read-only once the game is exported. user:// is the per-user writable location the operating system gives your game, which is where saves and settings go.
Scenes (.tscn) and resources (.tres) are text too, so a change to one property shows up as a one-line diff. Godot writes an .import file beside every texture and sound with the import settings; commit both, and change the settings in the Import dock rather than in the file.
Autoloads registered in project.godot become global nodes in the tree, and the main scene named there is what runs when you press Play. Almost everything that feels like engine configuration is a line in that one file.
Try it in the editor five minutes, in a real project
- Open your project folder in a file manager next to the editor. Find project.godot and open it in a text editor; find the input actions you added.
- Open player.tscn as text. Find the line that references player.gd, and the lines that record the CollisionShape2D's shape.
- Drop any PNG into the project folder. Switch back to Godot, wait for the import, and find the .import file that appeared beside it.
- In a script, write FileAccess.open("user://test.txt", FileAccess.WRITE) and store a line. Then open Project, Open User Data Folder from the menu to see where it went.
res://project.godotProject settings- The project file. Input Map actions, autoloads, the main scene, window size and physics settings all live here, as plain INI-style text. Edit through Project Settings in the editor; it is safe to read in git diffs. Unity: the ProjectSettings folder. Unreal: DefaultEngine.ini and DefaultInput.ini.
res://scenes/player.tscnScene- A scene: the node tree from lesson 1, saved as text. Every node, its type, its properties and its signal connections are in this file. Edit in the editor. Reading it is useful; hand-editing it rarely is. Unity: a prefab. Unreal: a Blueprint class.
res://scripts/player.gdGDScript- The script from lesson 2. A scene references it by path and attaches it to one node. Edit in any editor. The built-in script editor is fine; VS Code with the Godot Tools extension is common. Unity: a MonoBehaviour .cs file. Unreal: a C++ class or a Blueprint's graph.
res://art/coin.pngAsset- A texture. The moment it lands in the project folder, Godot imports it and writes coin.png.import beside it with the import settings. Commit both files. Change import settings in the Import dock, never in the .import file. Unity: the asset plus its .meta file.
res://data/sword.tresResource- A saved Resource instance: data with no node tree. Stats, item definitions, curves and materials are all Resources. Create from a script that extends Resource with @export fields; edit values in the Inspector. Unity: a ScriptableObject asset. Unreal: a Data Asset.
user://save.jsonSave file- user:// is the per-user writable folder the OS gives your game. res:// is read-only once exported, so anything written at runtime goes here. Written by your save code with FileAccess. Never ships in the project. Unity: Application.persistentDataPath.