Godot 4 save system tutorial: save and load your game with JSON in GDScript — save file location, serializing player data and autosave.
▶ Full written tutorial (free): https://generalistprogrammer.com/game...
Godot save system tutorial — build a proper save and load system in Godot 4 with JSON, from
scratch. If your players lose progress the moment they close the game, this is the fix. We build
a Godot save system that writes real JSON to disk and survives a full restart. Every line is
correct, copy-paste-ready Godot 4 GDScript — no Godot 3 File class here (it was removed).
Why is Godot save and load trickier than it looks? Two reasons. Old tutorials use the File class,
which is gone in Godot 4. And beginners write to the project folder (res), which is read-only once
you export the game — so every save silently fails. Get the Godot 4 API and a writable path right,
and the rest is easy.
What we build, step by step:
Why saving is tricky — the removed File class and the res-is-read-only trap.
The save Dictionary — one plain object holding level, coins, position and inventory.
FileAccess write + JSON — open the file, JSON.stringify the Dictionary, store the string.
Loading it back — file_exists and null guards, JSON.parse_string, then apply the data.
Where saves live — user:// maps to the real per-platform user data dir; never res.
Gotchas — splitting a Vector2 into x and y, ConfigFile for settings, and saving on quit.
The key correctness point: saves belong in user://, which Godot resolves to a writable folder on
every platform (see OS.get_user_data_dir). res:// is for reading your built-in assets only. Copy
the two functions into any project and your Godot save system is done — players keep their progress.
More Godot builds and the full tutorial library:
https://generalistprogrammer.com/tuto...
Related Godot tutorials:
Godot state machine — https://generalistprogrammer.com/tuto...
Godot instancing / spawn — https://generalistprogrammer.com/tuto...
This save code + 50 more copy-paste snippets — Game Dev Starter Kit ($19):
https://generalistprogrammer.gumroad....
— Chapters —
0:00 Progress lost — the fix
0:15 Game Dev Starter Kit ($19)
0:37 Why saving is tricky
1:54 The save Dictionary
3:22 FileAccess write + JSON
5:05 Loading it back
6:50 user:// — where saves live
8:11 Gotchas: Vector2, null checks
9:29 Recap + watch next
#gamedev #godotengine #godot