Terrain Building

The game shattered world has a large terrain that a player can walk around on with towns and other objects on top of the terrain. The following is a discussion on how to create your own terrain.

In Shattered World the terrain is built as a model using Milkshape and loaded into a freeform. The mud client also has a terrainrenderer which is potentially faster for rendering terrains. It has problems where it can be difficult to obtain the exact position of a point on the terrain (due to optimization) causing an object to sink below the terrain. Also a terrain renderer can show popping.

The following discussion is therefore about building a terrain using Milkshape and loading the terrain model into a freeform. The following is a picture of c:\program files\mudclient\client\models\terrain.ms3d loaded into Milkshape:

files/milkshape300.jpg

A way to start building your terrain is to create a 64x64 greyscale bitmap of the terrain based upon your mud map. For example:

files/staticobjectssmall.jpg

becomes:

files/terraingrey.jpg

where white is for the high peaks and black is for the lowest peaks.

You can then load the grey scale bitmap into milkshape's 'terrain generator' in the 'tools' menu and it will generate a terrain for you:

files/terraingrey2.jpg

It is also possible to use SRMT satellite elevation data to get the elevation of a real place (eg Lindos in http://www.rhodes3d.com). You can then use Digital Terrain Mapper to convert it to a grey scale bitmap.

Once you have built your terrain you can then texture it. In Shattered World the terrain has been textured like an actor where different vertices are mapped to different parts of a texture. For example the following terrain texture (from mudclient\client\models\aerial.tga)

files/terrainaerial.jpg

is has terrain vertices mapped as follows in milkshape:

files/terrainmilkshapeeditor.jpg

thus can get smooth transitions from say sea to grass at higher resolutions that if you mapped the terrain 1:1 onto a 1024 x 1024 texture.

files/terrainblend.jpg

Primary Terrain
The mud client uses a primary terrain as the basis for the mud coordinates. The bottom left hand corner of the terrain will become mud coordinates 0,0 and the top left hand corner 359,359 (if Shattered World). A town placed with mud coordinates x=180 y=180 z=0 will be placed in the centre of the terrain sitting at ground level. To specify that a freeform is the primary terrain you set the freeform attribute 'primary' to true.

Oceans
files/seamilkshape.jpg

In Shattered World the ocean is built into the terrain as you can see from the picture above. The mud client determines the parts of the terrain that are ocean from the 'y' value of a quad the makes up the ocean. Thus in Milkshape you will need to set the exact y value of a quad that you use in surfs (or vice versa) so that the surf will roll. Refer to the ocean document for more information.