From the last post you know that starting from the next version (1.29) Survivalcraft will use 32 bit blocks instead of 16 bit.
I am working through the existing blocks and updating them one by one to take advantage of this sudden abundance of bits.
One thing that is now possible is this:
I am about halfway through with it and have lots more stuff done than just stairs painting. I will show you later.
Anyway, it is delicate work. I am sure I will break very many things. The chunks file format is changing completely. Additionally, I will of course provide backwards compatibility. You won’t notice anything when loading a 1.28 world into 1.29 game. But behind the loading screen, every block will be scanned and expanded, its bits jumping in all directions.
I noticed that you are speculating what difference 32 bits make from the technical point of view. Here’s a brief explanation:
In 1.28 and earlier, each block takes 16 bits in memory:
|Number of bits (total 16)||Usage|
In 1.29, the structure looks as follows:
|Number of bits (total 32)||Usage|
As you see, in 1.29 the number of data bits jumps from 4 to 18. And Block ID is encoded using 10 bits instead of 8, giving a total of 1024 block IDs instead of 256 (remember when I was saying we’re running out of block IDs? No more).
How does the game use data bits? Every block does it differently. Take stairs for example. First 2 bits encode rotation (4 possible rotations). Third bit says whether stairs are upside-down. Fourth and fifth bits encode corner state (00 – no corner, 01 – inner corner, 10 – outer corner, 11 – undefined). Bit 6 says whether stairs are painted. Bits 7, 8, 9, 10 determine paint color (one of 16), if bit 6 was enabled.
In total, 10 bits out of 18 are used by the stairs.
This new structure is actually still in the air. As far as I can see now, no block will use more than 16 bits of data. It means I could take 2 bits from the data and give it to Block ID. That would extend number of available block IDs to 4096 (from 1024) – and incidentally bring us to the structure used by Minecraft since anvil file format was introduced. I am still pondering which is best.