thedivergentai/godot-save-load-systems
Expert blueprint for save/load systems using JSON/binary serialization, PERSIST group pattern, versioning, and migration. Covers player progress, settings, game state persistence, and error recovery. Use when implementing save systems OR data persistence. Keywords save, load, JSON, FileAccess, user://, serialization, version migration, PERSIST group.
npx skills add https://github.com/thedivergentai/GD-Agentic-Skills --skill godot-save-load-systems
JSON serialization, version migration, and PERSIST group patterns define robust data persistence.
"version": "1.0.0" field and implement migration logic.C:/Users/... will break on every other machine. Always use the user:// protocol, which Godot maps to the correct OS-specific app data folder.Dictionary or Resource instead.close() is safer for long-running logic.store_var() or separate dedicated asset files.data.get("field", default_value) and validate that numbers are within expected ranges to prevent crashes.erase() or add() inside a loop over the same dictionary causes iteration errors. Use data.duplicate() to iterate safely.FileAccess.open_encrypted_with_pass() to secure it.ResourceLoader.load_threaded_request() to load levels in the background.String UUIDs for game objects.true allows full object decoding, which is a major security risk for saves downloaded from the web.Vector3 to a string or dictionary. For strict data types, use var_to_bytes() or a binary format.> MANDATORY: Read the script for the chosen format before writing SaveManager code.
MANDATORY for JSON / binary / PERSIST collect — patterns default store_var(..., false).
MANDATORY when any save has a version field that can lag the build.
MANDATORY before encrypted slots — password from secure storage / user secret, never hardcoded in examples.
Rolling .bak + SHA-256 verify before trusting a slot; fall back to backup on mismatch.
MANDATORY for JSON/PERSIST walkthroughs, binary examples, gotchas, and elite encrypted paths — references/save-patterns-deep.md. Do not paste Step 1–3 Autoload tutorials into scenes.
> CAUTION: Baseline tutorials used store_var(data, true). Untrusted user:// saves must allow_objects=false — RCE risk on modded/workshop files.
{x,y,z} components; JSON does not round-trip Vector3 faithfully..bak before overwrite (save_integrity_validator.gd).| Need | Format | MANDATORY |
|------|--------|-----------|
| Human-readable, small/medium progress | JSON + version | save_load_patterns.gd |
| Type-faithful Variants / larger blobs | Binary store_var with allow_objects=false | same |
| Typed Resource trees / inspector schemas | ResourceSaver / .tres/.res | Peer godot-resource-data-patterns |
| Many scene nodes auto-collect | PERSIST group + save()/load() | save_load_patterns.gd |
| Schema evolved | Migrate then load | save_migration_manager.gd |
| Anti-tamper / sensitive fields | Encrypted FileAccess | save_system_encryption.gd |
Do not paste Step 1–3 JSON Autoload tutorials here — implement from the scripts.
allow_objects Trust BoundaryDefault always store_var(data, false) / get_var(false).
| Case | allow_objects | Rule |
|------|-----------------|------|
| Player user:// saves, workshop mods, downloads | false | NEVER true — RCE risk |
| Trusted local only (your own tooling, offline debug fixtures you control) | true only if unavoidable | Document why; never ship as default; prefer Resources / Dictionaries of primitives |
Encrypted elite paths still use false unless the payload is explicitly trusted-local and non-user-editable.
DirAccess.copy_absolute to .bak) before overwrite.FileAccess.get_sha256 compare; fall back to backup on mismatch.user:// — never absolute OS paths.Settings may use ConfigFile separately from run-progress JSON/binary.
> Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.
user:// vs res:// mapping across OS app-data folders; never hardcode absolute paths.store_var/get_var Variant encoding, type fidelity, and why allow_objects is unsafe for untrusted saves.ResourceLoader.load_threaded_request for hitch-free level/resource loads after a save restore.duplicate(true), and when .tres/.res beats hand-rolled JSON.stringify/parse/parse_string for human-readable saves and validation of parse errors.user://settings.cfg) separate from full game-state saves.user:// project identity must exist before a SaveManager can own paths..tres workflows that pair with ResourceSaver instead of flattening everything to JSON.game_saved / game_loaded event buses so UI and systems react without hard-wiring SaveManager.user:// saves for competitive modes.Take thedivergentai/godot-save-load-systems from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.