I managed to solve my save game problem thanks to those on the forum but one problem is that since I’m saving the game on every move, the game seems to get slower and slower as the game goes along? Not sure why this is since I’m not saving anything huge.
The save game function is like this:
saveGame = function() local gameSettings = { moves = moves, savedeal = savedeal, saveHistory = saveHistory, shuffle = shuffle, } loadsave.saveTable( gameSettings, "settings.json" ) end,
Moves is just an integer, savedeal and shuffle are arrays of simple one or two digit integers. _saveHistory _contains a little more since it contains move information but still is just numbers and the odd string here and there. Not sure why these would take up more and more memory or whatever is making the game slower and slower? _saveHistory _starts empty and builds with each move, but by only about 20 or perhaps less moves the game has slowed considerably.
EDIT: It’s just the saveHistory that is doing it but I’m not sure why saving it would cause the game to slow down. Since it’s being stored in an array where I save the game or not.