I have been testing loading and saving of levels on iPad and on my new Android tablet (Nexus 7) and the save / loading was taking a very very long time. Even on the Mac/PC it was slow (>76000ms (76s) for 100 saves of a standard looking, sized level. And on fast SSD on SATA 3 on fast Mac and PC, that is not very good.
So I had to do a lot of research to find a better way to do the saving and loading of level data. Unity/C# has no fast way to save/load out a structured set of data (like in C or C++), so finding the fastest possible way to do this has not been easy. But after searching through lots of webpages I found a way to do it and also a way to shrink down the size of the level data.
Old routines was around 760 ms for saving a level.
Save on Mac (SSD,Sata3) ca. 13.5 ms for a level with quite a few paths and 176 aliens and encryption of leveldata.
Load on Mac (SSD, Sata3) ca 8.4 ms for the same level with decryption of loaded data.
As the save and load routines are so very very important part of the core of the game, I want to make sure that it is as fast and general as possible. The versions I have now should be easy to modify to load/save levels and levelpacks from/to a server too.
Comments are welcomed!!