Author Topic: Continuing Generated Noise  (Read 1130 times)

So I would like to know how I could continue a previously generated [slice? chunk? tile?] of noise (perlin noise).

For example, I generate some perlin noise with the dimensions of 128 x 128. Am I able to generate another perlin noise function the would seemlessly go next to it?

I know it's possible to make them tileable or repeatable, but I just want it to continue, not repeat.

Any resources or hints are appreciated.

It's possible to make perlin noise a function of a given position. I'm not too sure how exactly, but that'd probably be your solution.

It's possible to make perlin noise a function of a given position. I'm not too sure how exactly, but that'd probably be your solution.
Hmm, currently I generate (essentially) an array of values for the noise.

I've seen something of the sort where you can just call like noise(%x,%y) but I'm not sure how to translate some of the stuff into TorqueScript.

Edit:
So I found this code on the matter:
Code: [Select]
function Noise1(integer x, integer y)
    n = x + y * 57
    n = (n<<13) ^ n;
    return ( 1.0 - ( (n * (n * n * 15731 + 789221) + 1376312589) & 7fffffff) / 1073741824.0);   
  end function
Correct me if I'm wrong, I'm pretty sure this is just a random generator to produce a random number (between 0 and 1?) based on the seed n, which is dependent on x and y. But I'm not sure how to translate some of that code into TS; anyone know what some of those operators actually do?
« Last Edit: November 28, 2012, 06:33:32 PM by lilboarder32 »

hello
im Dr. NoisesAlot
im here to help
noise is a controlled random number generator. Usually returns a number 0-1 or -1 to 1 (depending on generator/implementation/dimmension).

It appears your probably looking at 2D Noise, which is flat.
What you want to do is find a generator and convert it to Torque, that uses a seed.
Then what you can just do is use that same seed but different coordinates for the chunk and use width/length as the chunk size and they tile up correctly ;)

hello
im Dr. NoisesAlot
im here to help
noise is a controlled random number generator. Usually returns a number 0-1 or -1 to 1 (depending on generator/implementation/dimmension).

It appears your probably looking at 2D Noise, which is flat.
What you want to do is find a generator and convert it to Torque, that uses a seed.
Then what you can just do is use that same seed but different coordinates for the chunk and use width/length as the chunk size and they tile up correctly ;)
So why would I be unable to use the built in generator for Torque? I'm able to set the seed for it.

So why would I be unable to use the built in generator for Torque? I'm able to set the seed for it.
because it doesn't take coordinates.
and random and noise are different, they behave differently. They also have different values, the values for a RNG is nothing and noise takes coordinates.
and a RNG just gives you a poop number based off a stupid seed

because it doesn't take coordinates.
and random and noise are different, they behave differently. They also have different values, the values for a RNG is nothing and noise takes coordinates.
and a RNG just gives you a poop number based off a stupid seed
I'm having trouble finding such a generator, besides the one thing I posted earlier, except I don't know how to convert that.

Also looking at like Zack0Wack0's implementation and even other similar examples online, I can't follow what's going on. In that code, there are things like an array full of seemingly random pre-defined numbers.

I'm having trouble finding such a generator, besides the one thing I posted earlier, except I don't know how to convert that.

Also looking at like Zack0Wack0's implementation and even other similar examples online, I can't follow what's going on. In that code, there are things like an array full of seemingly random pre-defined numbers.
the Perlin Noise it self doesn't take a seed, it takes coordinates, it just depends on what you do with the noise value.

def Generate():
    octaves = 8
    persistence = 0.8
   
    amplitude = 1.0
    maxamplitude = 1.0
    for octave in xrange(octaves):
        amplitude *= persistence
        maxamplitude += amplitude

    surface.lock()
    for x in xrange(Screen):
        for y in xrange(Screen):
            sc = float(Screen)/tilesize
            frequency = 1.0
            amplitude = 1.0
            color = 0.0
            for octave in xrange(octaves):
                sc *= frequency
                grey = noise(sc*float(x)/Screen,sc*float(y)/Screen,0.0)
                grey = (grey+1.0)/2.0
                grey *= amplitude
                color += grey
                frequency *= 2.0
                amplitude *= persistence
            color /= maxamplitude
            color = int(round(color*255.0))


this is an example function.
there's no seed but you understand that if you keep all the values the same you won't have trouble. Search of implementations of Perlin Noise in languages you understand well. Try to find ones they don't use Width/Height.