TFC Level Creation/Configuring Hammer for TFC
Team Fortress Classic maps are designed using Hammer Editors 3.3 through 3.5, and are powered by the GoldSrc Engine, the predecessor to the Source Engine, using the Hammer 4.X series, AKA the Source SDK, to create levels. TFC maps can only be developed and compiled using the GoldSource Engine. This tutorial assumes you have already downloaded some form of the GoldSource Hammer Editor, so finding and installing it will not be covered on this page.
Configuring Hammer for Team Fortress Classic
In order for the Hammer Editor to make maps for TFC, it needs access to certain files and programs, such as compilers, entity files, and so-on. This page will give you a quick run through on how to set everything up, and get on your way to map making.
- Launch the Hammer Editor, and open the Tools menubar at the top of screen, and click on Options at the bottom of the bar. The In-Game Configurations console will open, where you can set new configuration settings.
Game Configurations
- In the Configurations Console click on the tab labeled Game Configurations and complete the following steps.
Configuration:
Hammer allows you to setup multiple configurations, so if you want to make maps for more than one GoldSource game, you can make maps for each on the same editor. This section allows you to add, remove, or edit different configurations. We're going to add a new one, and name it TFC (it doesn't matter what you name it, as long as it helps you remember which game configuration it is). To create a new configuration first click the Edit button, this will open a dialog box with the options to Add, Remove, or Copy a Game Configuration, we're going to Add one, and name it TFC.
Game Data Files:
The Game Data files are the FGD files you want to use to build your map. An FGD file provides the entities for use in your editor, each game has it's own FGD. We're going to use the Team Fortress Classic FGD file, which if you're using the Half-Life SDK variant of Hammer available on Steam, is located in C:/ProgramFiles(X86)/Steam/SteamApps/Common/Half-Life SDK/Hammer Editor/fgd/team fortress classic/tf15f.fgd. If you're using another version, then you'll have to manually download the FGD file somewhere off the internet. To add the FGD, click Add, and locate the file on your computer. You can use multiple FGD files in a single configuration, just know that many entities(primarily NPCs) won't appear in a game other than the one they're from, so any NPCs from Half-Life will not appear in a TFC map, and vice versa.
Game Executable Directory:
The Game Executable Directy is where the game executable(playable game file) is located, not the executable itself. The exe directory for Team Fortress Classic is C:/ProgramFiles(X86)/Steam/Steamapps/Common/Half-Life.
- Alternatively, TFC and other Half-Life mods can be configured and run using Steam itself. If you'd like to use Steam for launching TFC then place this location in the Game Executable Directory instead C:/ProgramFiles(X86)/Steam
Mod Directory:
The Mod Directory is similar to the Game Executable Directory, it's the directory location for a Half-Life modification, such as Team Fortress Classic, or Counter-Strike, and is located inside the Half-Life file location listed earlier. Because Team Fortress Classic is a modification of Half-Life, you'll have to insert this location into the Mod Directy field C:\Program Files (x86)\Steam\steamapps\common\Half-Life\tfc
Game Directory:
(This may not be completely accurate, so if i'm wrong please correct this, if i'm right, then just delete this message and let me know in your edit summary) The Game Directory is the location of the game's files, such as models, animations, textures, etc. For TFC, this is located at C:/ProgramFiles(X86)/Steam/Steamapps/Common/Half-Life/Valve.
RMF Directory:
This is where Hammer will save your' maps' RMF(compiled map) files every time you compile your' level. All RMF files must be saved in C:/ProgramFiles(X86)/Steam/Steamapps/Common/Half-Life/Valve/maps, this is where the game looks when launching maps.
Build Programs
The Build Programs for your configuration are the files and programs that compile your map, primarily the BSP geometry, lighting, and VisLeafs. Many GoldSource map makers nowadays use Zoner's Half-Life Tools, a fan made modification of the original BSP, VIS, RAD, and CSG build programs developed for Half-Life, if you'd like to use Zoner's tools and don't have them you can download them here(add link later).
- In the Configuration Console, click the tab labeled Build Programs and complete the following steps.
Game executable:
The actual executable file of the game you want to map for, this allows Hammer to run the game whenever you compile your map, allowing you to test your map in the game itself. This field is not mandatory for level creation, but it is highly recommended for quicker and easier map testing. For the Steam version of Team Fortress Classic, this file is located at C:/ProgramFiles(X86)/Steam/Steamapps/Common/Half-Life/hl.exe If you are not using a Steam purchased copy of TFC then this file is located wherever your' TFC files are located.
CSG executable:
CSG generates the map file's brush geometry. If you are using the Half-Life SDK provided by Steam, this file is located at C:\Program Files (x86)\Steam\steamapps\common\Half-Life SDK\Hammer Editor\tools\qcsg.exe. If you are using Zoner's Tools, or any non Steam version of GoldSource, the file is located in whatever file you saved it to.
BSP executable:
The BSP compiler generates raw visleaf data and entities. If you are using the Half-Life SDK provided by Steam, this file is located at Hammer C:\Program Files (x86)\Steam\steamapps\common\Half-Life SDK\Hammer Editor\tools\qbsp2.exe. If you are using Zoner's Tools, or any non Steam version of GoldSource, the file is located in whatever file you saved it to.
VIS executable:
The VIS compiler generates and compiles a map's VisLeaf properties, calculating what are being rendered when the player is in a specific spot to make sure no more resources then needed are used on your computer's processor. If you are using the Half-Life SDK provided by Steam, this file is located at C:\Program Files (x86)\Steam\steamapps\common\Half-Life SDK\Hammer Editor\tools\vis.exe. If you are using Zoner's Tools, or any non Steam version of GoldSource, the file is located in whatever file you saved it to.
RAD executable:
The RAD compiler calculates static radiosity lighting, as well as switchable world lights. Dynamic entity lights are not calculated during this step, but in real time. If you are using the Half-Life SDK provided by Steam, this file is located at C:\Program Files (x86)\Steam\steamapps\common\Half-Life SDK\Hammer Editor\tools\qrad.exe. If you are using Zoner's Tools, or any non Steam version of GoldSource, the file is located in whatever file you saved it to.
Place compiled maps in this directory before running the game:
This step is very similar to the RMF Directory from the Game Configuration settings. Set this location to C:/ProgramFiles(X86)/Steam/Steamapps/Common/Half-Life/Valve/maps.
Textures
Textures are the images used to make your squares and cylinders look like crates and barrels. GoldSource textures are stored inside of large image library files known as WAD3 files. You can insert any WAD files you wish, whether they come from other GoldSource games, the internet, or if you make them yourself. It's highly recommended however that you do not edit any of the default WAD files that come with your game, especially if your game is not a Steam purchased copy.
- In the Configuration Console, click the tab labeled Textures and add the following default TFC WAD files:
<half-life directory>
/valve/halflife.wad<half-life directory>
/valve/liquids.wad<half-life directory>
/valve/xeno.wad<half-life directory>
/valve/decals.wad<half-life directory>
/tfc/tfc.wad<half-life directory>
/tfc/tfc2.wad<half-life directory>
/tfc/ravelin.wad<half-life directory>
/tfc/decals.wad
Saving and Compiling
When you've successfully configured your Hammer Editor to your liking, click OK/Apply, restart Hammer, and test to make sure you've configured Hammer correctly. If you've created more than one configuration, a selection box will pop up every time you start Hammer for you to specify which configuration you want to use in that session. Quickly create a small box in Hammer, go to the Tools menubar at the top of the screen, and click Make Hollow, then click OK. This will hollow out your box, making it a quick makeshift room to place an info_player_start, and a light.
Configuring which game runs after compilation
Once your' level is ready, save it, and click the File menubar at the top of the screen and click on Run from the drop down menu, or press F9 to instantly bring up the Run Map Menu. The Run Map Menu allows you to run your Hammer map in the game it's made for, featuring several features for you to adjust, or turn off when testing your map. The Run Map Menu also allows you to specify the game you want to run and test your map in, to choose which one click on the Expert button at the bottom left of the Run Map Menu to bring up the Advanced Settings. The Advanced Run Map Menu features several additional and more specific settings for compiling your map, we can create custom configurations in the Configurations: drop down menu at the top left of the menu. This Configuarations menu allows you to create custom compilation commands that affect how your map is compiled and run, but all we're concerned with right now is using it to choose which game launches when you run your map. If you use the Half-Life SDK available from Steam, you are automatically given four pre-built configurations, for running the original Half-Life, or it's 3 Steam supported mods and expansions, Half-Life: Opposing Force, Team Fortress Classic, and Counter-Strike, of course you must own the game on Steam for it to launch. If you are using another version of Hammer, you will have to create each configuration yourself, similarly to the way we did earlier.
- To create a new compile configuration for Team Fortress Classic, click Edit next to the Configurations drop down menu and name it Half-Life: Team Fortress (full) (just like before, this name is not important and you can name it whatever you prefer). Once you've named the configuration, click close and the configuration will be saved.
Once you have officially created the configuration, you must create each custom command for your configuration. To create a command you must click the New button below the Configuration drop down menu, you can then enter a command name and a list of parameters for that command in the textboxes to the right. You will have to create a total of 8 different commands to successfully run Team Fortress Classic during compilation.
- Enter each new command with it's parameters as follows into your configuration:
- Command: Change Directory Parameters: $exedir
- Command: $csg_exe Parameters: $path\$file
- Command: $bsp_exe Parameters: $path\$file
- Command: $vis_exe Parameters: $path\$file
- Command: $light_exe Parameters: $path\$file
- Command: Copy File Parameters: $path\$file.bsp $bspdir\$file.bsp
- Command: Copy File Parameters: $path\$file.pts $bspdir\$file.pts
- Command: $game_exe Parameters: +map $file -game tfc -dev -console -toconsole +sv_lan 1
Each command is a checkbox, so you will have to check/select each one before compiling for them to work. Once your' fully configured, click run, and make sure your map compiles correctly.
Running your Map without Hammer
If you are unable to configure Hammer to run your map after compiltion then you can just as easily run your map in the game itself as an alternative. To do this you still have to run your map in the editor, or compile it to a .map or .rmf file (it's recommended that you run your map, because this compiles it to various formats simultaneously). Compiling your map saves your maps' current state into a file readable by the game, compiling your map each time you run it simply keeps it up to date, if you edit your map and then run it without compiling it will run the previous compiled file that is not the same as the maps' current state. To run your map manually in Team Fortress Classic open the Developer Console by pressing the ~, or tilde key on your computer. Once the developer console is opened, type sv_lan 1 and then map into the text field at the bottom, followed by the name of your map (without the filetype extension, such as .map, or .rmf). This will run your map in Team Fortress Classic, completely bypassing the use of Hammer for running your map.