World folder
#11
Phew.. I just did a whole overhaul on the way stuff is saved, and it's not even done yet.

I went with the same kind of approach Notch did, now multiple chunks are saved in one file, and it's compressed! It's tinyBig Grin

I created a test case:

Old format:
  • 325 files
  • 25,3 MB

New format:
  • 6 files
  • 783 KB

The new format stores a maximum of 1024 chunks ( 32 by 32 ) chunks in one file. Chunks are intelligently cached in compressed form in memory and uncompressed when they are needed which keeps the RAM usage really low (expect 2~4kb per unused chunk, ~80kb per used chunk). In addition to that, it's REALLY fast!Big Grin which is pretty cool.

Data is compressed with zlib which (I think) comes with it's own corruption detection stuff, so I no longer have to check that manuallyBig Grin


PS:
Another awesome thing is that your old data is converted to the new data ON THE FLYTongue So you have to do nothing, and you won't even notice it!
Reply
Thanks given by:


Messages In This Thread
World folder - by Tim - 03-06-2011, 06:52 AM
RE: World folder - by FakeTruth - 03-06-2011, 07:28 AM
RE: World folder - by Tim - 03-06-2011, 07:49 AM
RE: World folder - by FakeTruth - 03-06-2011, 09:21 AM
RE: World folder - by Tim - 03-06-2011, 08:34 PM
RE: World folder - by FakeTruth - 03-07-2011, 01:57 AM
RE: World folder - by Tim - 03-07-2011, 03:27 AM
RE: World folder - by Tim - 03-10-2011, 11:57 PM
RE: World folder - by FakeTruth - 03-11-2011, 09:28 AM
RE: World folder - by Tim - 03-11-2011, 09:45 AM
RE: World folder - by FakeTruth - 05-06-2011, 02:22 AM
RE: World folder - by Tim - 05-10-2011, 04:40 AM
RE: World folder - by codename_B - 05-06-2011, 10:12 AM



Users browsing this thread: 1 Guest(s)