Tutorial: HC Terrain (1/3)

Released! - Discuss progress and updates on the biggest Trespasser level endeavor ever, JPDS - a dark Tres mod by Draco and co.

Moderators: scallenger, JPDS Team

Post Reply
Troodon

Tutorial: HC Terrain (1/3)

Post by Troodon »

This is a brief description of how the terrain for the Hunter Camp Mission Pack was generated from a grayscale bitmap. The method will probably work for any new terrain. The final terrain may differ slightly from what you expect to get from your base bitmap. You may or may not be able to successfully edit the terrain exported from one of the original Trespasser levels (and I mean successfully re-import it in TresEd) with this method.

It's a four-step process. You will need a good raster graphics editor, I have used Photoshop 5.5. But first read Andres' minilev instructions.

1. Choose a base bitmap (BMP) and convert it to grayscale, 8 bit/channel (256 levels of gray). In suggest you pick one that could represent a somewhat smooth terrain, with no obvious edges or abrupt ridges. There are many good examples on the net, try looking for satellite images or terrain maps. As per TresEd requirements, you need a square map of size 128x128, or 256x256, or 512x512... etc. I chose a 256x256 pixel bitmap distributed with the Terrain Engine software.

Image

2. Resize and edit the bitmap. I resized mine to 512x512 using bicubic resampling. Now edit it, if needed; for example, flatten an area for a building, or create accessible/inaccessible sectors, see below. I recommend the edited area be level with at least some of the adjacent regions; for that I selected the region to be edited, I picked a level of gray right outside its border where I wanted to obtain continuity, and I filled the selected area with that level of gray. Next, you need to apply a smoothing filter to the resulting bitmap otherwise it cannot be imported in TresEd without getting those nasty spikes, pits, and ridges. What I used here is not a filter but a piece of software called Height Map Editor that you can get free of charge by doing a Google search on it. Just open your new bitmap in that program and run the Smooth terrain command four times. Four was enough for my base bitmap, you may need to experiment with yours. Save you smoothed terrain bitmap to a file conveniently named <yourlevel>.wtd.bmp.

Image (this image size at 50% of original)

3. Prepare import parameters file. Your new terrain bitmap is ready for import and, as per minilev instructions, you need to write a <yourlevel>.wtd.txt file. Here is what I put in my file:

-256 -256 512 0.342872

The first three parameters will work for a 512x512 bitmap; the forth one is the vertical resize factor and you may need to experiment with values in the 0.2-0.5 range for your bitmap. When importing the new terrain in TresEd you may have to renter them manually in the Terrain Properties dialog. The level size with these params is approximately 500x500 m (250,000 square meters), obviously smaller than an original Trespasser level but perfect for a Mission Pack. :)

4. Import your new terrain in TresEd. I assume you have already renamed Andres' minilev files to <yourlevel>.* so now you can open <yourlevel> in TresEd. Here you need to make sure you will be using the import parameters entered in the .txt parameters file above (in the Terrain Properties dialog below replace: hc.wtd with <yourlevel>.wtd; -512 with -256; 128.000 with 512.000; and the import scale factor with the value that works best for your level). Save your level, the new terrain file is <yourlevel>.wtd.

Image Image

That's it!

You now have a new terrain for your level but it may not be where you expected it to be. Rather than moving the terrain around you can move Anne and the base terrain objects to the new one; the TresEd "Warp" and "Drop to terrain" functions are very useful at this stage. At least for testing purposes you can use a single base terrain object that will cover your entire new terrain, just edit its "Scale" property to 256 or more. I will explain that in more detail, along with a few restrictions I have found on base terrain textures, in another post.

Below are some screenshots of the actual HC terrain (last two are ingame pics).

Image
Image
Image
Image
Image
Last edited by Troodon on Wed Apr 09, 2003 5:46 am, edited 1 time in total.
Christopher
Velociraptor
Velociraptor
Posts: 1325
Joined: Mon Nov 11, 2002 1:07 pm
Location: Canberra, Australia

Post by Christopher »

I think I am going crazy, but that second picture looks kind of poetic. :D Lol.

Great job, keep it up:)
Ah, there's nothing more exciting than science. You get all the fun of sitting still, being quiet, writing down numbers, paying attention... Science has it all." - Principal Skinner.
Troodon

Post by Troodon »

Well Chris, you are right, guess it might be a side effect of the "smoothing" process. ;)
Post Reply