Game Save Suggestion

0 favourites
  • 9 posts
From the Asset Store
You must shoot down the enemy planes and eliminate them to earn points.
  • 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.

    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?

  • So nobody thinks this is a good idea?

  • 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.

  • "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'd

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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?

  • 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.

  • 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!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)