(11-22-2013, 09:54 PM)xoft Wrote: 2. There's still not much saved - if half of the blocks are mossy and the other half cobble, there's still 32k potentially growable blocks to remember.
Nah, I mean do it the same way Minecraft optimizes the use of triangles in rendering the chunks, only make triangles for the blocks that can potentially be visible, this means the border between outside and inside of the terrain.
Just store the moss blocks that are actually capable of growing to other blocks around them.
Code:
▢ = cobble
▣ = mossy
▢▢▢▢▢▢▢
▢▢▣▣▣▢▢
▢▣▣▣▣▣▢
▢▣▣▣▣▣▢
▢▣▣▣▣▣▢
▢▢▢▢▢▢▢
Then you would only store these blocks because the blocks in the center cannot grow more.
Code:
▢ = ignored
▣ = stored
▢▢▢▢▢▢▢
▢▢▣▣▣▢▢
▢▣▢▢▢▣▢
▢▣▢▢▢▣▢
▢▣▣▣▣▣▢
▢▢▢▢▢▢▢
Now I don't know how many mossy cobblestone blocks actually exist in a chunk normally and the way it should grow. You could also limit the growth of mossy blocks to only blocks that are exposed to air. That should greatly limit the number of blocks you need to store.