Save on suspended

1 favourites
  • 6 posts
From the Asset Store
Match the similar cards with each other and free all animals!
  • I'm running an alpha test on my mobile game and few users are having problems with losing their progress when they briefly go to messenger or Facebook or something other in their phone. When they come back to the game it will restart and go back to the menu. I think this only happens on phones that have turned on battery saving mode so they auto close to free up memory or something like that.

    So my question is, how would I catch when users are going to another app. The trigger "on suspended" would be the best action I think, and when it catches that it would use the "Save Game" action. But the problem with that, would the Save Game action be able to finish saving everything when the user has already suspended the game?

    Would I need to catch this before the user even clicks the minimize button by auto saving each 10 sec or so? Instead of using save game, should I make a custom function that writes it to the local storage instead, would that be faster?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • "When they come back to the game it will restart and go back to the menu." What does this mean? What kind of game is it and what are you trying to save, does your game need to be saving every 10 seconds?

  • It's a tetris kind of a game where people have to do some puzzles and sometimes one game takes up to one hour. They want to play it in parts, so 5 min here and there for days often.

    But like i tried to explain, the problem for some is "alt tabbing" between programs on the phone and coming back to the game and seeing it basically restart, it's like they are just starting the game fresh. I haven't been able to make this happen on Samsung S9 or Oneplus 7 pro. I guess this happens on lower-end phones where some memory management kills programs that are not being used.

    I don't need to save each 10 sec, I'm just wondering what would be the best way to catch the current progress of the game when people jump to another program.

  • Saving on suspended or when the app is exiting sounds risky. I guess just autosave after each important step of the puzzle so you can restore it.

  • That's what I'm thinking. It's risky because the app could be terminated before the save action has finished. I guess I could just give the player a manual way to save their progress.

  • Using on end of layout might work also if it saves fast enough

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