We got a challenge from Chris to do with perlin noise, he sent us an code to play around with and to change it and make it different. The first code we had to make white noise look TV static but when we run the code it’s just loads of squares.




4 computer games (or films) that use procedural generation.
Banished – 2014 – Developers – Shining Rock Software

Perlin noise has been used because there’s rain and snow falling, they’ve used perlin noise and turned it into rain and snow and put it over the top of the game.

Here’s a video so you can see: https://www.youtube.com/watch?v=Ls8FBFFjMxk
Rogue Legacy – 2013 – Developers – Cellar Door Games

Perlin noise has been used because there’s rain falling, they’ve used perlin noise and turned it into rain and put it over the top of the game, like an overlay.

Here’s the video so you can go and watch and get an idea: https://www.youtube.com/watch?v=B5jL25HgSIs
Spelunky – 2008 – Developers –Mossmouth

They’ve used perlin noise in this game because in the game there’s a pit of fire and its moving up and down, it looks just like the code below that I done for the wave but with more coding and detailed.

Here’s the video link so you can go and see what the fire pit is like compared to the wave code I done, link: https://www.youtube.com/watch?v=EzfDZePfxJE
Stardew Valley – 2011 – Developers –ConcernedApe

This has perlin noise and has pretty much the same as the other games, this game has an overlay of snow.

Here’s the video so you can go and see the snow, it’s towards the end of the video, link: https://www.youtube.com/watch?v=QYxXCmWCOYU
One of the task was to make like a wave with the perlin noise, the picture below is the wave code which I found from https://processing.org/examples/noisewave.html and we had to change the colours and turn the wave into like white noise where it flickers and this is my result after doing some research and talking to Chris.

Code
float yoff = 0.0; // 2nd dimension of perlin noise
void setup() {
size(640, 360);
}
void draw() {
background(51);
fill(255);
// We are going to draw a polygon out of the wave points
beginShape();
float xoff = 0; // Option #1: 2D Noise
// float xoff = yoff; // Option #2: 1D Noise
// Iterate over horizontal pixels
for (float x = 0; x <= width; x += 10) {
// Calculate a y value according to noise, map to
float y = map(noise(xoff, yoff), 0, 1, 200,300); // Option #1: 2D Noise
// float y = map(noise(xoff), 0, 1, 200,300); // Option #2: 1D Noise
// Set the vertex
vertex(x, y);
// Increment x dimension for noise
xoff += 0.05;
}
// increment y dimension for noise
yoff += 0.01;
vertex(width, height);
vertex(0, height);
endShape(CLOSE);
}
This is my code after changing few parts of the code and this is
what is looks like now.
I saved the code and taken a screen shot of me saving the code. I named the code ‘wave_code’ in my ‘Perlin noise’ folder so I know it’s the code to do with the wave.

Leave a comment