Grassy Grass
Hello again!
This week I have been working with a LOT of grass (for no particular reason), and so I thought it would be fun to go through some of the details with how we make the Myco-foliage.
Much like the terrain, the grass is built with Modifier Objects. Each of these Objects has an array of Modifier layers that all stack on top of each other to create the final look.
These layers are incredibly multi-faceted, but all of it boils down to is changing the grass’s height, color, and texture based around some procedural noise maps. These noise maps don’t look especially natural on their own, which necessitates a lot of supplementary math to poke and prod it into something that eventually begins to look like a flower patch. The full available options for each layer look like this:
All this for one single layer? Doesn’t this get a bit overwhelming?
Haha yesh :3
The majority of these features were added in order to achieve a specific idea I had while I was working on the grass for the World Update. Height Masking in particular was added for the large pillars and canyons that generate in the Desert so that I could have different types of grass at high elevations.
I don’t want to go into all of these options with incredible depth, but I’ll write a bit about them to give you all a better idea of how they come together into the finished product:
Configuration
Mixing - The two override modes dictate what the modifier actually effects when it comes to the height and the color. Usually these are both set to ‘Mix’ which will do its best to blend them together, but they also have options for multiplying, overriding, and adding onto what’s already there. Effect Empty means it will also apply to spots without any grass, and Artistic Mix is a later addition which uses a different color mixing algorithm that works a bit more like mixing paints as opposed to computer mixed colors.
Noise - This is the most important part of a layer as it’s what will actually create the basic patterns that the grass will grow in. We currently use 4 different types of noise:
Increasing the Octaves means that the noise is sampled multiple times (adjusted by Lacunarity and Persistence, which change the size of the noise on subsequent passes, and how opaque the passes are). Power, Clip, and Remap are used to cut the noise off, and make it have a harder edge. So a layer with very high Clip and very low Power/Remap will create smaller patches with very hard edges and low Clip with high Power/Remap will make large soft sections.
Mask Interaction - One of the later additions were the masks, which define regions that other layers can access. So for example, I can make patches of grass that will set a mask which is then used by a bunch of flowers so that they’ll only grow inside those patches. Layers can also choose to only spawn outside of the mask, as well as create variants of existing maps by multiplying them, adding to them, or subtracting from them.
Height / Color - Yeah.
Type - Probably should’ve just called it ‘Texture.’
Warp - Used for applying some distortion to the original noise sample by using a noise sample of its own. This is incredibly useful for breaking up the patterns and making them look a tad less ‘mathy’ by giving them rougher edges and smearing them around. Here’s some Perlin noise warped by Cellular noise:
Height Masking - Cuts off the layer based on its height in the world, very useful for cliffs and canyons. The cool thing about this is that it can be combined with the other Masking options to create a single Mask that other layers can use to get the same results without my having to copy/paste all the Height Mask options.
Falloff - These options are used to customize how the grass behaves when I need it to be confined to a smaller area. As you may have noticed, a healthy amount of things that spawn in levels have their own types of grass that grow around them (especially the different mushrooms). These props have individual parameters for dictating the size, softness, and warping of the falloff field. This, in turn, necessitates some override options on the layers in order to give me some wiggle room.
Falloff fields are set up like this:
This object is unique since it has two whole modifiers on it, a smaller inner one for the glowing flecks around its base, and a larger one that creates an irradiated sub-biome in the area. The big blue/green indicators are used for gauging how large the areas are, as well as how soft they’ll be, which is set using the ‘Ratio’ slider. As you can see the larger one is set to 0.75, which means the smoothing starts 75% of the way to the edge, while the smaller one starts at 42.5%.
For those who might be curious: the largest single grass modifier is for the Tundra, which has different grass at high altitude, as well as two different biome variants at both altitudes. With a grand total of 44 layers, I present Tundra Moldy Fields:
Apparently I became rather spent towards the end of working on this one, but I am quite happy with the results…
The Dark Ages
To close this off, I should mention that this whole system was completely rebuilt for the new procedural terrain. This new grass runs entirely on the GPU, while the old version was built for the CPU and generates a pre-set file (over the course of several, very slow minutes) that it saves to the game files. Trying to generate these on the fly would’ve made the procedural levels simply not work.
Each of the layers in the old version had multiple noise layers that get mixed together, which was replaced by the Masking system to make it easier to work with. Another point of ease-of-use comes from the UI, as you can see here, I can only see a small area of it at a time which is not so fun. I would personally rather be overwhelmed than underwhelmed by my software, so I am incredibly happy with the improved version.
-Noah
A Moon of a Moon
I’ve been working on X11-B, a new region coming with 1.0 and a moon of New Atlas. Of course, New Atlas is itself a moon, so what do you call a moon’s moon? A moon, apparently. But we’ll call it a moonlet because that sounds better.
Moon shenanigans aside, X11-B is high difficulty area meant for your best builds. Enemies are tankier and deal more damage, and electromagnetic radiation storms periodically sweep across the moonlet, fizzling your abilities.
-Liam