Game Save Suggestion

Discussion and feedback on Construct 2

Post » Mon Aug 26, 2013 12:47 pm

Hello all.

I've been reading up on how to save games in C2. It seems that game saves can be done for iOS and Android games but only if they're web apps. If I'm wrong, please let me know, but this tutorial by Ashley seems to indicate that.

http://goo.gl/crtEBT

I have a suggestion. If you like it, please voice your support. If not, please share with us why.

I think it would be awesome if a new object was added to C2, an object called "Save Array". This Save Array would be like a regular array with one very unique feature; information you change within it is permanently changed.

Having a unique array type instead of allowing regular arrays to be altered would mean there would be no accidental corruption of the game itself. The array would also need to be locked in size once you've dimensioned it, i.e. once the array has been given an actual size nothing in the game would be able to alter its size. It would most likely also need to have a limit on the amount of data that can be held in each array location.

Actions for the array could include...

Detect Save - Detects if there's a saved game, useful so that you can ensure that any "Load Game" menu options you provide are hidden until there's actually a saved game.
Write to Save Array - Self-explanitory.
Read from Save Array - Again, self-explanitory.
Clear Save Array - Reset the Save Array. Once cleared, the Detect Save would register no saved data.

Anyone else think this is good? Ashley, could it be done? If it could be done, would it be something you'd consider doing?
B
10
S
3
G
1
Posts: 30
Reputation: 1,279

Post » Tue Aug 27, 2013 7:13 pm

So nobody thinks this is a good idea?
B
10
S
3
G
1
Posts: 30
Reputation: 1,279

Post » Tue Aug 27, 2013 7:35 pm

You can use WebStorage to store variables and arrays in CocoonJS, I think.

You're mistaking C2's save STATE function as a real save. The "save state" that C2 has is exactly like an console emulator save state - it saves everything. In WebStorage you can save arrays, variables and all that, then you can load it manually.

Your save array idea is doable with the normal array, no problem.
B
122
S
42
G
40
Posts: 846
Reputation: 27,994

Post » Tue Aug 27, 2013 7:36 pm

"It seems that game saves can be done for iOS and Android games but only if they're web apps."

I don't think that's the case. Just use a dictionaries or arrays and save to webstorage.

edit: ninja'dMadFactory2013-08-27 19:36:44
Image
B
242
S
29
G
13
Posts: 1,787
Reputation: 18,685

Post » Tue Aug 27, 2013 8:02 pm

The C2 manual for WebStorage provides the following.

"WebStorage does not store in the browser cache. If the user opts to empty the browser cache, WebStorage data remains intact. However if the user opts to clear all their cookies or offline website data, WebStorage will be cleared."

I'm not the best when it comes to programming, but to me that indicates that the data is not actually stored within the game itself, but rather in the cookies and offline website data. I thought the cookies and offline website data could only be accessed by a browser-based game, not a game downloaded via an app store, like iTunes.

I was thinking that having a save function that actually changes the data within the application itself would result in a save function that would be protected from clearing cookies, etc, and allow app store games to have true save functionality.
B
10
S
3
G
1
Posts: 30
Reputation: 1,279

Post » Tue Aug 27, 2013 8:51 pm

CocoonJS translates the data to use Android/iOS cache, so it's the same as any other game.

Have you actually tried it out? Write a quick app and use CocoonJS and Webstorage, it should work.
B
122
S
42
G
40
Posts: 846
Reputation: 27,994

Post » Wed Aug 28, 2013 2:52 am

I have to admit I haven't tried it out as I didn't want to put anything in the iTunes app store until I know it works. Have you had success with it?
B
10
S
3
G
1
Posts: 30
Reputation: 1,279

Post » Wed Aug 28, 2013 9:57 am

I don't know why you won't just test it yourself, but Webstorage works perfectly well - exactly as you'd want it to - on mobile.
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Wed Aug 28, 2013 1:26 pm

The main reason I'm reluctant to try it before I'm completely sure it works is because I don't want to put it on the app store and then start getting low reviews because of a save functionality that doesn't work. Nothing screams "don't buy this game" like a swathe of low reviews!!
B
10
S
3
G
1
Posts: 30
Reputation: 1,279


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests