Hi, I started working on saving for my game that im working on. Basicaly I have a 10000 "tile" island, which have 6 variables each that need to be saved in order to load the same island propperly. And as you may suspect (but it didn't occur to me until now

) Saving 60k floats takes a bit longer than what's acceptable. Right now it takes 170 seconds on my PC, about 200 on my phone and 300 on my tablet. And I wouldn't want to wait 300 secs to save my progress

.
This means that I have to figure out a better way of saving the world. I could save while playing, but that would probably have some impact on performance, whic is already pretty bad on my tablet. And im guessing that if the game would crash or get shut down, the saves could become corrupt. Another problem is that I would need to edit the savefile which I don't even know is is possible.
A third option would be to divide the area into chunks, with 10x10 tiles eahc, and then the game would remember what chunks have changed and when the user saves, it would only save the changed chunks.
Do you have any other ideas?
This is the code, whic is realy slow, but it shows you how much data I need to save.
SaveStart# = timer()
//Saving to the selected slot
OpenToWrite(1, "slot" + str(slot) + ".eqk")
//Saving the player data
WriteFloat(1, Player.X)
WriteFloat(1, Player.Y)
WriteFloat(1, Player.SpawnX)
WriteFloat(1, Player.SpawnY)
WriteFloat(1, Player.Hunger)
WriteFloat(1, Player.Energy)
WriteFloat(1, Player.Morale)
WriteFloat(1, Player.Health)
//Saving the map
For X = 0 to Xmax
For Y = 0 to YMax
WriteInteger(1, Grid[X, Y].ID)
WriteInteger(1, Grid[X, Y].Item)
WriteInteger(1, Grid[X, Y].IRotation)
WriteInteger(1, Grid[X, Y].looted)
WriteInteger(1, Grid[X, Y].LastLoot)
WriteInteger(1, Grid[X, Y].GrowthTime)
print ("Saving Grid: " + Str(X) + str(Y))
sync()
next Y
Next X
CloseFile(1)
TimeToSave# = Timer()-SaveStart#
One thing to note, is that the whole world is made out of 3 blocks (with stuff on them) so perhaps I can save the tiles as areas of the same things instead of separate tiles.
Edit Ehh I found the problem. I put a sync command in there to print the progress. But I didn't think about the fact that sync actually syncs and caps the game at 60 FPS. So that decreased the time to save to 1 second instead of 170.
Edit 2And just as I fixed the problem, another arises. Now when I try to save on my 2 android devices, the app crashes, and my tablet which has a live walpaper, removes it. The phone just reloads all icons. Could it be a out of ram error...