Using the initial posts values of how the bit layout currently is
```
Blue is block ID bits: 11 bits, 2048 possible values.
Red is HP bits: 8 bits, 256 possible values.
Green is Activation bits: 1 bit, 2 possible values.
Yellow is orientation bits: 4 bits, 16 possible values.
```
Would it not make more sense to change the Block ID bits to instead of being a blunt 11 bits be something more like breaking the 11 bits up so that a few of them define the shape and the rest are for ID, perhaps something like:
```
If the first bit is not set then the block is a cube and the bit format of the remaining ten bits is:
Bit(s) - Usage
--------------
3 - This should equal the 'Shape' size below, and only if these X number of bits are all zero then the remaining bits of this ten (7 in this example) are the material types of the cube type for efficiency reasons, if any/all of these X number of bits are non-zero then the entire range of 10 bits if the ID for a specific non-material block type, like a Ship Core, or a Storage block.
If the first bit is set then the block is a non-cube, and the bit format of the remaining ten bits is:
Bit(s) - Usage
--------------
3 - Shape, things like slope, corner, anything that is non-cube... Make this as large as there are possible shapes, you could make this fairly large if you keep the material count down
7 - Material, this is what the block type is, like a blue crystal or whatever, this may be more less bits depending on how many shapes there are.
```
In essence the possible bit layouts of the 11 ID bits would become:
```
M = Bit used for Material
S = Bit used for Shape
0000MMMMMM
0XXXXXXXXX
1SSSMMMMMM
```
This format would allow for highly efficient lookup without needing to lookup block types for shapes in an array or so (Is it a cube, is the first bit a zero? Is it a wedge, are the first few bits 0110 or whatever?), it also allows for quick testing of material types as well. All in all this would be a highly efficient design that would allow for a lot of collision testing, material lookups, and more, without needing to do more memory fetches. And of course the shape and material bits may be a different size depending on how many shapes are actually planned. And if there are any special block planned that will be non-cubes then you could just reserve, say, 0111 as the starter bits for them as well.
If the byte count was ever increased for 4 bytes then I would highly recommend expanding the rotation states to 5 bits, that way you could represent all 24 possible axis-aligned rotations. I would really love to be able to specify my docking blocks to rotate the docked ship a different way that is not 'forward' on my ship... In addition the extra rotation would allow for a great shape variety, especially as you could expand those bits as well.
(P.S. Why does this forum not support any form of standard markup?)