Best place to save game saves?

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://?

I’d suggest giving this a read: Saving games — Godot Engine (stable) documentation in English. It’s pretty xomplete and includes examples :raising_hands:

2 Likes

Always in user://

3 Likes

It is better to give the player a choice.

1 Like

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 of res:// 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.

5 Likes

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.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.