ID:1454734
 
After making my library Signal (http://www.byond.com/developer/Koil/Signal), I decided that, while Signal offers a lot of useful features, many users only need to generate one or two types of noise for their games.

So I created Signal Lite (http://www.byond.com/developer/Koil/SignalLite). Signal Lite provides you with functions to generate 2D and 3D simplex noise (Perlin noise) and fractal brownian motion (also known as plasma fractals). The library also provides a .DLL for speeding up computation.

Simplex noise


Fractal brownian motion


There is documentation in the library to explain how to generate noise.

The above pictures were drawn using my Canvas library (http://www.byond.com/developer/Koil/Canvas).

The following code was used to generate them:
world
maxx = 8
maxy = 8
view = "8x8"

var
obj/anchor = new(locate(1, 1, 1))
Canvas/canvas = new(anchor, 256, 256)
Noise/noise = new

mob
verb
noise_test()
var
width = 256
height = 256

x_scale = 128
y_scale = 128

value

for(var/px = 1, px <= width, px ++)
for(var/py = 1, py <= height, py ++)
value = noise.noise2(px / x_scale, py / y_scale)
value = noise.scale(value, 0, 255)

canvas.drawPixel(px, py, rgb(value, value, value))

canvas.update()

fbm_test()
var
width = 256
height = 256

x_scale = 128
y_scale = 128

value

for(var/px = 1, px <= width, px ++)
for(var/py = 1, py <= height, py ++)
value = noise.fbm2(px / x_scale, py / y_scale)
value = noise.scale(value, 0, 255)

canvas.drawPixel(px, py, rgb(value, value, value))

canvas.update()


Noise can be used for many different things. It is most commonly used to generate terrain.

Example terrain generated using Signal Lite:

http://files.byondhome.com/Koil/Island.zip is the program I made to generate islands like the above picture. You essentially take the noise you get from my library and treat it as "elevation." For example, you could treat all values less than 0 (the noise functions return values in the range -1 to 1) as water, and all values above 0 as land.

I am terrible at explaining things, but hopefully you can tell by my examples how it all works.

For more information, view:
http://breinygames.blogspot.com/2012/06/ generating-terrain-using-perlin-noise.html
http://en.wikipedia.org/wiki/Simplex_noise
http://en.wikipedia.org/wiki/Perlin_noise
http://en.wikipedia.org/wiki/Fractional_Brownian_motion
http://pcg.wikidot.com/pcg-algorithm:perlin-noise

Do you guys have any other ideas on what noise could be used for?
Neat.
However you could do something with the ocean. It looks like just random noise.

#many sand #much shore #wow
However you could do something with the ocean. It looks like just random noise.

He's using a parameter range to colorize the heightmap.

It's a standard technique where you basically set color ramps to be determined by the value of the heightmap sample.

So yes, the ocean looks like random noise because it's literally just random noise. As long as his output makes sense to the generator, it won't really matter.

He could flatten it by essentially doing something like this:

min(simplex() * fbm(),0.5)

LibNoise and other such libraries often have layering tools that allow you to apply functions to your output in this way.
I didn't mean to flatten it. Maybe it's useless, but I like to generate ocean depth as well and vary its color a bit. Ocean then looks more interesting and worth to explore. Well, it depends on the game you are doing.