Always Save w/ out Lag?
AngryBoi
Member Posts: 586
How can I constantly be saving my game without lag? I have constant points coming in, and need it to be constantly saving. Any way how?
Comments
How often is "constant" and why does it need to be that way? I would write the value to a table and just write rules to periodically auto-save/save at prime points in the game.
Follow us: Twitter - Website
@AlchimiaStudios It's a clicker game, and ever time you click, you get a point. But, if I save every single time I click, it lags...
@BetweenTheWalls maybe you could save the game when the user stops tapping for X seconds. I'd expect the user to stop tapping before closing the app, so that'd be a logical place to save the game. Of course if GS had some rule that was triggered when application is terminated, it would be the best place to do it.
That sounds okay. Anyone know of any other ways?
If I save it every .01 seconds will it cause lag? Ive heard it wouldn't, but I'm not sure..
Save at every .2 seconds. Thats still 5 times a second -- which is pretty fast for a human, but very slow to a computer. (If its still lagging, then I would bet that its because of some inefficiency thats being introduced by your code.)
Thanks. I ended up saving every .1 seconds and it didn't cause any lag. I guess i just needed to try it.