Files
m4kc/random/algorithm-info
2021-12-27 02:02:39 -05:00

45 lines
1.1 KiB
Plaintext

chunk block
|| ||
/---------------------------\/----\
x: 11111111 11111111 11111111 11111111
y: 11111111 11111111 11111111 11111111
z: 11111111 11111111 11111111 11111111
after bit shift >> 6:
free chunk
|| ||
/----\/---------------------------\
x: 00000011 11111111 11111111 11111111
y: 00000011 11111111 11111111 11111111
z: 00000011 11111111 11111111 11111111
after bit mask 0b11 11111111:
x: 00000000 00000000 00000011 11111111
y: 00000000 00000000 00000011 11111111
z: 00000000 00000000 00000011 11111111
after bit shift again:
x: 00000000 00000000 00000011 11111111 Doing nothing
y: 00000000 00001111 11111100 00000000 << 10
z: 00111111 11110000 00000000 00000000 << 20
after binary or:
hash: 00111111 11111111 11111111 11111111
This algorithm will have no collisions,
unless the player tries to load in chunks
that are tens of thousands of blocks away
from eachother.