[PLUGIN] noisejs

Post your completed addons to share with the community

Post » Fri Jan 29, 2016 12:09 am

@PixelRebirth

It might have a bug while using multiple noisejs objects.
Here is a test case. There are 2 noisejs objects, the seed of each noisejs object are different. But the generating results looks the same.
It seems that there is only 1 seed object in this plugin, so that all noisejs will use the same seed.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Wed Mar 16, 2016 2:32 pm

rexrainbow wrote:@PixelRebirth

It might have a bug while using multiple noisejs objects.
Here is a test case. There are 2 noisejs objects, the seed of each noisejs object are different. But the generating results looks the same.
It seems that there is only 1 seed object in this plugin, so that all noisejs will use the same seed.


Oh, thanks for catching that. Haven't looked in here for a while. Very cool example you posted earlier by the way! :)

The problem seems to be with how dependencies work, which I didn't really consider. :oops:
I think even I can fix it quite easily by handling the runtime a tiny bit differently. Expect a small update very soon!
B
23
S
6
G
10
Posts: 1,041
Reputation: 7,553

Post » Wed Mar 16, 2016 2:45 pm

I had made another behavior of simplex noise. It looks like an irregular sine wave.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Sat Aug 06, 2016 11:34 pm

Hello,

Love this plugin. Still trying to figure out exactly how to implement it, however, there may be a bug (or just that I do not know how to use it). I tried creating two different random perlin seeds, but they both ended up showing the exact same pattern in the exact same place even though I called randomize seed for both perlin noise.

Second question:

I am trying to figure out how to use the "z" portion of simplex3. Currently i have implemented a "for X from 0 to MapX/32" and "for y from 0 to MapY/32" (32 being the size of my tiles I need to spawn). I wanted to try and use the "z" to create various groups...looping through x,y and z on each chunk can be very slow and freezes the screen when spawning objects on the fly so I am not really sure if this is the best way to implement this perlin noise plugin. Ultimately I have 5 different types of resources I want to spawn on a map based on perlin noise. The map is infinite, whenever a person gets close to the border it generates a new section (which usually freezes the screen for half a second). I need these clusters of resources to be side by side without much or any scattering.

I have managed to do this for 1 set of resources, however, creating multiple groups has been a challenge without having any kind of overlap and at a sparse enough distance where the game will be fun.

Hopefully this makes sense. If anyone has any input of how my generation method could be improved or how I could correctly accomplish the above I would appreciate it.

I have also done a lot of reading on perlin noise, must of which goes over top of my head...

Cheers!
B
31
S
16
G
3
Posts: 16
Reputation: 4,009

Post » Sun Aug 07, 2016 12:00 am

@Maydie

I had fixed bug1 in this plugin.

About second question, yes, it will hold the c2 engine if calculate a lot of noise values. One possible solution is - create them in ticks. You might try my eventbalancer.

The other solution is creating another plugin which generate noise values by webworker.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Sun Aug 07, 2016 12:37 am

Thanks for the quick reply! Quite a few great plugs and behaviors, thanks for pointing me at this. I am going to have to modify my code with the new noise plugin before I can ask anymore questions. I will take a look at your eventbalancer as well. Appreciate it.

Cheers!
B
31
S
16
G
3
Posts: 16
Reputation: 4,009

Post » Sun Aug 07, 2016 10:06 pm

@rexrainbow

Ok so I tweaked the code to use the new plugin. Works great.

My only problem now is that I seem to have limited control over the shape of each group of nodes.

Is there another plugin I could use to create a pattern of nodes at x,y location with a max width and max height from the original location? My plan is to use the perlin noise plugin to determine a node location, but then use something else to create a random filled pattern (i.e. no space between sprites which are 32 x 32 px). Currently the best I can get with the noise plugin is an oval of say +-30 spawned sprites in a 3200 x 3200 pixel area (or 100 x 100 grid) due to the scale I have to change the perlin noise to in order to get small groups of sprites. It doesn't lend to an interesting shape and very difficult to control how far about each group of nodes spawn. I am hoping by using a combination of perlin and something else I can create something more interesting to look at (ultimately using three inputs 1. Number of nodes to spawn, 2. Max width from original x,y, 3. Max height from original x,y. I was thinking about using an array to loop through a grid of random width and random height perhaps using "0" for no fill "1" to spawn sprite. The problem I am having is how to ensure everything is filled in the middle.

The end result would be something like (below). Maybe it is not possible to generate something natural looking on the fly without perlin as shown below. Let me know your thoughts. Much appreciated. I realize this may be asking too much, if I can be pointed in the right direction I will do my best to do most of the leg work.


0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Update 1: I found someone talking about using a mask over perlin noise to create a border of "water" or in my case, nothing, around the edge of the perlin noise. Maybe this is the way to go to create patterns of sprites within a specific region.
B
31
S
16
G
3
Posts: 16
Reputation: 4,009

Post » Mon Aug 08, 2016 2:11 am

@Maydie

Here is a demo of random (noise) tiles. source
- arrow key left/right/up to move.


It uses logic mask plugin to display tile sprites in a small area.
B
108
S
26
G
271
Posts: 4,471
Reputation: 151,777

Post » Wed Aug 10, 2016 12:53 am

@rexrainbow

Thanks for the reply!

This actually seems like a really good way to create the nodes I need without a ton of extra scripting and collision checks. I will check it out.

Cheers!
B
31
S
16
G
3
Posts: 16
Reputation: 4,009

Post » Wed Jan 25, 2017 6:18 am

thanks so much, exactly what I needed to randomize my world map with seeds...
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 6 guests