[C#] Game Saving Problems, Files are too large

Started by
9 comments, last by Cagnazzo 11 years, 10 months ago

[quote name='szecs' timestamp='1339615413' post='4948890']
*Um.... How about using multiple files? One file per map.


That would not help with anything, the total file size would be exactly the same.


*If there's a lot of repetition on the maps you could compress the map (for example with zlib)


I can try that thanks, but it takes time to compress and decompress. I don't want them to be waiting for 3 minutes just to save or load their game.
[/quote]

Combining those two will solve each others' problems, actually.

You break the massive world object down into subobjects, and compress those (or encode them in an efficient manner of your own devising, which is really the same thing.)

Your world is smaller, as everything is compressed. And since you don't have to decompress it all at once, you don't have huge lag spikes - only the portion being loaded has to be decompressed.

It has other benefits too - your RAM usage will be a lot lower, your disk reads will be a lot smaller (though, admittedly, they'll happen less predictably), and so on.

This topic is closed to new replies.

Advertisement