Infinite_Map Perlin Noise Question (SOLVED)

#1

How do I randomize the seed (permutation maybe) that is used in this example? Currently every map I generate is the same.

Source code is here: https://github.com/britzl/publicexamples/tree/master/examples/infinite_map

It’s the same code is this: 2D generation with perlin noise

1 Like

#2

One quite simple solution to the problem is to replace the hardcoded z-value of 0.3 used when calling perlin.noise(x, y, 0.3) with a seed that is generated on startup.

Another solution would be to in perlin.init() take three random values using math.random() and store them. Add these three random values to the x, y, z passed into perlin.noise().

3 Likes

#3

I’ll try both of these out thanks!

2 Likes