Perlin noise

This forum is currently in read-only mode.
From the Asset Store
Sound effects of monsters, ghosts, beasts and more
  • I am hereby being lazy and requesting a Perlin Noise implementation in form of a plugin.

    Potential uses to consider: terrain generation, height maps, texturing (clouds, nebulae etc.)

    Payment: My firstborn (if I ever give birth to one).

  • Might want to take a look at Simplex Noise.

    http://en.wikipedia.org/wiki/Simplex_noise

  • Low overhead, that indeed looks like a better alternative.

  • Now that the Reply button is back >_< I can reply.

    How do you need the data? as a rendered sprite? stuffed in a Matrix? as a behavior to query?

  • Given that a distort map's vertices give a nice matrix already.... I'd say sprite.

  • Doing a noise effect (shader) would probably yield the same effect as just loading a prerendered noise sprite.

    How would this be different?

    (I'm trying to figure out the best way to tackle this)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Oh wait scratch that sprites are a terrible idea, your limited on how big the map can be set.

    I guess your just going to have to judge by what it might be used for versus how big a draw it would be on the system. I have no idea how much juice a shader would take, and we all know that a huge sprite is just about un-usable.

    Some things to keep in mind. The texture doesnt necessarily have to be rendered in real time, but any kind of animation, or blur would take up huge amounts of vram. Although a tileable noise might fix some of that.

  • I need the numbers the most, so it could output an array. It can then be converted into heightmap or something by another plugin, while the noise itself could be used for procedural generation of dungeons, caves, celestial features et cetera.

    An example of texture could be background image (a nebula, stars etc.), that is randomly generated each time you visit a new star (yes, I have space exploration game in mind as well). Hopefully a seed can be preserved to regenerate the same noise on demand.

    Why not just let the user decide what output he wants? In properties, he'd choose either numeric output in form of array (export numbers into an existing Array object?) or an image (with a few settings such as colors, grayscale, alpha etc., export into a Sprite object?).

    Knowing the difficulty of above implementation, I'd be perfectly happy with numeric output only.

    P.S.: There is a number of functions that are quite a boon in game development that would expand Construct's feature light in a positive way.

  • You could also potentially send an image to the image manipulator and get the values of each pixel.

  • You could also potentially send an image to the image manipulator and get the values of each pixel.

    Yep I do that in my terrain generator, but its terribly slow tho...

  • 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

  • the whole point of most plugins is to avoid complicated eventing

  • 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.

    http://www.angryoctopus.co.nz/?page_id=11

  • [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)

    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.

  • 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

    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.

    http://www.scirra.com/phpBB3/viewtopic.php?f=29&t=4288&start=0&st=0&sk=t&sd=a

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)