Difference between revisions of "A Simple First Terrain"

From Mod Wiki
(Setting The Terrain)
(Setting The Terrain)
Line 39: Line 39:
  
 
== Setting The Terrain ==
 
== Setting The Terrain ==
[[Image:simpleterrain_terraineditor.png|thumb|400px|The Terrain Editor]]
+
[[Image:simpleterrain_terraineditor.png|thumb|200px|The Terrain Editor]]
 
The mesh must be triangulated before it is exported as an .OBJ, and saved as {{filename|models/terrain/simpleterrain.obj}}. At this stage, a texture is not necessary, and can be set later.
 
The mesh must be triangulated before it is exported as an .OBJ, and saved as {{filename|models/terrain/simpleterrain.obj}}. At this stage, a texture is not necessary, and can be set later.
  
 
Terrains are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}}. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaBuild needs to generate a megatexture.
 
Terrains are set up in the Terrain Editor, accessible via {{accelkey|shift}}{{accelkey|N}}. This tool creates a Surface Tree file ({{filename|.sft}}) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaBuild needs to generate a megatexture.
 +
{{clear}}
  
 +
[[Image:simpleterrain_terraineditor2.png|thumb|200px|Root node set up to use the correct terrain mesh]]
 
To set the mesh to the map, first press 'Begin Editing' at the bottom of the Terrain Editor window. Then {{accelbtn|RMB}} on the left-hand pane and create a new Tree via the menu. This creates a Root node on which all the terrain information resides. Clicking on the Root node allows a model to be specified - set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}. Press {{accelkey|enter}} to confirm and the terrain should appear in the 3D view, with the red placeholder material.
 
To set the mesh to the map, first press 'Begin Editing' at the bottom of the Terrain Editor window. Then {{accelbtn|RMB}} on the left-hand pane and create a new Tree via the menu. This creates a Root node on which all the terrain information resides. Clicking on the Root node allows a model to be specified - set {{keyname|Model}} to the name of the terrain mesh, in this case {{keyvalue|models/terrain/simpleterrain.obj}}. Press {{accelkey|enter}} to confirm and the terrain should appear in the 3D view, with the red placeholder material.
  
 
''You may find the 3D terrain is partly covered or obscured by the base of caulk hull. This can be fixed by moving or resizing the caulk hull so it contains the terrain properly.''
 
''You may find the 3D terrain is partly covered or obscured by the base of caulk hull. This can be fixed by moving or resizing the caulk hull so it contains the terrain properly.''

Revision as of 16:37, 26 November 2007

This is the barebones guide towards creating your first simple terrain and adding it to a map. This terrain won't be as detailed or as attractive as a full terrain, but will demonstrate the basics of creating a terrain mesh, assigning a texture, and adding it in-game.

Introduction

For this tutorial you must:

  • Have a modelling package that can export as OBJ
  • Have basic modelling skills
  • Have basic mapping skills

If you can't do any of the above things, this tutorial is not for you!

This tutorial covers:

  • How to create a terrain mesh and caulk hull
  • How to add a terrain mesh to a map
  • How to assign a texture
  • How to work with terrain meshes and map geometry

This tutorial does not cover:

  • How to use Blender/Maya/Lightwave/ZBrush/Mudbox/3DSMax
  • How to create a megatexture
  • How to create displacement maps
  • Anything complicated

Building the Terrain Mesh

A simple terrain mesh created in Blender

Use your preferred modelling package to create a basic terrain mesh that is exactly 32,768 units long and wide.

It is preferable to keep the terrain as basic as possible, so it can be refined later on during the mapping process. For this reason, the terrain mesh here only contains a very very rough formation of bumps (or 'mountains' as they might be known)

While you can use any dimensions for your terrain mesh - it is strongly advised to stick to 8k*8k, 16*16k or 32k*32k

Creating a Caulk Hull

The caulk hull

Since maps must be leak-free/sealed, maps with terrain must have a caulk hull to ensure this is the case.

In this case, since the terrain is 32768 units long and wide, the caulk hull should also be the same dimensions. The caulk hull is quickly created from a brush 32768 units long, 32768 wide and 16384 units tall, which is then hollowed. The brushes are also assigned the 'editor/noimpactcaulk' texture, which prevents gunshots and projectiles from hitting the surfaces of the hull (they simply disappear instead.)

Setting The Terrain

The Terrain Editor

The mesh must be triangulated before it is exported as an .OBJ, and saved as models/terrain/simpleterrain.obj. At this stage, a texture is not necessary, and can be set later.

Terrains are set up in the Terrain Editor, accessible via shiftN. This tool creates a Surface Tree file (.sft) that contains all the information about the terrain, including roads, stamps, and detail texture information that MegaBuild needs to generate a megatexture.

Root node set up to use the correct terrain mesh

To set the mesh to the map, first press 'Begin Editing' at the bottom of the Terrain Editor window. Then RMB on the left-hand pane and create a new Tree via the menu. This creates a Root node on which all the terrain information resides. Clicking on the Root node allows a model to be specified - set Model to the name of the terrain mesh, in this case models/terrain/simpleterrain.obj. Press enter to confirm and the terrain should appear in the 3D view, with the red placeholder material.

You may find the 3D terrain is partly covered or obscured by the base of caulk hull. This can be fixed by moving or resizing the caulk hull so it contains the terrain properly.