I’m growing fond of this databyte idea

Ever since I started this project, I’ve had the idea of an extra byte of data per block. It’s not a very original idea, granted, but it gives me a lot of room to do cool stuff. It’d fully solve the water problem as I posted about previously as well.

The downside is that it doubles the size of the maps, and that level polling might get a bit slower, but the advantages are numerous.

Here’s an example of the bit layout in this byte:

0-2: Liquid type. (8 values)
..0 = air
..1 = water
..2 = lava
..3-7 = reserved (oil? goo?)
3: isFlowing (needed by the liquid code)
4-7: Block shape (16 values)
..0 = full
..1 = half north
..2 = half south
..3 = half west
..4 = half east
..5 = half up
..6 = half down
..7 = slope north
..8 = slope south
..9 = slope west
..10 = slope east
..11 = pillar up/down
..12 = bar east/west
..13 = bar north/south
..14-15 = reserved

Blocks that can only come in one shape (the bushes for example) can use the last four bits for custom data, like keeping track of the age.

posted 14 years ago