Terrains Explained


To understand terrains in a game development context, we need to look at the characteristics of the terrain we want to model. These characteristics will drive our need for the data that defines the terrain we want to make and therefore will heavily influence how and where we obtain that data.

Terrain Characteristics

A basic unit of terrain is the tile. Essentially a terrain tile is a collection of polygons that form a 3D model that represents the terrain, as depicted in Figure 12.1.

click to expand
Figure 12.1: An untextured terrain tile.

When we model terrain in a game, there are a number of choices we have to make. We need to decide the level of terrain fidelity we want to achieve. Another choice is to figure out the spread of the terrain. Finally, we need to decide what sort of freedom the terrain embodies. Table 12.1 lists characteristics and the ramifications of each of these choices.

Table 12.1: Terrain Characteristics

Characteristic

Description

Fidelity

Terrain fidelity measures how accurately the terrain reflects real topography found somewhere in the world—how realistic it is. The realism can be reflected in both the modeling and the textures. Modeling fidelity can be described as any of the following:

Realistic: Accurate at 1:1 scale in all dimensions with high-resolution textures representing the terrain cover.

Semirealistic: Accurately scaled, usually to a smaller size. Often the vertical scale is 1:1 while the horizontal scales are around 1:2. The game World War II Online by Cornered Rat Software has all of Western Europe modeled in this fashion. The game uses medium-to-low resolution textures to represent ground cover.

Quasi-Realistic: Not accurately scaled in any dimension, but still attempts to represent a real location in the world. Usually employs high-resolution ground cover textures. The scales and textures are chosen to give a sense of the locale that works well in the game environment. NovaLogic's Delta Force series takes this approach.

Unrealistic: Everything else! Unrealistic terrain is most commonly used to specifically enhance game play or the backstory of the game.

Spread

Terrain spread is the degree to which areas of the terrain are unique. Terrain is created in units called tiles. The spread is related to these tiles in one of three ways:

Infinite: A square terrain region is repeated, or tiled, in all cardinal directions, such that when the player leaves a region to the west, he enters a new copy of the same terrain tile from the east. This continues for as long as the player keeps moving in that one direction.

Finite: The terrain tiles are repeated in all directions, but at some point the repetition stops.

Untiled: Terrain tiles are not repeated.

Freedom

Terrain freedom is the measure of how much the player's in-game movements are restricted by the terrain. Terrain freedom is closely coupled with terrain spread. There are really only two degrees of terrain freedom:

Closed: Closed terrain limits player movements in all cardinal directions at some point. With closed terrain, at some point after a player has been moving in a particular direction, he cannot continue that way, either because there is a virtual physical barrier or because the program prevents further movement. In any case, the terrain is usually modeled beyond the barrier only as far as the player can see. After that—nothing.

Open: Open terrain allows player movement in any direction for as long as the player wants. Some games will warp the player to the "other side" of the world, where he will keep crossing terrain tile copies until he returns to the place he started.

There are practical considerations that direct our terrain design choices. Many game engines simply aren't capable of handling the distances involved in large-scale terrains or the number of objects required to appropriately populate them. Some game genres aren't suited to open terrains—the player needs to be confined in order to advance the game story as required.

Terrain Data

When you want to create a high-fidelity terrain model of a real place in the world, you are going to need to get the data from somewhere. If the area in question is small enough, you may be able to go out and gather the information yourself if you're handy with a theodolite (a surveyor's tool). You might be able to glean the necessary information from topographic maps. In either case there is a lot of work involved in the data gathering phase alone. You will need accurate distance measurements and altitudes, as well as photos of the ground cover.

But don't despair! There are sources for high-resolution terrain information available on the Internet. If you go to http://edcwww.cr.usgs.gov, the Web portal for the United States Geological Survey (USGS; part of the U.S. government), you can find a wealth of terrain data.

The data is available in several forms, but the standard form is the DEM (Digital Elevation Model). DEM-formatted data files have the .dem file extension. Another format in use is the DTM (Digital Terrain Model), which uses the .dtm file extension. Finally, a powerful and complex format called SDTS (Spatial Data Transfer Standard) also exists but is not in wide use outside of scientific niches. SDTS files are denoted by the .ddf file extension.

In any event, the ground cover information is not included in these various model formats, so you'll need to gather that as well. Again, the USGS comes in handy with its satellite imagery—some of it taken down to a resolution of less than a meter per image pixel.

DEM files provide elevation information for specific coordinates of places on Earth. DEM files can be converted to a format used by game engines called a height map. We won't go into detail about how to use DEM data for your game, but you can use several of the resources listed in the appendixes to locate the data and tools needed.




3D Game Programming All in One
3D Game Programming All in One (Course Technology PTR Game Development Series)
ISBN: 159200136X
EAN: 2147483647
Year: 2006
Pages: 197

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net