Compiling Your Maps

Overview

There are a variety of ways to compile your map, it is debatable which is the best method, most people seem to favour the "batch file" method, which is basically a .bat file with various commands listed in text. You can also compile using GUI programs or the built in interface that GTKRadiant has.

All 3 methods follow the same methods though, the only reasons people favour batch files is because you can compile slightly quicker because it uses less ram than say using the gtkradiant compiler (as you have gtkradiant running) and you can easily add in command lines.

Batch File Making

My batch file looks like this:

@rem This file will compile a map.
@rem To use, CD to the dir it is in, and type "compile <mapname>" 

@rem Edit the following paths to suit your machine's directories.
@rem Note the use of / slashes, and the lack of trailing / at
@rem the end of pathnames. Quotes must be used if there are
@rem any spaces in the paths.

@set Q3MAP_PATH="C:/Program Files/Return to Castle Wolfenstein/radiant/q3map"
@set QUAKE_PATH="C:/Program Files/Return to Castle Wolfenstein/"
@set MAP_PATH="C:/Program Files/Return to Castle Wolfenstein/main/maps/%1.map"

@rem Edit the following for general options, such as:
@rem -v = verbose, for example)
@rem -threads = # of threads to use

@set GEN_OPTIONS=-v -fs_basepath "C:/Program Files/Return to Castle Wolfenstein" -game wolf

@rem The actual commands:
%Q3MAP_PATH% %GEN_OPTIONS% %MAP_PATH%
%Q3MAP_PATH% -vis -saveprt %GEN_OPTIONS% %MAP_PATH% 
%Q3MAP_PATH% -light -extra -patchshadows %GEN_OPTIONS% %MAP_PATH%

I took it from ydnars file (the maker of q3map) and changed a few things to suit the way I needed to compile. The most important pieces of this are the -fs_basepath which needs to have the place you have rtcw installed without the trailing / at the end, then you need to add -game wolf.

Once you have that, you can see at the bottom it says "the actual commands" all you need to concern yourself with are after the "-vis" and "-light" part, to which you can pop in commands, like -patchshadows which you can see ive added, and you can add -smooth etc.

So recapping, all you need to change is the fs_basepath and add anymore options have may have to the -vis and -light part. The code ive used is for a full compile, so feel free to download it in .bat format here. If you wish to make your own .bat using Windows Notepad, you will have to make sure the "Save as type" drop-down is set to "All files" and that you put ".bat" at the end of the file name.

To actually compile your map, what you need to do is open up command prompt, start > programs > accessories> command prompt, if you are using windows 2000. Its on all versions of windows, It might be called dos prompt on win98 im not sure. Anywho when you turn it on it will have "C:\>" listed and you can type in what you want to do. In this case we want to compile a map. Ive placed our .bat file (called "compile") on my C: drive, this is basically to save me time. All I need to do is type C:\compile.bat nameofmap and it will then go through the compile stages until its finished. If you place your "compile.bat" in another folder, like C:/program files/return to castle wolfenstein/main/compile.bat then you would need to change to that folder then run it (e.g. type cd C:\Program Files\return to castle wolfenstein\main to change to that folder) or type out type full path (C:\program files\return to castle wolfenstein\compile.bat nameofmap) which is quite a chore to write out each time. If you leave on the command prompt note that you can press the up arrow to repeat lines of text you previously wrote.

Its also worth knowing that if you right click your "compile.bat" and click edit, you can edit your file, You can obviously also create shortcuts to both the command prompt and .bat file for ease of use.

Using Radiant to Compile

Its the least efficient way to compile, simply because it uses more ram and will compile maps at a much slower rate. To use radiant to compile whilst you have your map open, select the bsp menu from the toolbar and choose from the available options. The full compile is BSP,-vis-light-extra whilst other compiles are fairly self explanatory such as -vis -fast, which means it does a fast vis rather than a full vis on the entire level, which is basically for testing as it doesnt look too good and is laggier etc., it is much faster than the normal vis so its ideal for testing, but doesnt include proper lighting.

You can add commands like -patchshadows - smooth etc. by clicking on file then "project settings", then if you look down you can see a long white box at the bottom. This is what appears in the bsp menu list, as you can see you can add, change and remove them, if you click add you can add a entire set yourself, if your unsure what to put in the "command" section just look at one of the default ones and what it has in there and then change it for yours.

Wolf Compile

This is a frontend gui program made by Pointy, it has recently been updated (feb 2002) to include more features such as been able to make .pk3 files, add time limits and all sorts. You might find this program useful as an alternative to the batch files, it depends on yourself, try out both to see what you prefer.

Using wolf compile is a simple affair of setting your paths, selecting your map, choosing your options and compiling, the .pk3 generator makes it easy to produce a .pk3 file and it really is a nice little program that many people will find a joy to use.

Q3map

Q3map is essential, its not a compiler program as such, its where everything is stored, the calculations and details etc. It has been updated frequently by ydnar. It is included with GTK Radiant but yndar maintains his own Q3map2 releases.

Problems, Comments, Queries: Forum
Next Tutorial: Manipulating Brushes
Tutorial by eyeronik
Edited by WeblionX