Stencyl 3.4.0 is now out. Get it now!

Perlin Noise

rob1221

  • *
  • Posts: 9036
Behavior vs scene event doesn't make a difference, so something else must have been wrong.

I'm thinking about changing the extension to remove anything specific to Flash, which includes all the options after the random seed.  That would result in a shorter and less complex block as well as consistent behavior across platforms.  I'm also considering making a block that returns a perlin noise image as a list of values from 0-255.

EDIT: I updated the first post.  The extension now has only two blocks, one to create the noise, and one to return the noise as a list for use in procedurally generated games.

« Last Edit: June 10, 2014, 01:59:53 pm by rob1221 »

Pixel8ed dev

  • Posts: 11
would there be some tutorial on the stencylpedia about perlin noise, and procedural generation?
Would be great, this would help a lot of people

rob1221

  • *
  • Posts: 9036
Nope, there isn't.

Jon

  • *
  • Posts: 17514
There's a import nme.display.BitmapData; at the top. This will need to be updated to openfl for 3.3. Thanks!


LIBERADO

  • *
  • Posts: 2345
Wow! I had not seen this extension. It is very useful to generate random terrain. Thanks rob1221

By the way, I would like to get a list of values from 0-255.

<a href="http://www.filz.us/files/d116f49b/59b/RandomTerrain.swf" target="_blank" class="new_win">http://www.filz.us/files/d116f49b/59b/RandomTerrain.swf</a>

« Last Edit: October 06, 2015, 04:19:50 am by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Wesxdz

  • Posts: 80
I tried using a text variable (as a number) for my seed and it created a very odd looking map. What's the best way to create a normal seed based on text? Is that even possible unless I convert each text character into a correlating number?

rob1221

  • *
  • Posts: 9036
If the text is just numbers then it should work fine.  Otherwise you'll have to create a way to convert letters into numbers.

Wesxdz

  • Posts: 80
Okay, I'll just create a behavior that adds a certain integer to a seed based on the text var. (A=+1, B=+2, etc...) I'll definitely have some repeat maps, but it's enough to trick players.

rob1221

  • *
  • Posts: 9036
I updated a few things in the sample game, most importantly a fix to allow the game to work at scales above 1x.  The game might require Stencyl 3.4 to work properly since I updated it to the 3.4 format, and the extension now requires Stencyl 3.3 or higher.

GaborDavid

  • Posts: 1
Where can i download this extension?

rob1221

  • *
  • Posts: 9036
It's attached to the first post.