Perlin Noise

rob1221

  • *
  • Posts: 9473
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


Jon

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


LIBERADO

  • *
  • Posts: 2720
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: 9473
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: 9473
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: 9473
It's attached to the first post.

GameExpress

  • Posts: 6
I'm not sure how to do that, but what is the purpose of getting a screenshot?
Perlin noise is used for generating random terrain. Have you heard of the game Minecraft? It uses Perlin Noise to generate its terrain.

rob1221

  • *
  • Posts: 9473
Updated the sample game due to image API scaling changes.  It's in the 4.0 format now so it may not work in older versions.  The extension itself still seems to work fine without changes.

RosalinaGalaxer

  • Posts: 239
Just discovered this today and it's super cool!

I was wondering though, if I wanted to add a new type of tile, how would I go about doing that? Not actually importing the tile, but setting up how often it's made, how much of it there is, and what it gets made next to.

I set up a little prototype thing, and I've got a guy that can run around in the world, and he goes slower when he's on the blue tiles, like he's swimming. It's pretty laggy, since I'm checking what tile he's over every frame, but I haven't figured out how to check that without making it lag like crazy.
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz