[PLUGIN] noisejs

Post your completed addons to share with the community

Post » Sun Dec 07, 2014 9:40 am

Awesome Plugin!

I wanted to know if you could go alittle more in depth when it comes to how i can use this for terrain generation inside construct 2?
Im making a 2d sandbox game similar to Terraria using arrays right now but im trying to create natural feeling hills and mountains, I would love to know how to make this work in that way.
Ive asked around but the info on what expressions to use and how to use them inside construct 2 is very limited on the forums.
Thanks for making this plugin and i look forward to learning how to use this in game.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Mon Dec 08, 2014 6:38 pm

RookieDev wrote:Awesome Plugin!

I wanted to know if you could go alittle more in depth when it comes to how i can use this for terrain generation inside construct 2?
Im making a 2d sandbox game similar to Terraria using arrays right now but im trying to create natural feeling hills and mountains, I would love to know how to make this work in that way.
Ive asked around but the info on what expressions to use and how to use them inside construct 2 is very limited on the forums.
Thanks for making this plugin and i look forward to learning how to use this in game.


I didn't really use noise in relation to platformers so far, so I might not be able to give a good answer here. Manipulating the original plugin example a bit I came up with the following: download capx.

It's very rough of course, but I hope one can imagine how it begins to go in the requested direction. There is of course a lot more that goes into the generation of maps in a game like Terraria. You will have to make up a lot of rules on how the game will create its world. A nice thread about this I found online: Terraria and its random maps.

Oh, and in case you are having general trouble with getting the most of and understanding the various expressions Construct 2 provides, remember you can always consult the manual.
B
22
S
6
G
10
Posts: 1,036
Reputation: 7,518

Post » Mon Dec 08, 2014 7:02 pm

@PixelRebirth Thank you! I am opening your capX right now. as for the terrain generation, I have alot of the basics down but what i lack is some basic skills when it comes to Manipulationg the array once it has been created or even before it has been created.
I have a very toned down version of terraria/minecraft but i lack the skills needed to make more natural feeling terrain.
Perlin Noise seems to be prettyepic when it comes to this but what i needed to know what the exspessions used to access the logic in this addon. The manual explains all of scirras exspression and i didnt see Perlin Noise there when i looked thats why i came to you for information regarding it.

The main thing for me is just altering the elevation so the ground appears to be not as flatland. Thanks again for your help, I really need every bit i can get!
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Mon Dec 08, 2014 7:15 pm

@RookieDev No problem, I hope it helps a bit in understanding the way this plugin works. The main thing you will be using are the expressions returning the noise values at the given coordinates: simplex2(x,y), simplex3(x,y,z), perlin2(x,y) and perlin3(x,y,z).

There's really not anything more to it, other than setting the seed of course. It might also help to google some general articles/tutorials about perlin noise, terrain generation and related things.
B
22
S
6
G
10
Posts: 1,036
Reputation: 7,518

Post » Tue Dec 09, 2014 1:42 am

Wow cool plugin. Thanks for making an alternative. I still prefer to use shaders though.
sleep is only for the weak!
B
91
S
30
G
12
Posts: 139
Reputation: 11,992

Post » Thu Oct 08, 2015 3:52 am

Hi @PixelRebirth Sorry for asking this after so much time but, I've saw your example about how to use it in a platform game like terraria and I didn't understand (I'm new to this concept)

noisejs.simplex2(loopindex("x"), loopindex("y")) < 0.25
While 0.25? What does this expression means?That this noise value will take place in that specific x and y coordinates?

while temp = -1?

etc

Basically i didn't understand any of the values you put, what impact it does at the map generation and the conditions to destroy the blocks.

Thanks!
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Mon Oct 12, 2015 4:10 pm

kossglobal wrote:Hi @PixelRebirth Sorry for asking this after so much time but, I've saw your example about how to use it in a platform game like terraria and I didn't understand (I'm new to this concept)

noisejs.simplex2(loopindex("x"), loopindex("y")) < 0.25
While 0.25? What does this expression means?That this noise value will take place in that specific x and y coordinates?

while temp = -1?

etc

Basically i didn't understand any of the values you put, what impact it does at the map generation and the conditions to destroy the blocks.

Thanks!


Well, i don't think he wants non-math geniuses to use this. He also did some things like 50+50 rather than just typing 100. Seems like he is trying to trip up non-math people.

This is a really common thing people do on StackOverflow.com to make so people dont just copy and paste code.

You can do the same thing to any expression, Eg: X=100-100+50-50+90-90. You can do this rather than say just say X=0.

@PixelRebirth Great plugin!

added 3 blocks and a water effect:
http://voxi3d.comule.com/simlexgenerate/

Just hit space to re-generate.


That was just 10 minutes of work, I cant wait until I have an entire afternoon to make a full fledged generator.
Excellent plugin! Very fast!
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Tue Oct 13, 2015 1:48 pm

jojoe wrote:
kossglobal wrote:Hi @PixelRebirth Sorry for asking this after so much time but, I've saw your example about how to use it in a platform game like terraria and I didn't understand (I'm new to this concept)

noisejs.simplex2(loopindex("x"), loopindex("y")) < 0.25
While 0.25? What does this expression means?That this noise value will take place in that specific x and y coordinates?

while temp = -1?

etc

Basically i didn't understand any of the values you put, what impact it does at the map generation and the conditions to destroy the blocks.

Thanks!


Well, i don't think he wants non-math geniuses to use this. He also did some things like 50+50 rather than just typing 100. Seems like he is trying to trip up non-math people.

This is a really common thing people do on StackOverflow.com to make so people dont just copy and paste code.

You can do the same thing to any expression, Eg: X=100-100+50-50+90-90. You can do this rather than say just say X=0.



If you look at the original example, you can see that the second number of 50 is being multiplied with a noise expression. So simply putting 100 there doesn't do the same at all. I did it to get the complete range of 0-100% opacity, since the plugin returns values from -1 to 1.

Certainly not trying to trip anyone up, I'm not "math people" either. :D

@kossglobal I probably should have put more comments in the second example. It was really just a quick and dirty one. I simply decided on a range that won't be drawing any tiles. That's the < -0.25 part. It's all pretty abitrary, therefore feel free to play around with the values to see how it affects things.

jojoe wrote:@PixelRebirth Great plugin!

added 3 blocks and a water effect:
http://voxi3d.comule.com/simlexgenerate/

Just hit space to re-generate.


That was just 10 minutes of work, I cant wait until I have an entire afternoon to make a full fledged generator.
Excellent plugin! Very fast!


Thanks and nice work! This noise stuff sure is fun to play around with. The real credit belongs to the creators of the library though! :)
B
22
S
6
G
10
Posts: 1,036
Reputation: 7,518

Post » Wed Jan 27, 2016 5:01 pm

Nice plugin!
Here is a demo of using this plugin to generate a "random" curve, each point is created by a sprite. This curve might be used in platformer game.
B
108
S
26
G
267
Posts: 4,456
Reputation: 149,747

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 11 guests