Local storage/array losing data

  • [quote:636m4ysp]

    What makes you believe that ?

    It uses browser storage. In the absolute, web and local storage store infos at the same place in the browser (not the cache, the storage, a dedicated space for those infos thanks to HTML5 specs).

    It all uses the storage of the browser ,but it uses different kind to store the data. LocalStorage uses the IndexedDB, WebStorage uses local storage and session storage.

    [quote:636m4ysp]

    Moreover, it shouldn't solve the problem of storage files being cleared by the OS.

    I don't think using webstorage would help with the issue at hands.

    I found out that iOS 8 and 9 has bugs in IndexedDB and WebSQL. So my suggestion was to try WebStorage, because I didn't find a bug report about local storage on iOS 9. I only suggest that he could try, I didn't say that is would fix the problem.

    [quote:636m4ysp]

    If you could somehow create files on the system and read them, that could be something considered, but I doubt this will be an easy treat, especially on Apple device.

    Shaming them for their awful software and asking them to comply better with HTML5 specs could be the only solution around.

    But they don't seem to care a lot as per they slow release cycle which goes on breaking previous features.

    It is a shame, the bugs are quite old. But it looks Apple don't care about.

  • WebStorage is based on IndexedDB as well.

  • In Chrome I have only a entry in local storage and session storage with WebStorage 'Set local', 'Set session'. The indexedDB is empty.

  • Confirmed. "LocalStorage" uses IndexedDB. "WebStorage" uses LocalStorage - perfectly clear!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Asmodean, Kyatric

    I'm still making some tests, but so far the data wasn't deleted. I'm using both (local/web storage) as I said before and I didn't see any strange behaviour until now. I'll do some more tests during the day to make sure everything is ok. For while, I'm really grateful for the Asmodean's suggestion. If I don't come back here is because I hadn't any problem with this solution.

  • As the LocalStorage continues presenting problems, now with the variables, I decided to move them to the webstorage. After that, two questions appeared:

    • Can I continue to use local storage for the android version of my game with no problems, right? (I'm asking because I didn't test it yet)
    • Can I have any future problem with the web storage in the iOS version? Do I have to check regularly if the problem was fixed to migrate again to localstorage?
  • RBuster

    LocalStorage/WebStorage will be deleted on iOS when the user's disk space is low. I used WebStorage for my game on iOS8+ and users reported losing their saves and it was a year ago, I found out that iOS is allowed to delete what it considers temporary web files, with WebStorage falls under.

    This is why they want to move to IndexeDB (new LocalStorage), as it's more permanent. There was a bug in iOS8 that still deleted it, but its fixed in iOS9+ and IndexeDB should be more permanent.

    Maybe test CocoonIO if you have a small project, it's free for 2x 50MB projects.

    Intel XDK would not even compile for me, it has problems with installing WKWebView plugins. :/

    iOS Port of my PC game is ready to go, runs great on iPad Mini 2 Safari... but no wrapper works and thanks to the LocalStorage bug, won't work on iPhones. Yep, it's a waiting game.

    Anyway I posted the bug on the bug report:

    But I think this is iOS updates messing up WKWebView/Safari, there seem to be a major difference in iPhone & iPad Safari.

  • RBuster

    LocalStorage/WebStorage will be deleted on iOS when the user's disk space is low. I used WebStorage for my game on iOS8+ and users reported losing their saves and it was a year ago, I found out that iOS is allowed to delete what it considers temporary web files, with WebStorage falls under.

    So I presume that I'll have some problems with the web storage soon.

    [quote:2ral9ixc]This is why they want to move to IndexeDB (new LocalStorage), as it's more permanent. There was a bug in iOS8 that still deleted it, but its fixed in iOS9+ and IndexeDB should be more permanent.

    But do you know if there is an estimated time?

    [quote:2ral9ixc]Maybe test CocoonIO if you have a small project, it's free for 2x 50MB projects.

    Sorry, but I don't really agree with the Ludei premises.

    [quote:2ral9ixc]Intel XDK would not even compile for me, it has problems with installing WKWebView plugins. :/

    Did you try to remove the WKWebview plugin from the plugin management? I know it's not the best solution, but you can do it just for build the app. It solved for me. AFAIK, the XDX update will occur very soon

  • I cannot remove the WKWebView plugin, because performance without it is utter crap, as it defaults back to the old UIWebView that is x5 or even x10 slower.

    I tested it in preview on UIWebView, my game gets 10-20 fps, with 99.9% CPU usage (cpuutilization).

    In Safari itself (WKWebView), it's 50-60 fps, with 50-70% CPU usage.

    Basically you do not want to publish without WKWebView on iOS, because the high CPU usage for sub-par performance means your game will destroy the battery life of these devices and make them run really hot. This is a very important concern for mobile gamers. You want to be as efficient as possible, getting high FPS with the least CPU usage.

  • I cannot remove the WKWebView plugin, because performance without it is utter crap, as it defaults back to the old UIWebView that is x5 or even x10 slower.

    I tested it in preview on UIWebView, my game gets 10-20 fps, with 99.9% CPU usage (cpuutilization).

    In Safari itself (WKWebView), it's 50-60 fps, with 50-70% CPU usage.

    Basically you do not want to publish without WKWebView on iOS, because the high CPU usage for sub-par performance means your game will destroy the battery life of these devices and make them run really hot. This is a very important concern for mobile gamers. You want to be as efficient as possible, getting high FPS with the least CPU usage.

    You are absolutely right. As I said, it's not the best solution, but I removed the WKWebview to be able to test the game. I don't have a performance problem, but my game is consuming much more battery and heating up my iPhone more than others.

  • This problem concerns "System -> Save game to slot" ?

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