Files, resources and saves
Choose a format, loader and storage location for game data.
Choose a task
| Task | Solution |
|---|---|
Find saves and understand asset:// / user:// | Paths |
| Read text, handle open failures and load an external PNG | Runtime files |
| Save one character position with a backup | Progress slot |
| Restore several objects and references by persistent ID | World snapshot |
Preserve typed Variant values, including Vector3 | Binary format |
| Load a prefab in the background, then attach it | Background loading |
Format and loader
| Data | Approach | Constraint |
|---|---|---|
| Small settings | ConfigFile | Sections and keys; SetValue() changes memory, Save() writes the file |
| Exchange with other programs | JSON with an explicit schema | Represent coordinates as numeric arrays; validate required fields and version |
| A local typed slot | FileAccess.StoreVar() / GetVar() | Not a general interchange format; does not restore live references |
| Imported project assets | ResourceLoader | Uses the import pipeline and resource cache; exported builds may omit the source PNG |
| An external player PNG or WAV | Image.Load() / AudioStreamWav.LoadFromFile() | Reads the source directly, without editor import |
| A level or prefab resource | PackedEntity + ResourceSaver | Saves the packed hierarchy and stored properties, not all game progress automatically |
Minimum save contract
Define a schema version, level identifier, persistent object IDs and a coordinate convention. Validate the whole snapshot before modifying gameplay state. On read failure, keep the current progress and report the error; do not overwrite the old slot with initial values.
Store progress in user:// and project resources in asset://. Space and permissions can fail in either location, so always check write results. The small examples use synchronous I/O; a large snapshot needs separate measurements of serialization and disk time.
Reckfell Engine documentationBack to top ↑