Save System in Construct 2

  • ZakkiOrichalcum: check the "how do I FAQ" there is an example of level editor that uses webstorage, and other examples in the section "Webstorage".

    It might help you out.

  • Oh, thanks Kyatric. Much obliged.

  • Hi, not to bump an old thread...

    But what if I am making a game to be downloaded? Basically, what I'm planning on doing, is using Construct 2 to make the game, and then maybe use a wrapper to make it executable. HTML5 with Construct 2, but downloaded and installed and run to play.

    The only thing I'm having problems with is coming up with a way to save data. I'm making a Hidden Object Game. So I'd like to be able to have player profiles, to which they can save their progress.

    I'd prefer to keep this all done offline, so that a user doesn't have to be connected to the internet to save. Is there SOMETHING that can be done?

    People have mentioned WebStorage, but I'm not sure if that's something that would work in the situation I'd be in? :)

  • Good question, I'm interested in this too.

    Is there some way to invoke "external" javascript from within Construct 2? So that if I embed a browser control in an executable and use some Interop API to create JS objects on the browser, I could e.g. call "javascript: save (level, exp, inventory)" from within Construct 2, and get a callback in my (C#, Java etc) code? - from there I can save to disk "the old way".

    Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Geo: There is the Call javascript custom plugin that allows to call external js.

    Nathanial: I think wrappers should handle webstorage as basicly it is an embedded browser.

    Check this topic. The last pages turns around the wrapping subject. You might get some useful informations there.

  • Thank you so much for the topic link. I'll stand by and see if Ashley does a wrapper herself, else I'll look into doing it too.

    Thanks again :)

  • Lady Ashley will be delighted and no problemo <img src="smileys/smiley2.gif" border="0" align="middle">

  • Pfffffff, Muahauhauhahaahuah :D:D:D:D <img src="smileys/smiley36.gif" border="0" align="middle" /> <img src="smileys/smiley36.gif" border="0" align="middle" />

  • I'm aiming to replicate Classic's save system at some point (it's just one action, and it automatically saves the entire game). It's on a very long todo list of features, though.

    It's been a while now. Have you already implemented the feature? If not; I'll learn more about the Webstorage feature. (can you actually easily use that to save data of a RPG free-roam game?) :)

  • I would also like to know if this was implemented, though it doesn't seem like it in r99.

    You might try this? scirra.com/tutorials/321/how-to-make-and-name-save-game-slots/page-1

  • I'd also like to know, now that we are looking at export with downloadable options, like cocoonjs and awesomium (not sure how to spell it), I wonder, would we ever be able to store game files/data on the device's hard drive?

  • Honestly, creating save games for RPGs and other large games isn't as difficult or complicated as it seems. At least not the actual data storage part.

    You can use a combination of this technique with WebStorage as explained and exampled by Haematite:

    Saving and Loading an Array to WebStorage

    And to copy the positions of sprites in the layout, you can use Rex Rainbow's amazing SpriteBank plugin.

    Obviously, it's up to you to create a suitable UI for the save system, but that would be the case even if Ashley had developed the "Save/Load Layout" feature. Except in this case you're able to save only the variables you need to.

  • RPG GAME DEVELOPMENT

    We need a fast QuickSave QuickLoad solution for Construct 2, bound to hotkeys, like F5-Quick Save, F9 Quick Load.

    We want to be able to save to disk, because network access is not guaranteed. If a mobile phone user plays the game, there could be "Network not available" message popping up, while trying to save the game with webstorage.

    If the player - a costumer who PAID for the game - is traveling in a car and going into a valley with temporarily NO reception or to a remote place with NO reception at all and LOVES the game and PLANS to have fun with it and is at/after/before a very important FIGHT in the RPG game a " server cannot be reached" message from the mobile - after hours of gameplay - won't be exactly a happy moment , especially when again HOURS of important RPG gaming - having collected rare magic items, gained XP, beaten a super-hard dungeon all this is going to be lost. Because lack of good old save game to file option.

    SAVE TO DISK - SAVE TO FILE feature please. Even with some external plugin or externally called solution.

    Clearly Javascript is one of the worst solutions for saving games to actual files, that aren't going to be DELETED - e.g. are safe - if a user decides to clear the browser cache..

    We need to be able to:

    1. Save games

    2. Build games of arbitrary size independent of 10MB or such ridiculous restrictions: this is the problem of mobile platforms, very idiotic!

    3. Disconnect from the web, because server access is NOT guaranteed at all. The Server Webstorage provider can be unavailable at the worst customer moments making game support a nightmare.

    So.. planning game development without reliable save to disk feature is futile. No browser-caches of different browsers please.

  • Saving the entire game progress

    We have enhanced our CSS3 memory matching game by adding a game over screen and storing the game record. Imagine now that a player is in the mid game and accidentally closes the web browser. Once the player opens the game again, the game starts from the beginning and the game that the player was playing is lost. With the local storage, we can encode the entire game data into JSON and store them. In this way, players can resume their game later.

    Link to above article

    HTML5 storage

    Not too good news: " Since it is an ActiveX object, it will not be created if the security level on the client machine is high. So the website has to be added to the trusted site list so that the ActiveX object can be created."

    File Handling at Client Side Using Javascript

    Saving User Information to XML file using Javascript

    <img src="smileys/smiley5.gif" border="0" align="middle"> <img src="smileys/smiley29.gif" border="0" align="middle">

  • Complete save system idea for a good RPG:

    Quicksaves are accumulating: any time the player presses Quicksave, it is stored on disk on an external location like:

    C:\Documents\MyGames\Good_RPG\Savegame\quick_01.sav

    then at next Quicksave-hotkey press as quick_02.sav .. 20.

    The quick saved games are timestamped in the game maybe with a thumbnail of the current area where the player is and any one of them can be loaded back at any time.

    If a maximum of ~20 quicksaves are reached the oldest quicksave is getting overwritten: rotating save system.

    The player is also able to save game normally to a file

    C:\Documents\MyGames\Good_RPG\Savegame\game_01.sav ..02...game_20.sav , etc..

    The number of these savegames is unlimited.

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