This article will guide you on how to set up your map making environment with TrenchBroom.
Introduction
This is a comprehensive guide on how to setup TrenchBroom for TFC mapping, with some additional tips that beginners may find useful.
What this guide isn’t:
This guide will NOT show you how to make your own maps, as that is a whole different can of worms and would take a long time to explain.
Tools and Scafolding
TrenchBroom[trenchbroom.github.io]
Linux users should avoid the Flatpak Version as it’s a few years out of date and you will most likely run into issues with the map compilers due to them being built using a newer version of GCC. If it isn’t in your Distribution’s repositories or you don’t use a Debian-based distribution,
you should compile it from source.[github.com]
VHLT(Compiler)[github.com]
You can use whatever compilers you want, but this guide assumes you use VHLT; Linux users will have to compile from source. To do so, open the terminal, cd to ./VHLT-V3/src/zhlt-vluzacn/ and run make. The compiled binaries will be found in ./VHLT-V3/src/zhlt-vluzacn/bin/
Scaffolding (Directory/Folder Setup)
You’ll probably find 20 different directory structures that you can use, however I find that this works best for me and this guide assumes that you’re using it too. It also allows for you to easily add additional games like Half-Life or Counter Strike.
├── Compilers/
│ ├── hlbsp
│ ├── hlcsg
│ ├── hlrad
│ └── hlvis
├── FGDs/
│ ├── tfc.fgd
│ └── zhlt.fgd
└── Maps/
├── TFC/
│ ├── Compiled/
│ └── Working/
└── WADs/
└── TFC/
├── Custom/
└── Official/
├── halflife.wad
├── liquids.wad
├── ravelin.wad
├── tfc.wad
├── tfc2.wad
├── xeno.wad
└── zhlt.wad
Configuring TrenchBroom
Launch TrencBroom and click New Map. When prompted select Half-Life from the games list. Next click Open Preferences and set the game path for Half-Life to where it’s installed on your computer. Finally go to the View tab and set the layout to Four Panes.
FGD and WADs
Since TrenchBroom doesn’t support loading multiple FGDs at the same time we’re going to need to do some editing. Open up tfc.fgd in your text editor of choice and add the following to the top of the file
Go back to TrenchBroom, select the entity tab on the left side, and at the very bottom you should see a browse button. Click that and select the edited tfc.fgd.
In the Key/Value section of the Entity tab, you should see something called “wad”, click the empty value box next to it and then the little + button. Now select all of the wads from your WADs/TFC directory. I like to keep the the paths relative to the map file for portability reasons.
Mods
Go back to the Map tab and at the bottom you should see a section called Mods. Find “tfc” in the list and enable it.
Compiling
!!! IMPORTANT !!!
Replace -threads # with the amount of threads you would like to use (Make sure you don’t enter a number higher than your CPU’s total), I always use one less than what my processor has. Replace /path/to/ with the absolute path to said tool or directory Also make sure the map is saved to “./Map-Making/Maps/TFC/Working” or else the compiled maps won’t copy over.
Open up the compile window by going to Run > Compile Map and create the following profiles:
TFC_FULL
Tool Path: /path/to/hlsg
Parameters: ${MAP_BASE_NAME} -threads # -cliptype precise
Run Tool
Tool Path: /path/to/hlbsp
Parameters: ${MAP_BASE_NAME} -threads #
Run Tool
Tool Path: /path/to/hlvis
Parameters: ${MAP_BASE_NAME} -threads # -full
Run tool
Tool Path: /path/to/hlrad
Parameters: ${MAP_BASE_NAME} -threads # -extra
Copy Files
Source File Path: ${MAP_DIR_PATH}/${MAP_BASE_NAME}.bsp
Target Directory Path: /path/to/Map_Making/Maps/TFC/Compiled
Copy Files
Source File Path: ${MAP_DIR_PATH}/${MAP_BASE_NAME}.bsp
Target Directory Path: /path/to/steamapps/common/Half-Life/tfc_addon/maps
Delete Files
File Path: ${MAP_DIR_PATH}/${MAP_BASE_NAME}.bsp
TFC_QUICK
Tool Path: /path/to/hlsg
Parameters: ${MAP_BASE_NAME} -threads # -cliptype precise
Run Tool
Tool Path: /path/to/hlbsp
Parameters: ${MAP_BASE_NAME} -threads #
Run Tool
Tool Path: /path/to/hlvis
Parameters: ${MAP_BASE_NAME} -threads # -fast
Run tool
Tool Path: /path/to/hlrad
Parameters: ${MAP_BASE_NAME} -threads #
Copy Files
Source File Path: ${MAP_DIR_PATH}/${MAP_BASE_NAME}.bsp
Target Directory Path: /path/to/Map_Making/Maps/TFC/Compiled
Copy Files
Source File Path: ${MAP_DIR_PATH}/${MAP_BASE_NAME}.bsp
Target Directory Path: /path/to/steamapps/common/Half-Life/tfc_addon/maps
Delete Files
File Path: ${MAP_DIR_PATH}/${MAP_BASE_NAME}.bsp
These are just the profiles I use, you can choose to make your own. TFC_FULL is for final compiles, and TFC_QUICK is for testing as I’m working on the map.
You can find a full list of commands/flags here[www.zhlt.info]
Git (Optional)
Instead of re-inventing the wheel, I’ll just point to some useful resources made by others.
Install Git[github.com]
Adding locally hosted code to GitHub[docs.github.com]
It’s also worth mentioning that you should create a .gitignore file so you don’t upload anything you shouldn’t. (compilers, WADs, logs, etc.) More information on that can be found here.[git-scm.com]
To get an idea of what one would look like, here’s mine
*.log
*.wa_
*.prt
*.ext
*.wad
autosave/
Compilers/
FGDs/
Official/
Notes
The tfc.fgd doesn’t use too many sprites to begin with, but if you look at the TrenmchBroom console you’ll see a couple missing sprite errors. I have never been able to get them to work even when putting the sprites in the correct location.
Use the null texture!
What this texture does is tell the compiler not to render that face. Essentially you’ll want to use it on every face that the player won’t see. This will greatly improve compile times, performance, and reduce the wpoly count.
Use light_surface instead of info_texlights
While they may seem similar, light_surface provides a whole lot more functionality and generally looks better. It also matches the light colour to the texture colour by default. However just like info_texlights you will have to really crank up the brightness value.
When to use -wadinclude
-wadinclude is a flag for hlcsg, and it essentially compiles the used textures from the specified wad file into the map. This is helpful because you won’t have to distribute a wad file with the map file. However, this should only be done with wad files that you created and not ones that you don’t have permission to distribute; such as the ones created by valve.
A lot of us also use custom textures; so using -wadinclude will prevent us from using said custom textures as the baked-in ones override WADs. So my general rule is only use -wadinclude for textures that you don’t want to be replaced. (Signs, artwork, foliage, etc.)
And that wraps up our share on “TFC Mapping: TrenchBroom Setup Guide”. If you have any additional insights or tips to contribute, don’t hesitate to drop a comment below. For a more in-depth read, you can refer to the original article here by rustbucket, who deserves all the credit. Happy gaming!