Godot Version
4.5.1
Question
Where is the best place to save game save data for a player (eg. position, health). Should it be saved somewhere in usr:// or in res://?
4.5.1
Where is the best place to save game save data for a player (eg. position, health). Should it be saved somewhere in usr:// or in res://?
I’d suggest giving this a read: Saving games — Godot Engine (stable) documentation in English. It’s pretty xomplete and includes examples ![]()
Always in user://
It is better to give the player a choice.
It’s not.
res:// is read-only when the project is exported, while user:// stays read-write. Always use user:// for persistent data that needs to be read and written in the exported project.
To store persistent data files, like the player’s save or settings, you want to use
user://instead ofres://as your path’s prefix. This is because when the game is running, the project’s file system will likely be read-only.
Writing to disk is still needed for tasks such as saving game state or downloading content packs. To this end, the engine ensures that there is a special path
user://that is always writable.
You can set a custom user data path in the project settings. user://can be wherever you want. But I would just keep it where it is already.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.