Saturday, February 18, 2012

Whats a Block ID, and what does more of them mean for me?

Question

The most recent weekly snapshot release of Minecraft features a number of changes, including but not limited to:

•Added new world file format called 'Anvil' (256 max height and 4096 block IDs

What is a "Block ID" and what does such a large number of them mean for me as a average player?

Asked by Ender

Answer

Every block in the game has a corresponding ID: it's what allows the game to know you're looking at, say, a dirt block instead of a block of sand.

Before this change, there were only 2561 block IDs, which means there could only ever be 256 different blocks in the game.2 Now, there's enough room for over 4,0001 of them, which should be enough room for years to come.

It also provides modders a way to claim block IDs without stepping on each other's toes (so-called "collisions"): there were helper mods that extended the block ID space, but with over 3,500 unique, unused IDs, there's significantly less chance of any two mods using the same set of IDs with the native block handling.


Note 1: Why 256 and 4,096 instead of round numbers like 250 or 4,000? Because data is digital, it's stored in the binary (base 2) format. 256 = 28 which means 8 bits of space were reserved for block IDs. 4,096 = 212 meaning 4 bits of extra space were added to store the IDs.

Note 2: Even less, if you consider all the things that you might not consider a block but actually was, like the portal material and other technical blocks.

Answered by Mark Trapp

No comments:

Post a Comment