• Yukkafuzz

The Challenge of Exoterrain

Creating or generating terrain is one of the most common problems in game development. Whether the game is a 2D platformer like Mario, a massive 3D open world like The Witcher, or an infinite universe like EXO: Perl, the player needs a space to walk around in, and for that you need terrain. For many games, designers hand-create all of the spaces the player can explore; in a platformer, this level design makes or breaks the game, so that makes perfect sense. However, as games have gotten more ambitious with the size of the playable area, developers have looked to computer-run algorithms for help quickly creating large swaths of land (or even the insides of buildings and other inorganic spaces).

I would say two main goals exist for terrain generation: realism and variety. It's not too difficult to have a computer generate a fairly realistic infinite desert expanse, but anyone would be quickly bored of their surroundings. There need to be oases, massive dunes and maybe some pyramids to spice things up and keep it interesting. Even better, have the computer choose to end the desert and begin some mountains, and then an ocean after that. However, the fundamental problem is the true processes that govern the shape and appearance of terrain are horrendously complex. Tectonic plates here on Earth have created mountains, and wind and water erode them; the water comes from precipitation, which depends on sunlight evaporating water over the ocean, temperature currents carrying that water vapor over land and eventually accumulating enough to fall from the sky; but it could be snow, hail, or rain, depending on the temperature. All of these pieces, happening over eons, determine the shape of mountains. We can't reliably simulate the resultant shapes, despite all the knowledge we have about it. So how can we possibly create the terrain of other planets realistically?

Of course, we can't. But we can use controlled randomness to create reasonable approximations of the terrain we can find here on Earth, so there's no reason we can't do the same for the virtual exoplanets. That doesn't mean it's easy, though.

Gotta love testing.

Just on Earth, the number of materials you can find yourself walking on is astounding: all the different types of minerals, rocks, clays, grasses, not to mention the human-made ones. But when roaming an exoplanet, there's some expectation to be able to find something totally new, not seen anywhere on Earth. At the same time, it should feel within the realm of possibility somehow. The picture above was just me testing, but it illustrates a point. We, as humans, do not know that there's no planet with vibrant stripes in the terrain, but we immediately discard it as "unrealistic" anyway. Now, I might accept some red/purple terrain like that on the left if it existed on one planet I ever found, because that could be the cool, unusual thing about that planet. But as soon as it appeared again, even one other place, it would almost ruin the fantasy of finding unique places across space. Furthermore, even a planet with that left stripe lime/yellow color combination in some of its terrain would lessen the novelty of the original red/purple planet. However, the terrain on the right I would not say is notable, probably because of the much more muted colors; though, if that exact green/gray appearance was everywhere, it would get dull. This poses a quandary for the developer: provide the possibility of "cool" terrain types, and hopefully with large variety (change something other than color to make it "cool"), but don't have them too often, or it will appear unrealistic. Oh, and don't use the same "not-that-cool" terrain either, because that will seem boring (and unrealistic again, since different planets should have different types of terrain).

A couple of approaches exist here: design all of the material types by hand, and only let the algorithm choose between them. This guarantees that the materials that can be found will be realistic (at least as much as I, as the developer, would like), and that different materials will look significantly different. However, some potential for "unique" is lost, as I would be working with a finite set of materials, so I could not easily guarantee that one be used only on one planet. Instead, an algorithm can generate appearance of the materials, but the designer loses some control over the results. It takes a lot of careful tuning of parameters to get the algorithm to produce mostly reasonable textures, and even more to avoid each one feeling too generic, despite technically being unique.

You can barely distinguish these three algorithm-generated textures.

These three are an extreme example - I've kept a lot of control over the results, to get a mossy appearance - but it's so much that I might as well have just hand-designed one of them. Nothing was gained by using an algorithm.

Changing a couple of settings, random textures from the same algorithm can look quite different.

The color scheme change for these three might be too extreme, but at the same time, the character of the small features is quite similar between all of the them. That character can be changed using a different type of noise algorithm, like below:

Notice the cell-like character of the details, contrasting the previous set.

We can combine these two types in varying amounts, which can change the fundamental character of the texture from one to the next (as below). However, this increases the performance cost of generation, and, perhaps more importantly, it's another place you cede control to the algorithm. I wouldn't want a cell-like texture like the middle one above as grass or moss. But at the same time, perhaps I should not limit the algorithm to producing textures mimicking materials we know about. It might be cool to find this strange, organic-looking terrain.

Combining types of noise algorithms can produce variation in "character" of textures.

The texture/color of the terrain is only one piece, of course. These principles also apply to the larger shape of terrain. Mountains, craters, caves, plateaus, flats and more all could exist on exoplanets, and so could some strange land features we have never seen.

Chaotic terrain like this needs to be limited.

Since I make use of noise in the same way for land shape as I do for texturing that land, you can imagine the many possibilities and the time it takes to consistently produce realistic but variable landscapes as well.


One Knight Studio © 2019