Expert compile mode

From Valve Developer Community
Jump to: navigation, search
Merge-arrows.png
It has been suggested that this article or section be merged into Hammer_Run_Map_Expert. (Discuss)
Icon-broom.png
This article or section needs to be cleaned up to conform to a higher standard of quality.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page
Icon-broom.png
This article or section should be converted to third person to conform to wiki standards.


Expert compile mode is a way of using a GUI front end to execute batch scripted compiles. If you know what that means, you probably should not use this, but batch files instead.

Compile process

Once you understand the basics, you might have a clue.

Hammer setmapparam.gif

First observe how the compile process consists of three programs:

  • vbsp.exe builds the map file
  • vvis.exe calculates which parts of your level need to be rendered when the player is at a certain place (using visleafs )
  • vrad.exe lights your map

Also observe you can use three options (1) for each tool. However, if you click on any of the links of the tools, you'll soon realize there are way more. You can only use them with batch scripts (which are basically a bunch of DOS-commands) or the expert compile mode.

See that "Expert" button in the lower left corner? Why don't you press it? Let's get adventuring.

The dialog

Hammer Run Map Expert.png

You'll see a dialog box like the one above show up. Although at first this may seem pretty difficult, it really isn't.

First, we have some "configurations". This is handy, for instance, when you want multiple setups for compiling: one for fast compiling, one for compiling cs:s maps, one for glview etc. You can add, delete, and rename configurations using the "Edit" button right of the selection box.

Each setup holds a number of commands you can use. Normally, these commands are used to run each compile tool, and perhaps deleting, moving, copying or renaming certain files (e.g. moving the map file to game directory, deleting log files, etc). Use the "New" button to add a command. Use the "Remove" button to remove one, and use the "Move up" and "Move down" buttons to change the sequence in which the commands are run. We don't want to copy the map or run the game before it is made for instance. You can use the checkboxes to the left of each command to skip the commands if you wish.

The command

Typically, a command consists of a "Command" and one or more "Parameters". The command shows which action to perform (you can select them using the "Cmds" button). If you want to run a program that's not directly in that list (the tools and the HL2 executable are already there) select "executable" and a dialog will open to browse to any executable. (You can use, but not select batch file here.) Some actions have a strange syntax, like $bsp_exe: hammer will recognise these commands and replace them with the right directories. $bsp_exe will be replaced with the directory to bsp.exe for instance.

For the real nerds: Any DOS command can be used here.

The parameters tell the programs what to do. For instance, which map to compile, or what options to use. Again, the "Parms" button allows you to select a number of variables hammer knows and replaces. Things like the mapfile, or certain directories can be used here. Between multiple parameters, add a space. Examine the "Default" configuration a bit and the compile tools Wiki entries (see above) so you can learn which parameters can be used. Please note that each compile tool needs the directory of the map file to know what file to compile. This should be logical to you. They also have a "game" parameter, telling them which directories to look in to find the stuff they need (textures, models, etc)

Fiddle around with the options, but make sure you have a backup of whatever you are experimenting with. You don't want your maps to be accidentally deleted.

The last two options are

Ensure file post-exists:

The compilation will halt if the indicated file does not exist after the command ends. This saves you from waiting for later steps executing when an early step had an error (like a leak).

Use Process window

You should always leave this on, but use it in cases where you don't want to know the progress of your map-compiling.

Finally, press "Go!" to run the compile.