Perlin noise

New releases and general discussions.

Post » Tue Jul 21, 2009 3:22 pm

[quote="Arima":g0nxiumj]You could also potentially send an image to the image manipulator and get the values of each pixel.[/quote:g0nxiumj]

Yep I do that in my terrain generator, but its terribly slow tho...
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Jul 21, 2009 5:51 pm

why do you require a sprite for terrain generation? it seems you could get off just fine by setting the height of each point randomly,

perhaps you could create a value map 1/4th or wtv the size of your required size, set every 4th point to its matching value in the value map, then interpolate for values in between which arent every 4th point using cosine interpolation (cosp) perhaps as a smoothing algorithm between the values that point deals with. it would be complicated, but then again what your trying to do is complicated, i dont quite see the use for a perlin noise plugin unless im missing something, perlin noise is just a random value set with smoothing isnt it?

EDIT: it seems what im describing is simple gradient noise, perlin noise is slightly more complicated in that you would need multiple different resolution value maps and multiply them by each other to create a value set with macro and micro variations

http://freespace.virgin.net/hugo.elias/ ... perlin.htm

what i said would need to be combined with some of the stuff described on this page, it would leed to realistic terrain and i full confidence it can be done in construct with a few arrays and some complicated eventing
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Tue Jul 21, 2009 7:17 pm

the whole point of most plugins is to avoid complicated eventing
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Jul 21, 2009 7:35 pm

Outputing as a sprite would be much better suited to a shader, but I can't figure out an use of this that isn't covered by a prerendered tileable noise sprite. Seems for sprite prerendered is the way to go.

For arrays I'm thinking Python is probably the best way to go, as what you really need is a function that generates data, not a behavior nor an effect.

Also, keep in mind Perlin noise (and Simplex noise) are continuous, smooth noise functions. If you just need independent repeatable pseudorandom values Construct already has the best algorithm out there as an expression: Mersenne Twister, as random(max)
Note: The layered thingie is called fractal Brownian Motion (fBM) and uses several noise passes.

Would a python function that returns an array with simplex noise do the trick?
Can you put examples on how you would wish to use it? (python or behavior)

Edit: found explanation for procedural graphics generation with Java code, worth a read.
[url:1whhnp8s]http://www.angryoctopus.co.nz/?page_id=11[/url:1whhnp8s]
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Jul 22, 2009 12:06 am

[quote:1nz9noq1]If you just need independent repeatable pseudorandom values Construct already has the best algorithm out there as an expression: Mersenne Twister, as random(max)[/quote:1nz9noq1]

Is that the system expression: max(a, b [,c,...])
Retrieve the maximum of the given values. You can pass any number of values.

Care to use that in a sentence? Better yet an implementation.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Wed Jul 22, 2009 12:45 am

Ugh, I forget. Mersenne Twister IS repeatable, but currently there's no way to set the seed.
If you set a seed of any number, the sequence of randoms you get afterwards is always the same.
So.... this would be a request for an action to seed the random function :mrgreen:

and in random(max), max would be the largest number that comes out of the function.

On a related THING, I made a simple random clouds .cap with prerendered noise (photoshop's tileable clouds). It has a shader I just made attached to the clouds, so you can see how it would be useful.
[url:j3oalk2b]http://www.scirra.com/phpBB3/viewtopic.php?f=29&t=4288&start=0&st=0&sk=t&sd=a[/url:j3oalk2b]
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests