[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KRE1STC599VB48J244E2GC":3,"skill-same:01M6KRE1STC599VB48J244E2GC":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":42,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M6KRE1STC599VB48J244E2GC","save-load",null,"Use when building or replacing a save\u002Fload system — ConfigFile, JSON, Resource serialization, and save game architecture","jame581\u002FGodotPrompter","jame581","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F21112138?v=4","01M6KR3KEQ9Z30WVJRR2E2ZVXE","Jan Mesarč","01M6KR3KJVRMPDSMASQPBCBVK3",964,"MIT","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fsave-load\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30],"load","save load","save","implementing","use","architecture","game","json","systems","serialization","save game","when","2026-11-10 10:12:30",false,"---\nname: save-load\ndescription: Use when building or replacing a save\u002Fload system — ConfigFile, JSON, Resource serialization, and save game architecture\n---\n\n# Save \u002F Load Systems in Godot 4.3+\n\nChoose the right serialization strategy for your data type. All examples target Godot 4.3+ with no deprecated APIs.\n\n> **Related skills:** **resource-pattern** for custom Resource data containers, **inventory-system** for inventory serialization patterns, **godot-project-setup** for SaveManager autoload setup, **popochiu** for adventure-framework saves.\n\n---\n\n## 1. Strategy Comparison\n\n| Strategy          | Best For                        | Readable | Editor Support | Notes                              |\n|-------------------|---------------------------------|----------|----------------|------------------------------------|\n| ConfigFile        | Settings, simple key-value data | Yes      | No             | Built-in INI-style, no extra deps  |\n| JSON              | Game saves, flexible structures | Yes      | No             | Cross-platform, version-migratable |\n| Resource .tres    | Editor-integrated data          | Yes      | Yes            | **NOT secure — never load untrusted files** |\n| Resource .res     | Fast binary data                | No       | Yes            | **NOT secure — never load untrusted files** |\n\nWhen you recommend a strategy, name the one you rejected and the factor that decided it — \"JSON, not Resource files, because saves are user-writable and loading a Resource can run code\". A format picked without a named alternative cannot be overruled.\n\n> **Security warning:** Loading `.tres` or `.res` files executes arbitrary GDScript embedded in the resource. Never load Resource files from untrusted sources (user-uploaded files, downloaded mods). Use ConfigFile or JSON for user-generated save data.\n\n---\n\n## 2. ConfigFile — Settings\n\n`ConfigFile` writes INI-style sections — ideal for audio \u002F video \u002F controls settings (small, designer-debuggable). Use `set_value(section, key, value)` then `save(path)`; load with `load(path)` and `get_value(section, key, default)`.\n\n> See [references\u002Fconfigfile.md](references\u002Fconfigfile.md) for the full GDScript + C# settings save\u002Fload + typical settings-menu wiring.\n\n---\n\n## 3. JSON — Game Saves\n\n`JSON.stringify(dict)` to serialize, `JSON.parse_string(text)` to deserialize. Read\u002Fwrite through `FileAccess`. Best for game saves where you want human-readable files. Build a Dictionary that captures all gameplay state (player position, inventory, world flags), serialize, write to `user:\u002F\u002Fsave_\u003Cslot>.json`.\n\n> See [references\u002Fjson-saves.md](references\u002Fjson-saves.md) for the full GDScript + C# save\u002Fload implementation, including FileAccess wrapping and error handling.\n\n> ⚠️ **Changed in Godot 4.7:** `JSON.stringify(data, indent = \"\", sort_keys = true, full_precision = false)` now serializes an empty `Dictionary` compactly as `{}` even when an `indent` is passed ([GH-115883](https:\u002F\u002Fgithub.com\u002Fgodotengine\u002Fgodot\u002Fpull\u002F115883)). Save files written with an indent change formatting for empty-dict fields after upgrading — anything that diffs or hashes save output byte-for-byte must tolerate the new form. Parsing is unaffected.\n\n---\n\n## 4. Save Architecture Pattern\n\nFor larger games, attach a `SaveableComponent` to each persistent node. Each component holds a stable `save_id` and two callables, `serialize` and `deserialize`, and joins the `saveable` group. The save manager walks that group, calls each `serialize`, and builds a master Dictionary keyed by `save_id`.\n\n> See [references\u002Fsave-architecture.md](references\u002Fsave-architecture.md) for the full `SaveableComponent` + save-manager implementation.\n\n---\n\n## 5. Save File Locations\n\n`user:\u002F\u002F` resolves to a platform-specific writable directory outside the project folder.\n\n| Platform | Path                                                                          |\n|----------|-------------------------------------------------------------------------------|\n| Windows  | `%APPDATA%\\Godot\\app_userdata\\\u003Cproject-name>\\`                                |\n| macOS    | `~\u002FLibrary\u002FApplication Support\u002FGodot\u002Fapp_userdata\u002F\u003Cproject-name>\u002F`           |\n| Linux    | `~\u002F.local\u002Fshare\u002Fgodot\u002Fapp_userdata\u002F\u003Cproject-name>\u002F`                          |\n\n> Always use `user:\u002F\u002F` for save data, never `res:\u002F\u002F`. The `res:\u002F\u002F` path is read-only in exported builds.\n\n---\n\n## 6. Version Migration\n\nSave files outlive the schema that wrote them. Always include `\"version\": \u003Cint>` at the top of the saved Dictionary; on load, switch on the version and migrate older saves forward incrementally (`v1 → v2 → v3 → current`). Never break old saves — always migrate.\n\n> See [references\u002Fversion-migration.md](references\u002Fversion-migration.md) for the full migration helper pattern.\n\n---\n\n## 7. Implementation Checklist\n\n- [ ] Use ConfigFile for settings, JSON for game saves (not Resources)\n- [ ] Every save file includes a `version` integer field\n- [ ] Save path uses `user:\u002F\u002F`, never `res:\u002F\u002F`\n- [ ] Call `DirAccess.make_dir_recursive_absolute()` before writing saves\n- [ ] Vector2\u002FVector3 serialized as separate `x`\u002F`y`\u002F`z` floats (JSON has no Vector type)\n- [ ] All file operations check return codes and call `push_error()` on failure\n- [ ] `_migrate()` handles every version from 0 to current, applied incrementally\n- [ ] Resource files (.tres\u002F.res) are never used for player-controlled save data\n- [ ] `get_save_slots()` and `delete_save()` helpers exist for UI slot management\n- [ ] Saveable nodes use stable IDs that do not change between sessions\n","# Save \u002F Load Systems in Godot 4.3+\n\nChoose the right serialization strategy for your data type. All examples target Godot 4.3+ with no deprecated APIs.\n\n> **Related skills:** **resource-pattern** for custom Resource data containers, **inventory-system** for inventory serialization patterns, **godot-project-setup** for SaveManager autoload setup, **popochiu** for adventure-framework saves.\n\n---\n\n## 1. Strategy Comparison\n\n| Strategy          | Best For                        | Readable | Editor Support | Notes                              |\n|-------------------|---------------------------------|----------|----------------|------------------------------------|\n| ConfigFile        | Settings, simple key-value data | Yes      | No             | Built-in INI-style, no extra deps  |\n| JSON              | Game saves, flexible structures | Yes      | No             | Cross-platform, version-migratable |\n| Resource .tres    | Editor-integrated data          | Yes      | Yes            | **NOT secure — never load untrusted files** |\n| Resource .res     | Fast binary data                | No       | Yes            | **NOT secure — never load untrusted files** |\n\nWhen you recommend a strategy, name the one you rejected and the factor that decided it — \"JSON, not Resource files, because saves are user-writable and loading a Resource can run code\". A format picked without a named alternative cannot be overruled.\n\n> **Security warning:** Loading `.tres` or `.res` files executes arbitrary GDScript embedded in the resource. Never load Resource files from untrusted sources (user-uploaded files, downloaded mods). Use ConfigFile or JSON for user-generated save data.\n\n---\n\n## 2. ConfigFile — Settings\n\n`ConfigFile` writes INI-style sections — ideal for audio \u002F video \u002F controls settings (small, designer-debuggable). Use `set_value(section, key, value)` then `save(path)`; load with `load(path)` and `get_value(section, key, default)`.\n\n> See [references\u002Fconfigfile.md](references\u002Fconfigfile.md) for the full GDScript + C# settings save\u002Fload + typical settings-menu wiring.\n\n---\n\n## 3. JSON — Game Saves\n\n`JSON.stringify(dict)` to serialize, `JSON.parse_string(text)` to deserialize. Read\u002Fwrite through `FileAccess`. Best for game saves where you want human-readable files. Build a Dictionary that captures all gameplay state (player position, inventory, world flags), serialize, write to `user:\u002F\u002Fsave_\u003Cslot>.json`.\n\n> See [references\u002Fjson-saves.md](references\u002Fjson-saves.md) for the full GDScript + C# save\u002Fload implementation, including FileAccess wrapping and error handling.\n\n> ⚠️ **Changed in Godot 4.7:** `JSON.stringify(data, indent = \"\", sort_keys = true, full_precision = false)` now serializes an empty `Dictionary` compactly as `{}` even when an `indent` is passed ([GH-115883](https:\u002F\u002Fgithub.com\u002Fgodotengine\u002Fgodot\u002Fpull\u002F115883)). Save files written with an indent change formatting for empty-dict fields after upgrading — anything that diffs or hashes save output byte-for-byte must tolerate the new form. Parsing is unaffected.\n\n---\n\n## 4. Save Architecture Pattern\n\nFor larger games, attach a `SaveableComponent` to each persistent node. Each component holds a stable `save_id` and two callables, `serialize` and `deserialize`, and joins the `saveable` group. The save manager walks that group, calls each `serialize`, and builds a master Dictionary keyed by `save_id`.\n\n> See [references\u002Fsave-architecture.md](references\u002Fsave-architecture.md) for the full `SaveableComponent` + save-manager implementation.\n\n---\n\n## 5. Save File Locations\n\n`user:\u002F\u002F` resolves to a platform-specific writable directory outside the project folder.\n\n| Platform | Path                                                                          |\n|----------|-------------------------------------------------------------------------------|\n| Windows  | `%APPDATA%\\Godot\\app_userdata\\\u003Cproject-name>\\`                                |\n| macOS    | `~\u002FLibrary\u002FApplication Support\u002FGodot\u002Fapp_userdata\u002F\u003Cproject-name>\u002F`           |\n| Linux    | `~\u002F.local\u002Fshare\u002Fgodot\u002Fapp_userdata\u002F\u003Cproject-name>\u002F`                          |\n\n> Always use `user:\u002F\u002F` for save data, never `res:\u002F\u002F`. The `res:\u002F\u002F` path is read-only in exported builds.\n\n---\n\n## 6. Version Migration\n\nSave files outlive the schema that wrote them. Always include `\"version\": \u003Cint>` at the top of the saved Dictionary; on load, switch on the version and migrate older saves forward incrementally (`v1 → v2 → v3 → current`). Never break old saves — always migrate.\n\n> See [references\u002Fversion-migration.md](references\u002Fversion-migration.md) for the full migration helper pattern.\n\n---\n\n## 7. Implementation Checklist\n\n- [ ] Use ConfigFile for settings, JSON for game saves (not Resources)\n- [ ] Every save file includes a `version` integer field\n- [ ] Save path uses `user:\u002F\u002F`, never `res:\u002F\u002F`\n- [ ] Call `DirAccess.make_dir_recursive_absolute()` before writing saves\n- [ ] Vector2\u002FVector3 serialized as separate `x`\u002F`y`\u002F`z` floats (JSON has no Vector type)\n- [ ] All file operations check return codes and call `push_error()` on failure\n- [ ] `_migrate()` handles every version from 0 to current, applied incrementally\n- [ ] Resource files (.tres\u002F.res) are never used for player-controlled save data\n- [ ] `get_save_slots()` and `delete_save()` helpers exist for UI slot management\n- [ ] Saveable nodes use stable IDs that do not change between sessions\n",{"name":5,"description":7},"master","60c28fdc40706a24576731e9fb3508b9c95258ad","skills\u002Fsave-load",63,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter","https:\u002F\u002Fgithub.com\u002Fjame581","https:\u002F\u002Fjanmesarc.online\u002F","Software engineer. My biggest passion is game development.","2026-11-14 20:45:49",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add jame581\u002FGodotPrompter --skill save-load",{"tool":51,"command":52},"bunx","bunx skills add jame581\u002FGodotPrompter --skill save-load",{"tool":54,"command":55},"pnpm","pnpm dlx skills add jame581\u002FGodotPrompter --skill save-load","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fsave-load\u002FSKILL.md",true,[59,65,69,73],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fconfigfile.md","REFERENCE","参考文档",3554,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fsave-load\u002Freferences\u002Fconfigfile.md",{"path":66,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fjson-saves.md",12807,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fsave-load\u002Freferences\u002Fjson-saves.md",{"path":70,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fsave-architecture.md",4160,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fsave-load\u002Freferences\u002Fsave-architecture.md",{"path":74,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fversion-migration.md",2368,"https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fsave-load\u002Freferences\u002Fversion-migration.md",[78,98,118,146,170,187],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":31},"01M6KRFE5BR2PSD08ZKDAS66R7","xr-development","Use when building VR\u002FAR\u002FXR applications — OpenXR setup, XROrigin3D, hand tracking, controllers, passthrough, and Meta Quest deployment in Godot 4.3+","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fxr-development\u002FSKILL.md",[],[85,86,30,87,88,89,90,91,92,93,94,23,95,96,97],"xr development","development","deployment","godot","vr","setup","tracking","godot 4","ar","hand","Meta","applications","quest",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":31},"01M6KRF8GZTG1TAS506MFBSGFC","web-services","Use when a Godot game calls a web server — HTTPRequest, downloads, REST\u002FJSON APIs, auth headers, WebSocketPeer clients, TLS, retries, and keeping secrets out of the build. Not for game networking\u002FRPCs (multiplayer-basics) or browser export (web-export)","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-services\u002FSKILL.md",[],[105,106,107,108,109,110,111,112,23,30,88,113,114,115,26,116,117],"web services","web","services","tls","retries","calling","auth","downloads","clients","headers","secrets","build","REST",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":129,"publishedAt":31},"01M6KRF38Q4WSKAYFS56PG87T0","web-export","Use when shipping a Godot game to the browser — Web export preset options, threads vs no-threads and COOP\u002FCOEP headers, hosting on itch.io or your own server, PWA, JavaScriptBridge, user:\u002F\u002F persistence, audio and input limits, and load size","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fweb-export\u002FSKILL.md",[124],{"categoryNo":125,"categoryName":126,"taxonomyType":127,"taxonomyTypeDesc":128},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[106,130,131,132,133,134,135,136,114,137,138,30,139,140,141,25,142,19,23,143,144,145],"export","web export","threads","limits","shipping","size","options","hosting","input","Coop","preset","browser","io","pwa","Audio","server",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":160,"publishedAt":31},"01M6KREYFETEBH62ZTN6EZH2X3","using-godot-prompter","Bootstrap skill — establishes how to find and use GodotPrompter skills, with platform-specific tool mapping","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fusing-godot-prompter\u002FSKILL.md",[152,155],{"categoryNo":153,"categoryName":154,"taxonomyType":127,"taxonomyTypeDesc":128},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":156,"categoryName":157,"taxonomyType":158,"taxonomyTypeDesc":159},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[88,161,162,163,164,23,165,166,167,168,169],"using godot prompter","find","with","bootstrap","tool","platform","mapping","how","how to",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":176,"publishedAt":31},"01M6KRER5G7EQWKGAFN8QJKQ69","tween-animation","Use when implementing tweens — property animation, method tweening, chaining, parallel sequences, easing, and common UI\u002Fgameplay motion recipes","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Ftween-animation\u002FSKILL.md",[],[177,178,23,179,180,181,182,183,184,185,22,30,186],"tween animation","Animation","motion","parallel","gameplay","chaining","ui","recipes","common","sequences",{"skillNo":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":193,"publishedAt":31},"01M6KREKGCQMVDV8WX7HWX8BZG","state-machine","Use when building a state machine or refactoring logic into one — enum, node, and resource-based FSM patterns with trade-offs. Not for adding states to an existing one","https:\u002F\u002Fgithub.com\u002Fjame581\u002FGodotPrompter\u002Fblob\u002Fmaster\u002Fskills\u002Fstate-machine\u002FSKILL.md",[],[194,195,196,88,30,197,198,199,200,201,163,23,22,202],"state","state machine","machine","patterns","node","fsm","state machines","trade","trade-offs"]