Raw2map - Terrain Conversion

Raw2map is a utility that converts grayscale images into terrain brushes in Quake .map format. This tutorial shows how to make a map from a terrain image made in Paint Shop Pro but it should be easily adapted to other paint programs. This tutorial shows how to save the image in .tga format, but an 8 bit Raw File Format (.raw) image with no header will also work.

You can also try out the raw2map convertor using the sample files "17x17.raw" and "17x17.tga". To do that just skip ahead to Step 4.

If you already know basically how to use raw2map, and just need more information about it's options, skip ahead to the Other Options section.

1. Paint the terrain as an 8 bit monochrome (256 shades of gray) image. Lighter pixels will be higher points on the terrain.

2. Save the image as a .tga file. If you are using Paint Shop Pro, select the Save As option from the File menu, then select "Truevision Targa (*.tga)" in the Save As Type list near the bottom left of the Save As dialog.

3. Do not use compression. If you are using Paint Shop Pro, click on the Options button in the Save As dialog before saving the image. Select 8 bits in the Bit Depth section and Uncompressed in the Compression section. Then click on OK and then Save.

This tutorial assumes that you have saved the image in the same folder as the raw2map convertor, or that you are using one of the sample images in that folder.

4. Open an MS-DOS Prompt or Command Prompt. For example, in Windows 95 or Windows 98 you can usually do this by opening the Start menu, selecting Programs and then clicking on the MS-DOS Prompt option. (Windows NT and 2000 have the "Command Prompt" instead of the MS-DOS Prompt.)
C:\WINDOWS>_ 

5. If the current drive letter in the MS-DOS prompt is not the drive containing the image and the raw2map terrain convertor, type the letter of the drive where the image and the convertor are found, followed by a colon, and press <Enter>.
C:\WINDOWS>d: 

D:\>_ 

6. Use the CD command to change to the directory (folder) where the raw2map convertor and the image to be converted are.
C:\WINDOWS>d: 

D:\>cd raw2map 

D:\raw2map>_ 

7. Type "raw2map" (don't type the quotes), followed by a space and the name of the image you want to convert into a terrain map. Then press <Enter> to run the convertor
C:\WINDOWS>d: 

D:\>cd raw2map 

D:\raw2map>raw2map 17x17.tga
raw2map - raw bitmap to Quake .map terrain convertor 
Copyright (C) 2000  Seth Galbraith
Input  File Name: 17x17.tga
Output File Name: 17x17.map

D:\raw2map>_ 

Other Options - These other options are used by typing a hyphen (dash) and letter followed by a number value or word. An "[int]" is a whole number, a "[float]" is a number which can have a decimal part, and a "[string]" is just a word like a filename.

-w [int]    : image width in pixels (default = 0)

Raw2map does not know the width and height of the image. This is used to tell raw2map how wide the image is. The height is figured out by dividing the number of pixels in the image by the width.

If width is zero (0) - or if you don't specify a width - then raw2map assumes that the image must be square and tries to use the square root of the number of pixels as the width of the image.

-o [string] : output filename

By default, the .map file generated (the "output" file) is named after the image file (the "input" file) except the file type extension - such as ".tga" - is replaced with ".map". This option allows you to choose a different name for your output file.

-h [float]  : horizontal scale (default = 128)

This is the width between each pixel in Quake units. The total width of your generated terrain brushes will be the width of your image in pixels, minus one (because there are only terrain brushes between pixels) multiplied by this value.

-v [float]  : vertical   scale (default = 4)

This is the difference between each gray value in Quake units. For example, the maximum height difference between any two corners of terrain anywhere in the map is 255 times this value.

-x [float]  : X offset (lattitude) (default = 0)

The lower south-west corner of the terrain is placed at the center of the map by default. Use this option to move it East (positive value) or West (negative value.)

-y [float]  : Y offset (longitude) (default = 0)

The lower south-west corner of the terrain is placed at the center of the map by default. Use this option to move it North (positive value) or South (negative value.)

-z [float]  : Z offset (altitude)  (default = 0)

The lower south-west corner of the terrain is placed at the center of the map by default. Use this option to move it Up (positive value) or Down (negative value.)

-f [float]  : height of brush bottoms

By default, the bottom of the terrain brushes generated by raw2map are a little bit below the lowest possible point on the terrain (specifically, one times the vertical scale below the height of a black pixel.) Although it is not often needed, you can use this option to specify a different height for the bottoms of the terrain brushes.

Note: -v and -z restore default brush bottom height, so you must specify the height of the brush bottoms with -f after -v and/or -z if you don't want the default brush bottom height.

-c [float]  : ceiling or sky height

Raw2map generates walls and ceiling brushes so that you can easily use the generated terrain maps. By default the ceiling height is 64 plus the maximum height of the terrain (the height of a white pixel.) You can make the ceiling higher or lower with this option.

Note: -v and -z restore default ceiling height, so you must specify the ceiling height with -c after -v and/or -z if you don't want the default ceiling height.

-t [float]  : wall thickness (default = 64)

Raw2map generates walls and ceiling brushes so that you can easily use the generated terrain maps. By default the walls and ceiling are 64 units thick. You can change the thickness of the walls and ceiling with this option.

If you set the wall and ceiling thickness to zero (0) then raw2map will not generate any wall or ceiling brushes. It will also not generate any hint brushes. Hint brushes are specially textured brushes that can make complex maps like these converted terrain maps easier to compile if you use versions of the QBSP and VIS utilities that support hint brushes.


Copyright © 2001 Seth Galbraith