Webstorage local variables, limits, data safety

Get help using Construct 2

Post » Mon Dec 26, 2011 12:43 pm

I'm planning on doing save/load using Webstorage local data management. In the earlier topics at forum you mentioned this data is stored in web browser's cache - so when someone clears cache, it's pretty much gone.

1. I need a possibility to import/export save game data into separate file(s) (using external app). Is there a way to figure out webstorage's local data location for my external app?

2. What are the disc space limits for webstorage data stored on local machine? Are they browser-specific?

3. Can the data stored locally be considered safe?

4. I'm making an offline game with Construct 2 (not utilizing any of the HTML5 features). AFAIR there's Construct Classic but it doesn't seem to be supported anymore. What would you advise? Stick with Construct 2 and hope for new export platforms that'll allow easy save/data storage or maybe switch back to Construct Classic and hope that created games will work on all machines?
B
6
S
3
G
6
Posts: 219
Reputation: 3,013

Post » Mon Dec 26, 2011 1:03 pm

1. dunno
2. dunno, but I think browser's cache can have a configurable size limit... don't remember
3. it depends on what you mean by that.
4. Construct Classic isn't dead. Some contributors are still working on it (plugins, bug corrections,...). Also, construct classic makes exe files and only exe. These games will only work on windows OS.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Dec 26, 2011 2:45 pm

3. Safe... meaning, they won't be overwritten by other cache data (for example if there's 5MB cache buffer and game wasn't played for one year).
B
6
S
3
G
6
Posts: 219
Reputation: 3,013

Post » Mon Dec 26, 2011 5:04 pm

3. Then I think it's not safe. Temporary datas aren't meant to keep datas in a long run.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Dec 26, 2011 7:19 pm

[QUOTE=BROO]1. I need a possibility to import/export save game data into separate file(s) (using external app). Is there a way to figure out webstorage's local data location for my external app?[/quote]
I don't think WebStorage has any particular location on disk, but HTML5 is getting a File System API which should help. Hopefully a plugin will appear for that in future.

[quote]2. What are the disc space limits for webstorage data stored on local machine? Are they browser-specific? [/quote]
It's browser specific, and I think it was around 5 mb... WebStorage was intended as a replacement for cookies.

[quote]3. Can the data stored locally be considered safe?[/quote]
I'm not sure when it gets cleared - you might want to test if clearing the cache frees it, because the AppCache (offline support) isn't cleared by clearing your browser cache I don't think. Also, as far as security goes, all webstorages on the same domain share the same storage. So all HTML5 apps on Scirra.com use the same storage.

[quote]4. I'm making an offline game with Construct 2 (not utilizing any of the HTML5 features).[/QUOTE]
What do you mean by making a game in Construct 2 not using any HTML5? Games in Construct 2 use HTML5 specific features (like canvas) to run at all, you can't run a Construct 2 game without HTML5.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Mon Dec 26, 2011 7:40 pm

[quote=Ashley]
I don't think WebStorage has any particular location on disk, but HTML5 is getting a File System API which should help. Hopefully a plugin will appear for that in future.[/quote]
Thank you, it looks like it's exactly the thing I'm looking for...

http://www.html5rocks.com/en/tutorials/file/filesystem/
http://www.html5rocks.com/en/features/file
http://caniuse.com/#search=filereader

Quick search brought those results -> looks like it'll take some time before the main browsers will support writing to sandboxed file system. I'm not a specialist in HTML5 though.

[quote]What do you mean by making a game in Construct 2 not using any HTML5? Games in Construct 2 use HTML5 specific features (like canvas) to run at all, you can't run a Construct 2 game without HTML5.[/quote]
It was a little clumsy way of saying I won't be needing any benefits HTML5 provide: multi-platform support, accessing server data (facebook, AJAX) etc. so I'm perfectly fine with Construct Classic's Win32 app export if it's stable enough.
B
6
S
3
G
6
Posts: 219
Reputation: 3,013

Post » Tue Dec 27, 2011 1:38 am

The web storage HTML5 spec gives 5 mb as base storage.

The wikipedia page indicates that IE proposes up to 10 mo (it's funny, I remember having read another article somewhere that told that Chrome was providing up to 10 Mo whereas the other browsers only 5).
Anyway, for strict datas (like array of values), 5 Mo should take a while to fill, and the user should have a popping window to make more space available if the limit is reached.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795


Return to How do I....?

Who is online

Users browsing this forum: imothep85, LeFuji, makkancs, Marxally, Virpoja and 22 guests