Setting up Hammer: Difference between revisions

From TF2 Classic Wiki
Jump to navigation Jump to search
m (typo)
(update link)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This page will walk you through setting up Hammer for TF2Classic map development.
This page will walk you through setting up Hammer++ with our custom tools for TF2Classic map development.
__TOC__
__TOC__
== Basic setup ==
== Setting up Hammer ==
First, locate your Source SDK Base 2013 Multiplayer folder. Search for it in your Steam library, right-click on it, click "Properties", click "Local files" in the window that appears, then click "Browse". This should open the game's folder, inside of which you should open the "bin" folder. Within this folder is the version of Hammer that we use to create maps for TF2Classic.
Hammer++ is highly recommended. Valve's Hammer will not display materials correctly without using the [https://www.moddb.com/mods/mapbase/downloads/mapbase-multi-tool Mapbase Multi-Tool] to create a shortcut. This section will guide you through installing Hammer++ instead, which does ''not'' require using the Multi-Tool.


Open up Hammer by double-clicking "hammer.exe". From the toolbar at the top, click "Tools" > "Options..."
Go to the [https://ficool2.github.io/HammerPlusPlus-Website/download.html download page for Hammer++], scroll down until you find the "Source SDK 2013 Multiplayer" option and click it. This will download a ZIP file.
 
If you open the ZIP file, you'll find a ''hammerplusplus_2013mpbuildXXXX'' folder, which itself contains a ''bin'' folder. You should merge the ''bin'' folder inside of the ZIP with the ''bin'' folder in your ''Source SDK Base 2013 Multiplayer'' directory that contains hammer.exe. After that's finished, hammerplusplus.exe and hammer.exe should be in the same folder.


In the "Game Configurations" panel, under the "Configuration" section, press ''Edit''. In the window that pops up, press ''Add'', and type in "TF2C".
Open up Hammer++ by double-clicking "hammerplusplus.exe". After it's started, in the main interface, go to '''Tools''' -> '''Options''' -> '''"Game Configurations" tab''' -> Click "Edit" next to the "Configurations" drop-down. Add a new one, titled however you like.  


Select "TF2C" in the Configuration dropdown. You can now set up the options within both the Game Configurations and Build Prorams tabs.
Edit this new configuration to point to the TF2C gamedata (the FGD files in the ''tf2classic'' folder), the game executable directory (your Source SDK Base 2013 Multiplayer folder), and the game directory (your ''tf2classic'' folder, containing GameInfo.txt)


[[File:Hammer configuration.png|frame|center|Example image showcasing what your configuration should look like]]
[[File:Hammer configuration.png|frame|center|Example image showcasing what your configuration should look like]]
------
== Hammer++ ==
Instead of using Valve's Hammer, it's possible to use a community fork that adds new features and bugfixes, and this is often especially preferable for novice creators.
Go to the [https://ficool2.github.io/HammerPlusPlus-Website/download.html download page for Hammer++], scroll down until you find the "Source SDK 2013 Multiplayer" option and click it. This will download a ZIP file.


If you open the ZIP file, you'll find a "hammerplusplus_2013mpbuildXXXX" folder, which itself contains a bin folder. You should merge the bin folder inside of the ZIP with the bin folder in your Source SDK Base 2013 Multiplayer directory that contains hammer.exe. After that's finished, hammerplusplus.exe and hammer.exe should be in the same folder.
== Setting up your compilation tools ==
A custom set of compile tools is required in order to have proper lighting on your maps, due to the default compilers not supporting custom shaders, and relying on DX8 models. We use the Mapbase VBSP and Slammin' VRAD which fix both of these problems, along with many other bugs.


Open up Hammer++ by double-clicking "hammerplusplus.exe". It should remember the setup you did in Valve's Hammer, allowing you to choose TF2C as your configuration upon startup. From this point, you should be able to use it as normal, and take advantage of its featureset.
[https://tf2classic.com/downloads/compilers.zip Download TF2C's custom map compile tools.]
------
== Slammin' Source Map Tools ==
A set of default compilation tools (vbsp, vvis, and vrad) will come with Source SDK Base 2013 Multiplayer, however you can find better performance and prettier lighting by using the "Slammin" Source Map Tools instead.


At time of writing, you can find the latest version of these tools for TF2C at: https://drive.google.com/file/d/1gqmMkHTadUmWBMOqSPSlKRLL1zYvoRsS/view?usp=sharing
Like with Hammer++, this is an archive you'll need to open and extract. The entire contents of the ZIP file you download should be extracted into your bin folder. This will add vbsp_tf2c and vrad_tf2c executable files, alongside the regular vbsp and vrad files.


Like with Hammer++, this is an archive you'll need to open and extract. The entire contents of the 7z file you download should be extracted into your bin folder. This will '''overwrite''' your existing set of compilation tools, including Valve's Hammer (Hammer++ will be fine).
After extraction, you will need to configure Hammer++ to use these tools. In the menu bar, click on "Tools" -> "Options..." -> "Build Programs", and adjust the BSP and RAD executable names to add the _tf2c suffix to the binary names. In the end, the paths should end with vbsp_tf2c.exe and vrad_tf2c.exe.


After extraction, these tools should be used by Hammer/Hammer++ without further configuration. Refer to the thread for more information on which options you can use with these tools: https://knockout.chat/thread/992
=== Configuring VRAD ===
------
When you're ready to compile your map, you need to make sure that the parameters you're passing to VRAD are supported by our custom build. Some, such as -staticproplighting, are now enabled by default and will produce a RAD error if you include them, causing your map to appear fullbright in-game.
== TF2C VRAD ==
A custom version of VRAD is available for TF2C, designed to give a more "old-school" look to the lighting on maps you compile. This version of VRAD is more similar to the one used in TF2 2007, generally being brighter without as dark of shadows. This is mutually exclusive to Slammin's VRAD, you must use one or the other.


To use this, download these two files:
In the "Run Map..."/F9 dialog, you should click the "Expert..." button in the bottom-left corner of the panel to view your configurations, and adjust the parameters for the $light_exe command in the configuration you use for your final compile to be:
-final -hdr -ambientocclusion -aoscale 0.5 -LargeDispSampleRadius -softencosine -worldtextureshadows -game $gamedir $path\$file


[https://cdn.discordapp.com/attachments/729613103419097128/729616705667596298/vrad_tf2c.exe vrad_tf2c.exe]
Meanwhile, for fast compiles when prototyping your map, you can simply use:
-fast -hdr -game $gamedir $path\$file


[https://cdn.discordapp.com/attachments/729613103419097128/729616778623451216/vrad_tf2c_dll.dll vrad_tf2c_dll.dll]
== Troubleshooting ==
=== "Cannot load the static props... encountered a stale map version. Re-vbsp the map." ===
This can happen after upgrading to the newer set of compile tools released in 2.1.2 after previously using the older set. The exact cause hasn't been discovered yet, but it seems to be caching related. Our developers initially had this issue, and then it would randomly fix itself while they were trying to figure it out, and then it would never happen again.


Move them to your "bin" folder, open your Hammer configuration, select TF2C in the dropdown, and in your Build Configurations, set the "RAD executable" to the vrad_tf2c.exe file you extracted. It should then be used on future compiles.
We recommend deleting output files related to your map or tweaking $light_exe parameters. Specifically, this has sometimes been caused by using '-both' in your VRAD flags, which is now obsolete and recommended against. If you're completely unable to solve it, you can also use the [https://drive.google.com/drive/folders/17pQY8wDkednZi0kMZOSpAtNBNmFWm6GJ Slammin' Source Map Tools] to compile your map. These should be equal, with the exception of lacking support for parallax-corrected cubemaps. These will ''overwrite'' the tools provided by the SDK, so you'll need to modify your Hammer++ configuration again to point to vbsp.exe and vrad.exe. You'll also need to delete the "vrad.redirect" file inside the folder.
------
[[Category:Guides]]
[[Category:Guides]]

Latest revision as of 09:38, 26 February 2024

This page will walk you through setting up Hammer++ with our custom tools for TF2Classic map development.

Setting up Hammer

Hammer++ is highly recommended. Valve's Hammer will not display materials correctly without using the Mapbase Multi-Tool to create a shortcut. This section will guide you through installing Hammer++ instead, which does not require using the Multi-Tool.

Go to the download page for Hammer++, scroll down until you find the "Source SDK 2013 Multiplayer" option and click it. This will download a ZIP file.

If you open the ZIP file, you'll find a hammerplusplus_2013mpbuildXXXX folder, which itself contains a bin folder. You should merge the bin folder inside of the ZIP with the bin folder in your Source SDK Base 2013 Multiplayer directory that contains hammer.exe. After that's finished, hammerplusplus.exe and hammer.exe should be in the same folder.

Open up Hammer++ by double-clicking "hammerplusplus.exe". After it's started, in the main interface, go to Tools -> Options -> "Game Configurations" tab -> Click "Edit" next to the "Configurations" drop-down. Add a new one, titled however you like.

Edit this new configuration to point to the TF2C gamedata (the FGD files in the tf2classic folder), the game executable directory (your Source SDK Base 2013 Multiplayer folder), and the game directory (your tf2classic folder, containing GameInfo.txt)

Example image showcasing what your configuration should look like

Setting up your compilation tools

A custom set of compile tools is required in order to have proper lighting on your maps, due to the default compilers not supporting custom shaders, and relying on DX8 models. We use the Mapbase VBSP and Slammin' VRAD which fix both of these problems, along with many other bugs.

Download TF2C's custom map compile tools.

Like with Hammer++, this is an archive you'll need to open and extract. The entire contents of the ZIP file you download should be extracted into your bin folder. This will add vbsp_tf2c and vrad_tf2c executable files, alongside the regular vbsp and vrad files.

After extraction, you will need to configure Hammer++ to use these tools. In the menu bar, click on "Tools" -> "Options..." -> "Build Programs", and adjust the BSP and RAD executable names to add the _tf2c suffix to the binary names. In the end, the paths should end with vbsp_tf2c.exe and vrad_tf2c.exe.

Configuring VRAD

When you're ready to compile your map, you need to make sure that the parameters you're passing to VRAD are supported by our custom build. Some, such as -staticproplighting, are now enabled by default and will produce a RAD error if you include them, causing your map to appear fullbright in-game.

In the "Run Map..."/F9 dialog, you should click the "Expert..." button in the bottom-left corner of the panel to view your configurations, and adjust the parameters for the $light_exe command in the configuration you use for your final compile to be:

-final -hdr -ambientocclusion -aoscale 0.5 -LargeDispSampleRadius -softencosine -worldtextureshadows -game $gamedir $path\$file

Meanwhile, for fast compiles when prototyping your map, you can simply use:

-fast -hdr -game $gamedir $path\$file

Troubleshooting

"Cannot load the static props... encountered a stale map version. Re-vbsp the map."

This can happen after upgrading to the newer set of compile tools released in 2.1.2 after previously using the older set. The exact cause hasn't been discovered yet, but it seems to be caching related. Our developers initially had this issue, and then it would randomly fix itself while they were trying to figure it out, and then it would never happen again.

We recommend deleting output files related to your map or tweaking $light_exe parameters. Specifically, this has sometimes been caused by using '-both' in your VRAD flags, which is now obsolete and recommended against. If you're completely unable to solve it, you can also use the Slammin' Source Map Tools to compile your map. These should be equal, with the exception of lacking support for parallax-corrected cubemaps. These will overwrite the tools provided by the SDK, so you'll need to modify your Hammer++ configuration again to point to vbsp.exe and vrad.exe. You'll also need to delete the "vrad.redirect" file inside the folder.