Welcome to the Wolfire Blog! This is where we keep everyone up to date on our progress on Overgrowth and other new stuff. Be sure to subscribe to get the latest news! Also, be sure to check out the forums for even more up to date news - or get on IRC for up to the second updates.

Terrain: Part 1

Add Comment! By Phillip Isola on October 7th, 2008

Hi all,

Welcome to the first tech blog post for Overgrowth (...well the first since it became Overgrowth)! Making Overgrowth technically impressive is a big goal for us. As a small independent team, we can't implement every flashy feature, but we can implement a few core features in innovative ways. So that's what we've decided to focus on: we want to push technology on those few core features we think will be most beneficial to the end gameplay and to the artistry of the game world. One of these core features is terrain. In this post, I'm going to talk about the first stage of our terrain pipeline -- generating height maps. But this is just the beginning. Over the next couple months, we'll post about the rest of the terrain pipeline, including mesh simplification, blending and morphing, texture mapping, close range detailing, and physical interactivity. That, and we have a bunch of tech posts on other topics coming soon as well. :)

Creating virtual landscapes that match the realism and diversity of real world terrain is a difficult problem. Complex geological forces combine with erosion and weathering to give a rich coherency to the natural world. Game designers have often settled for smooth, undulating terrains with all the more interesting geology relegated to the backdrop. Sure, a well crafted set piece cliff may turn up here and there, but fully navigable mountains, canyons, and gorges (not to mention fjords, mesas, faults, craters, rifts, you get the idea) have been attempted less frequently and less successfully.

For Overgrowth we want vast, freely navigable landscapes, just like in Lugaru 1. But to make things more interesting, we want these landscapes to include some of the geological complexities mentioned above. These sorts of landscapes are hard to design from scratch. An artist may be able to adeptly mold a small island, but on a large scale terrain he or she may have trouble maintaining physical coherency, and in any case it will be a time consuming process. While automatic, procedural terrain generators exist in abundance, they tend to give terrain a synthetic feel. For example, fractal landscapes and Perlin noise are great tools, but they often end up producing the same cragged and pocked landscapes time and again. To me, these terrains usually look sort of like the surface of the Moon, or of Mars; they're devoid of the tectonic and erosive forces that dominate Earth landscapes. Physics based tools, such as erosion simulators, can give virtual landscapes more dynamic looks, but these tools still have quite a ways to go before they can match the real world in diversity and realism.

A typical fractal landscape (from the wikipedia page on that subject). This may be a fairly realistic depiction of terrain on some planet, but Im pretty sure that planets not Earth.
A typical fractal landscape (from the Wikipedia page on that subject). It's a fairly realistic depiction of a certain type of terrain, but it appears devoid of tectonics and lacks coherent erosion by wind and water. It's the terraformed Moon perhaps, not quite Earth.

Which brings me to our central realization: If we cannot recreate Earth's splendor, why not just copy it? High resolution Earth height map data (down to around 10 cubic meters per pixel in certain areas) is freely available from a number of sources. For Overgrowth, we are currently using USGS's National Map Seamless Server (http://seamless.usgs.gov). While Earth height maps might be poor choices for a game set in a distinctly alien world, for games set on Earth, or in Earth-like environments, they are an appealing option. Overgrowth is set on a future version of Earth. So, real world height maps are a suitable choice. We're not the first to have explored real world data for game terrains. Flight simulators in particular have make good use of such height maps in the past. Still, immersive terrain from the ground is quite a different thing from bumpy topology from the air; and using real world data for ground based games remains uncommon.

Raw height map of Yosemite Valley from USGS data.
Raw height map of Yosemite Valley from USGS data.

As exciting as the wealth of USGS data was, it quickly became clear that the raw Earth height maps were not enough. We needed some post processing to really refine things. We have several motivations for this: First, we don't want to limit our creativity by strictly sticking to found topology. For example, there will be certain cases in which our level design requires specific features not available in a chosen base terrain. For these cases, we need tools with which artists can easily and realistically make local changes to the height map. Second, we are modeling the future Earth, not the current Earth. We want our landscapes to be unique, and certainly never to appear so familiar that the player feels scooped out of the fantasy world and placed right back in the mundane real world. So, we need a tool to overlay and blend novel variation across whole height maps at once -- adding just a bit of 'alien landscape' fractal noise might give our terrains this otherworldly feel. Lastly, the height resolution of the raw USGS data is too low for smooth terrain. Rendering this data produces a terraced image. We need a tool to blend away this terracing.

A wonderful program called World Machine 2 (www.world-machine.com) provides all these capabilities. With this app, we can create a flowchart of filters that smooth out the terracing and then add back in high frequency details. This effectively morphs the landscape into a version of itself that is both cleaner and more detailed. Also during this step, we can add arbitrary amounts of procedural novelty to distinguish our terrain from the present day topology it's based on. As a last step, as level designers we can use the program's tools to mold specific features we want in the landscape.

Yosemite valley rendered in World Machine after post processing
Yosemite valley rendered in World Machine after post processing

Eventually we plan to include certain height map sculpting tools in the game engine itself. But, regardless of what's in the engine, anyone can freely download USGS height maps and freely download a non-commercial version of World Machine 2. Thus, with a few simple steps (which we will facilitate), players will be able create their own custom maps of, say, a local river gorge or some other favorite topology. And, it will be possible to share these creations online through our modding interface.

One potential drawback of using real world height maps is they could turn out to be constrictive. However, in many ways, I think the opposite may be true. For example, even if procedural terrain generation improves greatly, such automated techniques will still suffer from a central dilemma: the more automaticity, the less user control. Fully user driven controls suffer from the inverse problem: the more user control, the less automaticity, that is, the more time the user has to spend manually tweaking things. An intriguing way around this dilemma would be to provide a manageable level of control over just the most important variables the user wants to control; let the computer automatically take care of the rest. That's sort of what the Earth already provides. There is so much variety on the globe that, given rather stringent guidelines for a level's landscape, one probably has a good chance of finding a patch of the Earth that fits those guidelines precisely. Highly imaginative, alternate reality terrains do pose a problem to this approach, and finding the exact patch of Earth that meets one's whims may be difficult. But, the Earth does at least provide a wonderful database of terrains of choose from, which, because of it's size and breadth, is highly flexible.

A data driven approach has proved very beneficial for us in landscape design. So this has led us to wonder, besides terrain, what other game assets also exist in the real world? Well... they all do! We'll get back you guys about that...

The berkeley hills rendered in our engine. Next up: How we managed to simplify this mesh so that it uses 20% as many polygons as a standard height map.
The Berkeley hills rendered in our engine. Next up: How we managed to simplify this mesh so that it uses less than 5% as many polygons as a standard height map!