Just one look in save files was enough to find a lot of disadvantages in current saving system.
Main problem: savefiles’ size and speed of that system.
Even my current world is 14.5 MB, while it could be MAXIMUM ~40-60 KB
0. Just a question. Why the hell you write “16”, but not ► (0x10)? There’re upto 256 types of tiles, so, you can use one byte instead UPTO THREE BYTES.
[spoiler=1: Weak speed up and huge compression by similarity of tiles]1. You allow to appear same numbers a lot of times. You can write “16 16 16 16 16 16 16 16” as ◘► and use 2 bytes instead 23. One field of 12x12:
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
may take from (12+10)*12 = 244 bytes to
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
(36+10)*12=552 bytes.
Let’s see how many bytes will it take if we shorten this shit from: ♀♀(0x00) to ♀♀(0xFF) - from 3 GODDAMN BYTES TO 3 GODDAMN BYTES. Or even lesser - since shortening may be upto 12, their maximum value is 12 12, and it’s 12^2 = 144 different combinations, so, we can even shorten those ♀ IN ONE BYTE: Р(0x90).
That’s: 220 / 3 to 552 / 3 = 73 to 184 less times!
In contrary, that system will require to build special “matrix of map”, where you should show which bytes means shortening, which one - true data. Or, just to reserve 1 ID to show next value is shortening.
So… if we take our field of “16” (►) and shorten it by applying everything written above, we get: “(0xFF)Р►” Any explanation needed? (0xFF) means next symbol is shortening. Р (0x90) is ♀♀ (0xB), so, it means that symbol ► (0x10) is repeated 12 times and first ♀ means that line ♀► is repeated 12 times, but by Y-axis.
[/spoiler]
I don’t think we need to split every region to submaps, and every submap to 4 map-tiles. Just no comments, i described that already. Check #5 comment.
Todo.