Need more control over what's saved/loaded

Discussion and feedback on Construct 2

Post » Thu Jul 25, 2013 5:34 pm

Hey all!

I've been implementing a checkpoint system using the save/load system. While the system is awesome, it's a bit problematic that it doesn't give a more fine-grained control over what's saved and what isn't.

For example, I'm trying to have my background music go uninterrupted between respawns. However, the save/load action returns the audio to the same position that it was in when saving, which is awkward sounding and strange.

The only way to get around this at the moment is to have an object with 'no save' behavior, and having instance variables on that object to keep track of playback time and then replaying the audio at the correct position upon respawn.

This is just one example - I'm sure many of you will agree that a finer control of what is saved and what isn't would be very helpful.

What do you think?
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,709

Post » Thu Jul 25, 2013 9:36 pm

You already have all the control you need using Dictionaries & Webstorage for your save data instead. The built-in save feature is only useful for the shift+F5 preview and is in no way a reliable form of save data because you can't retrieve nor modify any of it.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Thu Jul 25, 2013 10:12 pm

@Tokinsom Are you suggesting I manually save every object position and variable to a dictionary/webstorage every time I want to save the game? That's a whole lot of effort for no good reason.

Why do you say the built-in save feature is not reliable? I've used it and it seems to work fine, apart from the aforementioned issue.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,709

Post » Thu Jul 25, 2013 10:15 pm

The save system is designed as a Save State, not a Save Game. Of course you can use the save system to do save games, but that wasn't the design purpose. That's why the "No Save" behaviour was added. So you can use it as a save game model. I however, not consider ideal. As you now encountered one of the quirks of savestate. A layout reset.

Tokinsom is right. A proper save game should be using WebStorage and not the save state system. Think of SaveState the save that starts up after an app switch on mobile. A way to continue from the last instance when leaving the app.jayderyu2013-07-25 22:20:04
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Post » Thu Jul 25, 2013 11:44 pm

[QUOTE=sqiddster] @Tokinsom Are you suggesting I manually save every object position and variable to a dictionary/webstorage every time I want to save the game? That's a whole lot of effort for no good reason.
[/QUOTE]
There's a reason many games have dedicated save rooms or only allow you to save in the overworld :)

Also you could loop through the enemies to save their positions and such, but loading them will be a pain. We REALLY need "Create Object By Name". Don't care if it makes it easier for people to cheat, it's a necessity.Tokinsom2013-07-25 23:44:39
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests