About local storage...

0 favourites
  • 8 posts
From the Asset Store
Basic Plugins for Firebase Authentication, Realtime-Database, Firestore, Cloud Storage
  • In my game I have a highscore and it's saved to local storage.

    When I remote preview my game it saves etc. and when I reset my web cache on my phone the highscore resets to 0.

    Will this happen with the final app? Will things saved to local storage be reset when the user empties their cache or is it saved differently as it's not being viewed in a web browser?

  • Local storage (and the save behavior) is indeed stored in the browsers app cache, so it will be possible to be wiped manually. This is normal and fairly common, such as on many phone games if you wipe the app cache, it will be reset as if you just installed it.

    You'll need a cloud service or some sort of web data storage to back up away from the users device if that is your intention.

  • OK - so (for example) the CandyCrush app on my phone saves my score to a server rather than some sort of data file on my phone?

    And am I right in thinking everyone who uses Construct to create games that have highscores save these scores on a server somewhere?

  • I'd say there are many cases that use both methods, rather than saying everyone saves on a server or local cache only.

    Generally speaking, local cache is pretty reliable. The user has to go out of their way to delete it, and if they know how to do that then they should understand the ramifications as well.

    Regarding cloud storage, there are different levels of solutions for that as well. You could build an entire database server with a firebase backend for your app, or you could use Google Play Services, which will store at least high scores for your app just fine.

  • Ok cheers. More to think about, just as I thought I was getting to the end of this game. Blegh.

    Out of interest, how would a mobile user actually delete their game cache? I’m guessing that even though we’re building these games in Html5 etc they’re not played within the browser but as an actual app, is this correct? So simply emptying their browser cache wouldn’t delete any data would it?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • For a phone app, it is separate from their browser app cache. They would need to go into settings, app setting, your app name, delete cache, and confirm.

    If they access your game through a web browser though, then deleting the cache for that browser will delete the data.

    Most well developed games (I believe) use both systems. For example, popular gatcha/lottery games like Puzzle and Dragons will store user data locally in the cache, and allow you to register an account to back up your data online. This is usually taken advantage by users who want to "reroll" their starting character, by not registering until they get their desired roll. They do this by clearing their cache to reset the game, and get another free roll from the tutorial or something like that.

  • For a phone app, it is separate from their browser app cache. They would need to go into settings, app setting, your app name, delete cache, and confirm.

    I was testing one of my game awhile back ()

    and it seems like the local storage data reset as I replace the app with a new version (it's not on app store, i'm just dragging it to my itune in this case).

    And what was even weirder is that if I port using Cocoon.io. The local storage data reset whenever I close the app and reopen again. It was fine with Intel XDK which went out of commission from what I understand. I'm not too sure what to use at the moment too since I was off the book for a little bit now.

  • Hello folks, just resurrecting an old thread of mine.

    I currently have an app that saves high score to local storage.

    If I upload the app as Version 1.0 and user downloads it and get a high score of 100, and then I make a couple of amends and reupload it as Version 1.5 and the user updates the app, will their high score be reset to 0 or will it remain at 100?

    I know it will be reset if they delete the app then redownload it, but what if the app is just updated? Will they lose their high score?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)