Local storage/array losing data

Discussion and feedback on Construct 2

Post » Tue Mar 01, 2016 9:10 pm

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?
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Tue Mar 01, 2016 10:56 pm

@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: localstorage-does-not-work-on-safari-for-iphone-6-plus_p1019618?#p1019618

But I think this is iOS updates messing up WKWebView/Safari, there seem to be a major difference in iPhone & iPad Safari. :o
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Wed Mar 02, 2016 12:04 am

Silverforce wrote:@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.

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?

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.

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
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Wed Mar 02, 2016 12:25 am

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.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Wed Mar 02, 2016 10:06 am

Silverforce wrote: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.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041


Previous

Return to Construct 2 General

Who is online

Users browsing this forum: tumira and 4 guests