There's info online about the various kinds of terrain noise out there, but I can't find anything conclusive on the hashing functions used in their implementations. It seems that the standard for perlin/simplex noise is to rely on a hardcoded "permutation table" of a certain size, generally 256, but if I understand things correctly this implies that the noise is 256-periodic. You can make the permutation table bigger, but for infinite terrain, that won't do, will it?

Typically, I wonder what sources of reproducible randomness games such as #Minecraft use? I couldn't find that info online.

#ProceduralGeneration

@glocq Have you looked at Texturing and Modeling: A Procedural Approach? Ken Perlin wrote the chapter on noise for that and it comes with source code
@z303 I haven't. But if it's Perlin's original code, doesn't it suffer from the periodicity issue I mentioned?
@glocq Yes. I forgot to add the way that Ken Musgrave's example code gets around it is layering a number of octaves of noise at different scales, also in the book
@z303 As far as I am aware, octaves address a different problem, though? Even with different octaves, if, say, the lowest octave has a cell scale of 10m, then I will get repetition of large-scale features every 2560m; if the highest octave has a scale of 10cm, then I will get repetition of fine features every 25m...
@glocq I found using 8 octaves that aren't very noticeable but it has been a while since I've played around with them
@glocq You could look up the 8-bit table for every 8 bits in your grid index, in each axis. Then xor them together.
But I thought they mostly would use a pseudo-random number generator on the cell or patch location.
If the code needs to be super simple then (x*large prime + y*large prime + z*large prime)%n is a starting point.

@TomL I'm not sure I follow you completely, especially the middle of your response.

> Then xor them together

I'm afraid xor-ing might be dangerous, what if the first 8 bits are my x coordinate and the next 8 bits are my y coordinate? Then I get the same output for, say, (1,2) and (2,1)

> If the code needs to be super simple

It doesn't, actually. What I want is something not too burdensome to use/implement, and reasonably robust to collisions

@glocq good point about the xor. Hashing functions are so hard to analyse it is usually better to just copy a well reputed one. For instance Gemini recommended the MurmurHash for procedural noise. The finalizer part just mixes it up a bit better than the first (large prime) simple hash:

def hash_3d_high_quality(x, y, z):
h = (x * 73856093) ^ (y * 19349663) ^ (z * 83492791)

# Finalizer (bit avalanche)
h ^= h >> 16
h *= 0x85ebca6b
h ^= h >> 13
h *= 0xc2b2ae35
h ^= h >> 16
return h

@glocq

Yes it is periodic, but if you combine layers over layers of noise to generate the value of each parameters in your world you end up with something where the player will never notice that periodicity. By combination I mean both combination at various scales (octave) for one parameter, combination of different seed for different parameter, and combination of various ways you use these layers of noise.
Minecraft does use Perlin noise too. Have you look at this article ? It gives a lot of details.
https://www.alanzucconi.com/2022/06/05/minecraft-world-generation/
No Man's Sky does too. There are several recordings of GDC talks where they give details about how they did. Here is one of you haven't already seen it:
https://youtu.be/C9RyEiEzMiU?si=kGZT2fWnHteTuxB4