Why does storing coordinates as YZX take up less space than storing them as XZY?

Viewed 44

In recent Minecraft patch-notes some changes were made to the way it saves world data.

said change

link to wiki page

This included a change from storing coordinates (presumably of entities) in the format of XZY to YZX.

Minecraft's Y coordinate is height, which used to range from 0 to 256, but with the same update that brought this optimisation it was changed to the range of -64 to 256.

I imagine that the reason that this is faster is something to do with the two's compliment representation of Y needing a sign bit at the front, but I can't visualise any reason why this would be faster.

An explanation would be appreciated.

1 Answers

I am not sure, but I think that it comes form chunks system and how sections are stored, I have been looking for reasons and the answer could be here:

https://stackoverflow.com/a/32671125/14712559

Here it is explained how it works, biomes use ZX-order and using YZX-order could be faster to render the graphics. Perhaps you are aware of this info, take a look to this question and tell me :D.

Related