How do I change Noise() seed?

I have an issue where I’m using the noise function for random float numbers and the values returned are somehow random but still same each time.

There should be a noise seed that you can manually set(in other APIs/languages that I have used) but I cannot find one here, and yes I tried with math.randomseed() with no luck.

The issue can be seen in the example project for noise if you remove the moveNoise() function call inside draw()

The user and all related content has been deleted.

@NatTheCoder It’s the noise() function that return the same list of random values on every run, as if the seed is constant for the function.

To see for yourself try adding this to the noise sample project before the loop that creates the image;

seed = math.random(0,math.huge)
math.randomseed(seed)
print(seed)

And then comment out the moveNoise() call in the draw loop.

This will set the math.randomseed() to a random value on each run and print it, and if you relaunch the project nothing changes in the image even if the seed changes.

@MuffinCoder I don’t get what you mean by a seed. Perlin noise is not random, nor is it intended to be. It’s usually used for generating images, or terrain. There is no “seed.” If you wanted random, you should use math.random().

Try Googling how it works, it might make more sense.

If you wanted it to have multiple layers, try using z or w.

@SkyTheCoder I have used perlin noise (alot) before and I know that it Can have a seed just like the math.random function.

This might be dependant on which type of perlin calculation that is implemented as the noise function.

As of writing this I realize that I can use the unused z value for the noise(as you said though I don’t know if there is a w value to the noise function) or a big offset. Though easiest would be to use a function to set a seed to the noise function.

@Muffincoder - Codea’s Noise function doesn’t have a random seed, but yes, the z value will do nicely for that