You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that Lua uses 64-bit integers, so will prefer a 64-bit hash.
I think that map coordinates are always less than 1024,
(in a 16x16 map, x and y can be 0..767)
so can be stuffed into a 32-bit hash with e.g. (x << 20) & (y << 10) & z
as long as it's guaranteed that none of those are negative, I guess. ((x & 0x3FF) << 20 & ((y & 0x3FF) << 10) & (z & 0x3FF), maybe.
#5961 addresses the first half of this
the second half will probably have to wait until #5959 is merged since it will need to be capability-based which our current identity system does not support well, but the one in #5959 handles much more readily
Activity
SilasD commentedon May 14, 2026
Note that Lua uses 64-bit integers, so will prefer a 64-bit hash.
I think that map coordinates are always less than 1024,
(in a 16x16 map, x and y can be 0..767)
so can be stuffed into a 32-bit hash with e.g.
(x << 20) & (y << 10) & zas long as it's guaranteed that none of those are negative, I guess.
((x & 0x3FF) << 20 & ((y & 0x3FF) << 10) & (z & 0x3FF), maybe.ab9rf commentedon Sep 20, 2026
#5961 addresses the first half of this
the second half will probably have to wait until #5959 is merged since it will need to be capability-based which our current identity system does not support well, but the one in #5959 handles much more readily