Webstorage or nodewebkit for file access?

Discussion and feedback on Construct 2

Post » Tue Nov 04, 2014 2:12 pm

Which is faster and recommended for loading and writing data consistently?
Webstorage? or Nodewebkit?
B
10
S
1
Posts: 33
Reputation: 625

Post » Tue Nov 04, 2014 4:11 pm

NodeWebKit is a platform and offer file access. However NodeWebKit plugin only works on the NodeWebkit platform. If you are using say Chrome, Crosswalk, Ejecta, HTML.... everything but NodeWebkit platform then the plugin won't store anything.

So the question isn't which is stable(which is the same). It's what do you need? If your going to run on anything else than the NodeWebKit platform then you have to use WebStorage. If your only using NodeWebkit then do you need more advanced storage. I suggest reading up more on the plugins themselves to determine your needs.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Tue Nov 04, 2014 7:42 pm

Im exporting via nodewebkit for desktop pc. Both options should work, but I think that there must be a methot that can manage memory in a convenient way to do loads and writes every second, to avoid lags of hard disk access.
B
10
S
1
Posts: 33
Reputation: 625

Post » Tue Nov 04, 2014 8:03 pm

Why do you have to keep writing every second? The most convenient way to manage memory should be saving at certain points, or when the user exits or something.
B
124
S
43
G
41
Posts: 849
Reputation: 28,235

Post » Sat Nov 08, 2014 4:07 pm

Its an ebook. It needs to save the page and title at closing the window, but the trigger to do that don't exist. So, what I'm trying to do is to save automaticly every 5 seconds, or one time for each page swapping.
B
10
S
1
Posts: 33
Reputation: 625

Post » Sat Nov 08, 2014 4:32 pm

I would suggest that you save this kind of info when arriving on the page if possible, as for webstorage vs node-webkit filesave, both would work, but the noide webkit will have a visible file, while the webstorage will be more transparent.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sat Nov 08, 2014 5:23 pm

If you can use WebStorage it's definitely preferable over node-webkit specific features, since if you ever want to port your project to a different platform it will just work, instead of the node-webkit specific bits breaking and needing rewriting.

You should not redundantly write to storage on a timer. Just write if the value changes! You don't need a specific trigger for that, you can either use "Trigger once" or compare to the old value and only update when it's different.
Scirra Founder
B
397
S
236
G
88
Posts: 24,417
Reputation: 194,538

Post » Sun Nov 09, 2014 12:20 pm

Thanks for the reply, that's exactly what I'm doing, but some times while the page is changing, and the program saves titles, root directory and page number, a little slowdown access appears and I think this will be more noticeable when the file is storing a colleccion of books and paths. That is a fisical problem for sure, and I hope one day you can add a "windows on close" or "on exit" trigger to construct2, it will saves a lot.
B
10
S
1
Posts: 33
Reputation: 625

Post » Sun Nov 09, 2014 6:29 pm

If each "page" or "book" is a layout. On layout changes/on start of layout...save.

Otherwise anytime the page changes, save. Don't need to change any other time unless you give the user a few bookmarks to save certain pages. But then the user would choose when to save those.
B
28
S
8
G
1
Posts: 226
Reputation: 2,865


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 13 guests