Read/Write to disk

Discussion and feedback on Construct 2

Post » Mon Aug 27, 2012 1:26 pm

Are there any plans to allow arrays, hastables, audio etc. to read from & write to disk? I figured this would've been added in r100 with the .exe exporter but I guess not. The age of custom level editors / much better external file management in general is nigh!
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Mon Aug 27, 2012 5:28 pm

I would also really love to see this added.
Preferably with choices on format and encryption!
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Mon Aug 27, 2012 10:32 pm

Bump for justice.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Mon Aug 27, 2012 11:29 pm

Anything that can save to JSON can be saved to WebStorage, so that includes Dictionary and Array. Due to a bug WebStorage doesn't work in Awesomium in r100, but it should be fixed in the next build where it saves persistently to disk. Do you really need full file I/O access? Shouldn't that be enough for simple cases? Full disk access would be complicated to add, and only relevant to the Awesomium exporter. I hesitate to add features which are not portable to all platforms.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Aug 28, 2012 3:38 am

Hmm, but Webstorage stores in your cache or just for that session.
For a RPG game or a more serious, longer game, we would want a permanent file save. I wouldn't want my players not to clear their cache because their EXE game's data would be lost..
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Tue Aug 28, 2012 1:26 pm

[QUOTE=Rory] Hmm, but Webstorage stores in your cache or just for that session.[/QUOTE]
No it doesn't, that's only due to a bug in r100. In the next build WebStorage saves persistently on your hard disk drive, and isn't erased if you clear your cache (because it is separate to any browser installation).
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Aug 28, 2012 1:31 pm

So when you say "Shouldn't that be enough for simple cases?", what do you mean? What can the fixed Webstorage not handle?
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Tue Aug 28, 2012 4:07 pm

I think it would be nice to at least being able to save the webstorage files to a specified location, so the user can backup his save files.

As a more advanced feature (but equally welcome), the ability to read and generate image files and save them to disk would be useful for screenshots or custom game avatars.
Scirra Employee
B
129
S
45
G
15
Posts: 705
Reputation: 15,413

Post » Tue Aug 28, 2012 8:13 pm

I made a pretty advanced webstorage system with multiple slots and modes. It's actually amazing what you can save in a string with webstorage and also suited for RPG's and inventories. You just have to use some creativity and be very systematical about how you approach it.
B
7
S
3
Posts: 109
Reputation: 1,645

Post » Tue Aug 28, 2012 8:36 pm

I would really, really like not only full file I/O, but also the ability to preview as an EXE instead of through a web browser like with construct classic - one click and an exe appears running on the screen. Reasons for this in order of importance, least to highest:

File size - Not as much of an issue these days, but it seems a waste especially with needing 3 copies of each sound file in each backup of a game. However, it leads into...

Saving times - true, saving as a project is faster, but even with a small game it can start to take a bit of a disconcertingly long time when imagining how much longer it would take to save a big game.

Previewing times - while I haven't tested it yet, I'm concerned that at some point when working on a larger game it's going to start impacting preview times as well, as happened with construct classic. I realize C2 is written far, far more efficiently, but regardless that can be a lot of data to move around all at once and if some of it could be loaded at runtime when it's needed via actions instead it would make it much smoother.

Updating files - if we want to update a piece of music, we have to go through the process of importing and replacing it each time. If we could have it load from disk, all we need to do is overwrite the file.

Some people want to make EXE-only games - it would be very, very nice to preview directly via the output method they're going to use - no having to wonder if the game is going to work differently via the EXE exporter (bugs in awesomium or such, etc). A lot of bugs are found when testing other stuff in the preview - having to do a whole extra round of testing specifically for the export would be extremely inconvienent, especially for large games like an RPG!

Webstorage issues - as browsers have limits of 2.5 or 5 MB for webstorage, that means if you want to use more than that you have to start resorting to swapping stuff in and out of webstorage to disk using clumsy save/load file from disk dialogs every time you want to swap between them, you have to keep track of which is which, and hope that is the dizzying process of making a game you don't accidentally save as the wrong file name and overwrite the wrong file or some such.

Or then, what about on the user's side, if your save files simply need more than 2.5/5 MB, like if you include a level editor that the user can use? What then? Even with using EXE, there are simply no options other than asking the user where to save the file, then to load it later, both via a windows dialog box. Users aren't going to like that, it's not a smooth experience at all.

What's worse, is when previewing via a browser, that's 2.5/5 MB shared for ALL games made with construct 2! Want to make multiple games that use a lot of data at once? Gotta swap webstorages every time.

The full file I/O would really need preview as EXE to work well, though. Otherwise, you'd have to export to EXE each time to preview, which would be infuriating!

If we had both preview as EXE and full file I/O, that would solve these problems completely and be a great working experience. Please, please add both to C2!Arima2012-08-28 20:50:11
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests