curioustorvald/Terrarum

Chunked World Savegame Format for Fast Autosaving

curioustorvald opened this issue · 2 comments

  • A chunk is 90x90 tiles in size (90 turns out to be balanced being small in size yet efficient in compression)
  • A world gotta be able to hold at least 1048576 chunks
  • A world's layer count is less than 16 layers
    → this neatly packs into a 24-bit number, like this: 0xLC_CCCC
    And then we can put World Index onto this, like: 0xWW_WWLC_CCCC

Since 0..0xFFFFFFFF is occupied, we should use different address space, e.g. 0x0000_WWWW_LLCC_CCCC, and just occupy larger address space because why not?
(note: world index starts from 1)

0x0000_0000_0000_WWWW holds World Meta information.

Seems working, only thing left to do is actually implementing an autosave and see if it's actually significantly faster than saving the entire world.

Chunks should be stored vertically from top-left, just like the worldgen