Handling save game failure

Discussion and feedback on Construct 2

Post » Thu Apr 21, 2016 10:37 am

From my last game, Project Dimentia Bodhisattva, (http://www.newgrounds.com/portal/view/660664) (the game takes 5-15 hours to complete. Use Chrome on Windows if you wanna play.) I see a few players ran into situations where the game is not saved. I can narrow down the problems as follow:

1. They don't have enough storage in their browser's setting.
2. Some of their browser's plugin/setting prevent the game to save.

These issues could be remedy by setting the right parameters in the browser and/or disable certain plugin, but when I was aware of this, several players were already affected of this issue and they lost their game progress.

The problem is that On Saved trigger will only be fired if the save is successful. If the save is never successful, the trigger is never fired - and game is never saved. There is no "On Save Failed" trigger, I see.

So I would like to safeguard this for my next game. My questions:

1. Is there some sort of way that I can track the saving progress of the save game function before "On Save Completed" trigger?

2. "On Save Completed" trigger is the only opportunity to get the "saved data" JSON, but if it is never triggered, I can't get the data. Is there an alternative way to get this JSON without saving the game? (Are there other plugins out there that allow you to access this JSON?)

3. Are there some sort of Javascript codes/plugin/etc. that allow us to check for remaining allowable memory in browser or the like? At least, before the game starts, we should be able to test if the game can save properly or not.

4. Any plugin/alternative/suggestion/other method for save/load game?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Sun May 01, 2016 6:06 pm

bump.

If there are no solutions to save failure yet, perhaps I will need to go for password route. A bigger Flash RPG game such as Phoenotopia also did this as several people lost their saved data on their browser. Password is put into clipboard and player can save it somewhere. Player can then paste the password on the game's continue screen.

From the look, I believe Phoenotopia simply uses some encryption algorithm to encrypt the whole save data and make that a password.

But for C2, if the save failed, I will not be able to retrieve the save state json at all... the last resort would be going down and dirty myself... :(

Another problem is putting data into clipboard. I see from another thread answered by @R0J0hound that only Node Webkit can do clipboard stuff as it is OS-specific thing.

Are there other things I can do to store data or give data to the player?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Mon May 02, 2016 7:04 am

@Ashley, is it possible for the future release to be able to provide SaveStateJSON without acquiring it only from the trigger "on save success"?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Mon May 02, 2016 9:05 am

@keroberos

If I activate in Chrome 'Block sites from setting any data' I get this Error in the Console:
Uncaught (in promise) Error: No available storage method found.
at b (http://localhost:8000/LocalStorage_plugin.js:17:9502)


It seems that with this error, some or all LocalStorage events does'nt work. I tried OnError and 'On Item missing'.
My workaround is: make a variable like 'isSaved' and set it to 0 and set it to 1 in the event 'On item set'.
Now you can try on the start of your game to set the variable. If the variable is set to 1 it works, if not it's not possible to save the game at all.
Image
B
24
S
3
G
1
Posts: 454
Reputation: 2,171

Post » Mon May 02, 2016 1:26 pm

We could add a "On save failed" trigger, but it doesn't necessary help. Browsers take privacy very seriously and deliberately make it hard for the page to know what is happening to its data. For example Chrome in incognito mode will say everything saved to disk just fine, then when you close the window, delete it all. That's by design, and they deliberately prevent pages from identifying this mode so that the page can't nag them to have their data saved - it just looks like it worked.

So even if we added this, you don't know when to show the alternative copy-paste system, because you can't really tell if the data will last permanently or not.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,351

Post » Mon May 02, 2016 8:50 pm

Ashley wrote:We could add a "On save failed" trigger, but it doesn't necessary help. Browsers take privacy very seriously and deliberately make it hard for the page to know what is happening to its data. For example Chrome in incognito mode will say everything saved to disk just fine, then when you close the window, delete it all. That's by design, and they deliberately prevent pages from identifying this mode so that the page can't nag them to have their data saved - it just looks like it worked.

So even if we added this, you don't know when to show the alternative copy-paste system, because you can't really tell if the data will last permanently or not.

Hmm, true. Still, it's better than not having anything as a "save failed" response. The manual should note that it won't work reliably when the game is run in private mode.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,721


Return to Construct 2 General

Who is online

Users browsing this forum: Cubeeo and 4 guests