Why 255 height and colors?

why that number? I was just wondering.

Actually it is 256 colors :smiley:
Itā€™s starts with value 0 ā€¦
ā€œ0ā€ is set to store the default value of your planet colors for each blockitem

2 Likes

And itā€™s 256 altitude. Itā€™s just your avatar is 2 blocks high, so you can only stand on 255 max so your head stays in the atmosphere :wink:

2 Likes

then why 256 and 256?

Bytes

https://www.quora.com/Why-does-the-number-256-appear-so-often-in-programming-and-computer-hardware#:~:text=256%20is%202%20to%20the,because%20it%20has%20these%20features.

2 Likes

thanks @Soju-VB

tldr

"This means that 256 values (0ā€“255) can fit inside an 8-bit variable, register, or memory location. This size is called a byte. Bytes are now the standard way of defining memory sizes, as in bytes, kilobytes (KB, or 1024 bytes), megabytes (MB, or 10241024 bytes), gigabytes (GB, or 102410241024 bytes) and terabytes (TB, or 1024102410241024 bytes). "

2 Likes

isnt there petabytes PB which no computer can achive yet?

@LunaiHunter
Try to imagine what would happen to all the game-data, if DEV-HQ sets the height or colour values to 512 or 1024 ā€¦ :thinking:
I think James does not want to know that
But hey, maybe they have tested it ā€¦ I donā€™t know :sunglasses:

the ancient ones lived in that universe - different dimensions

we are like flatlanders to them

2 Likes

Having 2 bytes for storing colors instead of 1 actually gives you 65536 colors in total instead of 512 because itā€™s 256*256 not 256+256.
But it would also make the colors of worlds use 8 times as much memory (since itā€™s volume data), which means roughly 8 times longer loading times.
(simplified)

4 Likes

For the record Iā€™m fine with 255 colors we have right now :grinning:

6 Likes

I assume hypothetically they could change it to 512 and run everything thru a converter

Also if they hypothetically used 9 bits (I presume they use 16 bits anyway, since thereā€™s other data in there, but hypothetically)
9 bits instead of 8 is 112.5%
Cubed thatā€™s 142%
So itā€™s +42% more data not +700%

Totally depends on how they would want to implement it.

Like right now we have 255 colours, those will stay, they could add 1 bit somewhere else to designate that thereā€™s more colour data or not and then only add an extra byte of colour info into the data when needed.

This does mean they should have 1 bit free in the rest of the block data somewhere, if not, wellā€¦

Changing to 512 is 1 bit extra, they donā€™t even need to run thru a converter, if that bit is 0 itā€™s the old 8 bit colourā€¦

But to add 1 bit extra info they will need to have room to represent that. If colour data is exactly 1 byte which it is then they would need to add a whole byte. Unless they still have some unused bits in the rest of the block data but seeing they are severely limited in many ways (like the limit on fluids) doesnā€™t look like they have much space to work with.

Honestly tho, Iā€™ve always kinda hoped they would add colour modifier info, same base 255 colours but something can change that colour, brighter, etc. essentially thus creating more actual colours. And if they do it how I described above then the data is not necessarily becoming much more.

Especially if the way to get the extra colours is rather ā€˜expensiveā€™ so there wonā€™t be ginormous buildings be made out of it the total data size might be doable.

Besides, with the new console gen coming around, internet speeds getting faster it should be feasible in a few years to have our little game take twice as much data to move aboutā€¦

Just add a byte per block to it, where each bit can represent ā€œhey, thereā€™s more xx type of data following this byte!ā€

Or as I mentioned, if they have a single bit left right now to tell that there is an extra byte of info for this block alone then they can use 8 bits again to represent all kinds of things, like 1 bit is ā€œyep, new fluid type, next byte is the colour of the gleam fluid!ā€, another bit ā€œyep, extra colour info incoming!ā€, etc.

2 Likes

I want more shades of silk yellow to meme harder!

3 Likes

I want gleam fluids!!!

2 Likes

Shameless plug

2 Likes

Since you canā€™t achieve this with primitive data types but have to build your out of a struct or a bitfield or whatever, is it actually smaller then a 16 bit native type?

I know! I loved that idea! Hence why Iā€™m voting for more data per block!

Block data size matters! We need more of it!

Got 1 bit spare at the moment? Use it to indicate thereā€™s another byte of lovely info about the block!

Go get cracking team!

They do use bitfields, yes, and one can do that with a byte too if neededā€¦