Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

HTML5 local storage is lost at every update.

A topic by Omiod created Sep 06, 2022 Views: 653 Replies: 6
Viewing posts 1 to 7

I've seen many three years old threads about this, and looks like it is not yet fixed.

The issue is that the games status is saved in Javascript local storage, but after an update the game is stored on a different address, and all the data is lost.

Local storage is extremely easy to use, while any other solution, like using external API is quite annoying.

The only solution I see is to host the game in my own website, but this could be an issue for many itch users, not to mention loosing the visibility on this site.

Please make your CDN to save the games on fixed address, thanks.

Have you considered using a central database that doesn't require you to set up a server? Things like Firebase database or AWS DynamoDB. There might be some JS only way to do it like so https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API

(1 edit)

Sadly IndexedDB has the same domain limits as local storage.

Things like Firebase could be a solution but because the stored data is different for each user, a user ID has to be handled, along with credentials, and so on. Sounds complex a lil too complex.

It is sad that the easiest solution is not available.

The solution described in the link works when using Unity.

https://ddmeow.net/en/game-dev/save-persistent-itch-io/

Maybe you could adapt it to work in your own project. Good luck!

I just uploaded an update to one of my webGL games, and all the local storage data is still there. No problems... Maybe it's not a problem with itch, but with the builds your engine creates?

In my case at every update the CDN address changes, and for this reason the stored data is lost.

Maybe they have fixed it ?

I just verified PaulsGames statement. The data in Local Storage can still be accessed after publishing an update.

See chapter The Browser Web Storage Option in my Devlog for all details including how I was doing the test:

https://humane-tiger.itch.io/9-dayz/devlog/675240/devlog-improve-my-game-jam-31