Posted March 07, 2024 by Aqua Dragon
Unless I somehow messed it up, the saving and loading should now be significantly more persistent on mobile (finally).
Saving and loading on mobile was still very touch-and-go and often prone to the whims of the local storage. I spent hours and hours trying to get to save the game data to IndexedDB (very persistent storage) instead of to Local Storage (which is cleared regularly). I probably spent 15+ hours researching, coding, ChatGPT'ing, and studying.
While scouring the documentation for clues, I found this line: "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. By default, the folder name will be inferred from the project name"
That's convenient, I thought. But that's only for executables since it's a file path, so it shouldn't apply to HTML5 since it's on a webs-
"On HTML5 exports, user://
will refer to a virtual filesystem stored on the device via IndexedDB."
"to a virtual filesystem stored on the device via IndexedDB."
"stored on the device via IndexedDB."
INDEXED
DB
...anyway a quick set of changes later and problem solved. Yay...