In my game, you edit the terrain some but I need a way of saving these edits, but I see no feasible way of doing this. I have tried using
for ( var xnum = 0; xnum <513; xnum++)
{
for ( var ynum = 0; ynum <513; ynum++)
{
PlayerPrefs.SetFloat( "Terrain" + xnum + ynum, heights[xnum,ynum] );
}
}
but my computer is still trying to complete this action and I cant imagine that anybody wanting to play a game has the patience to wait for an hour for their terrain to save. Any suggestions? Also, in unity, if I edit the terrain in my published game, does it automatically save changes to the terrain data?
Thanks!
That’s 263169 items to save. Can Prefs handle that? In any case, it’s a lot. String packing is an idea, but it would do at least as many memory reallocations, and each one takes longer than the last. Might be easier to allocate a big chunk of memory and write into it, then save that chunk. And (if not web) save using System rather than PlayerPrefs
I have been looking around and have tried packing all the data into one string, but that does not work either. How would I allocate a big chunk of memory to write into it? Thanks!