DevBlog #46 | Foundry Fridays: Force Of Nature
Author: Rambus,
published 9 months ago,
[h2]Welcome to ‘Foundry Fridays’[/h2]
Hello again! My name is Jason, the art director of Foundry. In this week’s ‘Foundry Fridays’ dev diary, I’m going to talk about how we create natural looking biomes in our fully procedurally generated landscapes.
[h2]First, Let’s Look At The Real World[/h2]
Using the example biome of our forest in Foundry, the first step to creating a natural look in a procedurally generated landscape is to go outside and find yourself a nice little forest to get lost in :) Or at least research online for some pretty forest photography.
[img]https://clan.cloudflare.steamstatic.com/images//38913947/a842157e5901a586bb6c2c12454b7667dbb93f59.jpg[/img]
As you can see, trees and plants are NOT evenly distributed. Dirt paths and clearings from erosion and other natural factors help break up where foliage grows. Plants also have a tendency to group or clump together based on where and how far the wind carries their seeds.
By understanding these basics of what’s observed in nature, we can make some “rules” in our foliage generation system that simulate the natural growth of vegetation in a forest.
[h2]Let’s Make Some Noise![/h2]
A great way to create paths, clearings and clumps of foliage is to use procedurally generated noise for masking out areas where vegetation spawns.
We then use layers to embed different noises within each noise map. With this system, it’s easy to create rules for what types of vegetation should clump and what types of vegetation should always clump close together. The exact placement, scale and rotation of each flower or grass plant is still random within each layer’s noise mask. Combine that with a randomly generated voxel landscape, world generation is unique every time you spawn a new world.
All the while looking natural.
Here is an illustration that demonstrates how using layers of noise maps works to clump vegetation together.
[img]https://clan.cloudflare.steamstatic.com/images//38913947/cb346bfc0df76d058b5d7c8f95389b2471a11dd3.gif[/img]
[h2]Putting It Together, Layer By Layer[/h2]
In the game, we first build up a biome by adding a main terrain type (in this case with the forest we use a grass surface) and break it up with dirt using a noise mask. This creates areas of clearings and paths where foliage will not grow.
We play around with the procedural noise settings until we’re happy with what we’re generating in game.
[img]https://clan.cloudflare.steamstatic.com/images//38913947/36cd99c8038864782ddbcd04d0e6ddef8be089d7.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//38913947/50fc898309a2c77ed1337c5829743535f4ede3ba.jpg[/img]
It’s also worth noting here that we add a very broad overall noise to lighten/darken areas of terrain to help break up the underlying tiling terrain textures when viewed from a distance.
We then add a layer containing trees, large plants and rocks that will only spawn in the grassy textured areas of the landscape voxels.
[img]https://clan.cloudflare.steamstatic.com/images//38913947/06abbe57ad6ede75825a7e1ae84d6a3149f7b53f.jpg[/img]
Within the grassy textured areas, we add another layer with a different noise that creates clumps of grass blades. We can also set a parameter for each vegetation object that determines the likelihood or percentage chance a grass object will spawn per voxel of terrain. Vegetation objects are also randomly rotated, scaled and offset to the voxel they are spawned on to help with more natural clumping.
[img]https://clan.cloudflare.steamstatic.com/images//38913947/b975ac4d41652a2aa245a7c98af78f3a4faeeb2c.jpg[/img]
Then within the grass clumps noise layer, we use a third noise mask to add clumps of flowers.
[img]https://clan.cloudflare.steamstatic.com/images//38913947/0a5b538b2b5a66b102f58e326dc84ffc576ecf0c.jpg[/img]
We can go on and on, but this gives you the basic methodology behind how we generate natural looking, fully procedural worlds!
[img]https://clan.cloudflare.steamstatic.com/images//38913947/1cf4754a2a074284977e0b9ca6ac3cc32052a88f.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//38913947/fd0779af107aba5b5c0f1686b92f1adc1864f9b4.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//38913947/a131b57e99f16022967ead792e973db8ba06ea6f.jpg[/img]
[img]https://clan.cloudflare.steamstatic.com/images//38913947/94207637ae218bd72116ccc2daae30ea7bd00f42.jpg[/img]
[h2]Till Next Time![/h2]
I hope you enjoyed this Foundry Friday. As always, if you have any questions, please hit us up on [url=http://discord.gg/eqvCtNH]Discord[/url].
Thanks for reading!