I'm attempting to generate infinite random terrain. The terrain should generate the same every time given the same seed.
I've tried using Java's Random function, creating the seed using various functions of the x and y co-ordinates of the given node on the terrain grid. Such as x*y+x+y+seed, 20*x+30*y etc.
The problem with this approach is that I always see clear patterns in the numbers generated.
So basically what I want is:
f(x,y) = Random Number
It would be helpful if the above function could include a seed of some sort, making it:
f(x,y,seed) = Random Number
I will need to generate several numbers for each x,y combination but it should be easy enough to derive additional numbers once I have the above function. These will serve to dictate height of the terrain, and what features (buildings, trees) will be present.
Please, no mention of Perlin Noise or other such methods. My problem isn't making the noise look good, it's getting reliably "random" noise.
Thanks,
Jamie.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…