Reader small image

You're reading from  Grome Terrain Modeling with Ogre3D, UDK, and Unity3D

Product typeBook
Published inFeb 2013
Reading LevelIntermediate
Publisher
ISBN-139781849699396
Edition1st Edition
Languages
Right arrow
Author (1)
Richard A. Hawley
Richard A. Hawley
author image
Richard A. Hawley

Richard Hawley started programming in the early 1980s at the start of the home computer craze with the Sinclair ZX-81. Before leaving high school he had worked on three game projects for Assassin Software and later worked on conversions of classic strategy board games for 8- to 16-bit machines. He went on to develop end-user tools for popular flight simulations including Empire Interactives Enemy Engaged helicopter series and the highly successful Origin Janes Longbow series (MissioneerPlus). Hes the director of Tricubic Studios, a small UK company dedicated to creating simulation and training environments using off-the-shelf 3D engines including Unity and Leadwerks. Together with technical artist David Hopkinson (Total War: English Civil War conversion) and physics guru Fred Naar (creator of Helicopter Total Realism for Microsoft Flight Simulator X) they are collectively known for their work on helicopter simulations.
Read more about Richard A. Hawley

Right arrow

Describing a world in data


Just like modern games, early games like Ant Attack required data that described in some meaningful way how the landscape was to appear. The eerie city landscape of "Antchester" (shown in the following screenshot) was constructed in memory as a 128 x 128 byte grid, the first 128 bytes defined the upper-left wall, and the 128 byte row below that, and so on. Each of these bytes described the vertical arrangement of blocks in lower six bits, for game logic purposes the upper two bits were used for game sprites.

Heightmaps are common ground

The arrangement of numbers in a grid pattern is still extensively used to represent terrain. We call these grids "maps" and they are popular by virtue of being simple to use and manipulate. A long way from "Antchester", maps can now be measured in megabytes or Gigabytes (around 20GB is needed for the whole earth at 30 meter resolution). Each value in the map represents the height of the terrain at that location.

These kinds of maps are known as heightmaps. However, any information that can be represented in the grid pattern can use maps. Additional maps can be used by 3D engines to tell it how to mix many textures together; this is a common terrain painting technique known as "splatting". Splats describe the amount of blending between texture layers. Another kind of map might be used for lighting, adding light, or shadows to an area of the map. We also find in some engines something called visibility maps which hide parts of the terrain; for example we might want to add holes or caves into a landscape. Coverage maps might be used to represent objects such as grasses, different vegetation layers might have some kind of map the engine uses to draw 3D objects onto the terrain surface. GROME allows us to create and edit all of these kinds of maps and export them, with a little bit of manipulation we can port this information into most game engines. Whatever the technique used by an engine to paint the terrain, height-maps are fairly universal in how they are used to describe topography.

The following is an example of a heightmap loaded into an image viewer. It appears as a gray scale image, the intensity of each pixel represents a height value at that location on the map.

This map represents a 100 square kilometer area of north-west Afghanistan used in a flight simulation.

GROME like many other terrain editing tools uses heightmaps to transport terrain information. Typically importing the heightmap as a gray scale image using common file formats such as TIFF, PNG, or BMP. When it's time to export the terrain project you have similar options to save.

This commonality is the basis of using GROME as a tool for many different engines. There's nothing to stop you from making changes to an exported heightmap using image editing software. The GROME plugin system and SDK permit you to make your own custom exporter for any unsupported formats. So long as we can deal with the material and texture format requirements for our host 3D engine we can integrate GROME into the art pipeline. Well, easier said than done, quite often this is the tricky part which we'll get to at the end of this book.

Previous PageNext Page
You have been reading a chapter from
Grome Terrain Modeling with Ogre3D, UDK, and Unity3D
Published in: Feb 2013Publisher: ISBN-13: 9781849699396
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Richard A. Hawley

Richard Hawley started programming in the early 1980s at the start of the home computer craze with the Sinclair ZX-81. Before leaving high school he had worked on three game projects for Assassin Software and later worked on conversions of classic strategy board games for 8- to 16-bit machines. He went on to develop end-user tools for popular flight simulations including Empire Interactives Enemy Engaged helicopter series and the highly successful Origin Janes Longbow series (MissioneerPlus). Hes the director of Tricubic Studios, a small UK company dedicated to creating simulation and training environments using off-the-shelf 3D engines including Unity and Leadwerks. Together with technical artist David Hopkinson (Total War: English Civil War conversion) and physics guru Fred Naar (creator of Helicopter Total Realism for Microsoft Flight Simulator X) they are collectively known for their work on helicopter simulations.
Read more about Richard A. Hawley