Upcoming SlideShare
×

# Procedural Content Presentation

313 views
190 views

Published on

A presentation giving an overview to club members about the basics of Procedural Content Generation.

Published in: Technology
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
313
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
1
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Procedural Content Presentation

1. 1. PROCEDURAL CONTENT How I learned to stop saying I'm bad at art and love the code
2. 2. PERLIN NOISE Invented by Ken Perlin 1. Noise 2. Interpolation 3. Higher Dimensions!
3. 3. NOISE Is anyone familiar with a random number generator?
4. 4. NOISE USED BY PERLIN A pseudo-random number generator was used, but it was important that each seed would always produce the same "random" number
5. 5. This was done so that wide landscapes, like in DUST, could be moved in and out of memory depending on where you were, but would look the same if you revisited a place you had left. The computer would regenerate that section of the map, but it would look how you remember it looking.
6. 6. This also happens to be the reason seeds are identical on different computers in Minecraft. However, Minecraft uses a tweaked 3D perlin noise to generate the landscape now. If there is interest and time I'll draw how they accomplish this.
7. 7. 2. INTERPOLATION
8. 8. We want smooth terrain, or edges, on any perlin noise use. We do this by interpolating between the points. We don't want jaggies, and in fact a derivative at each point is preferable.
9. 9. COMMON INTERPOLATION FUNCTIONS 3x2+2x3 6x5-15x4+10x3 The second seems more complicated. Why use it? Because it also has a SECOND derivative. That can be useful in some cases.
10. 10. WHAT ABOUT LINEAR INTERPOLATION? Linear: Cubic: Cosine: Why suddenly cosine? It is another non-polynomial interpolation method, that gives pretty good results while also being fast.
11. 11. BEYOND 1D
12. 12. 2D This can also be used, and is common in generating heightmaps. A 2D image is given white through black values, which can be interpreted as higher vs lower ground. Note: This uses blue instead of white, but the same idea still applies
13. 13. EVEN HIGHER DIMENSIONS? 3D Think of a cube with varying densities. This is often used to generate clouds. 4D? This is used to show moving/morphing clouds. The fourth dimention is time. In the same way that slicing through a 3D Perlin field will look in 2D like morphing 2D "clouds", slicing through a 4D Perlin field will look like morphing 3D clouds. 5D?!? Yes. It has been used. I don't have any good examples of it though. Even 6D has applications, but I'm too scared to think about anything above 4D.
14. 14. FRACTALS! If you add up Perlin fields of different frequencies (granularities), you will end up with a fractal image that has both large hills of noise, as well as small bumps. Each level should be weighed less than previous levels so it will converge to zero. We don't want pixel sized bumps contributing as much elevation as a mountain!
15. 15. OTHER PROCEDURAL CONTENT
16. 16. L-SYSTEM Great for plants! This still uses fractals (they're everywhere in nature) but adding randomness makes things look more natural.
17. 17. WHICH LOOKS MORE NATURAL, THE NON-RANDOM OR THE RANDOM?
18. 18. MIDPOINT DISPLACEMENT (DIAMOND-SQUARE)
19. 19. Assign random points to 4 corners of a 2n+1 square. Find the average of two points on a side, make the middle point that plus/minus a small random value to give the terrain variety. Do this for each side of the square. Then average the 4 corners, set middle of the square to that value, plus/minus a random value again. Then do the same procedure to each of the 4 subsquares you just created. Keep doing this until you give every vertex a value.
20. 20. Notice the corners are low. If the water was high enough, this could be an island.
21. 21. APPLICATIONS This approach is pretty good when you are trying to make a procedural island. Perlin noise would not allow you to ensure that the edges are all under water, but if the 4 initial corners are set underwater, you'll generally end up with an island. For noninfinite worlds that still want procedural terrain, this is a good method. However, the downfall is that if you want to add more terrain on, you have to start from scratch. This is actually the technique Dwarf Fortress uses, before it erodes, rains on, floods, and all the other stuff it does before it says your world is finished.
22. 22. HYBRID APPROACHES
23. 23. This is the eye candy section. These games have decided to use many different procedural techniques to make worlds not feasible for an artist to create (i.e. infinite worlds).
24. 24. No Man's Sky
25. 25. No Man's Sky
26. 26. Voxel Farm Demo
27. 27. Voxel Farm Demo