iOS Constant game progress saving of .ini file - freezing engine

Hi all, in my logic puzzle game I'm constantly saving the game progress within an .ini file.
However, it saves alot of data (56kb) and the screen freezes on older iPhone 8 devices during preparation of strings before it finally saves.

I call the save game script in the step event. Is there a way/good practice where the save event should be called and it can run in its own task without interrupting the game?

Thank you!
 

FrostyCat

Member
Saving 60 times a second is needlessly paranoid and a complete waste of battery power on a mobile device. You'd know why if you understand the memory hierarchy.

If your puzzle game is turn-based, save only once after making a move or passing a level. Don't do it constantly. On top of that, you should make sure that the saving routine does not contain memory leaks.
 
Saving 60 times a second is needlessly paranoid and a complete waste of battery power on a mobile device. You'd know why if you understand the memory hierarchy.

If your puzzle game is turn-based, save only once after making a move or passing a level. Don't do it constantly. On top of that, you should make sure that the saving routine does not contain memory leaks.
I'm not constantly saving 60 FPS lol - i save when the users did a move (single player game) but even then there is a delay and freeze on screen (my current issue).

is it possible to save in another multi thread with low priority than the game itself?
 

FrostyCat

Member
You could use buffer_save_async() if you are using a binary-based save format, but that is aside from the point. 56kb worth of INI data is a lot of individual entries, and I don't think your current board state is all 56kb of it. Start by reducing the amount of data you deal with at once by splitting into smaller INI files by area of concern.
 
Yes you’re correct I’m saving a bit too much data. It would be way less in binary to avoid text strings.. hmm I might have the user to press the Exit Button to save the game progress and when he swipes the app off without exiting it will lose game progress..
 
Top