Source SDK

Source SDK

Not enough ratings
How to fix Hammer freezing during compiling.
By Werewolf™
Hammer was made way back in 1995 when we didn't have multicore processors, so by default it tries to use 100% of your CPU. This makes it look like your computer, or at least Hammer, has frozen.

This guide aims to teach you have to fix this.
2
   
Award
Favorite
Favorited
Unfavorite
The Expert Compiler
Hammer was made way back in 1995 when we didn't have multicore processors, so by default it tries to use 100% of your CPU. This makes it look like your computer, or at least Hammer, has frozen.

The way to 'fix' this is to use the expert compiler mode. On the left of the expert window you'll see several checked boxes, and on the right a 'Parameters' window, which has strings of text. This is the one for the '$bsp_exe' command:
-game $gamedir $path\$file

All you need to do is add '-threads X' at the start of the parameter string, replacing that X with an actual number, like this:
-threads 10 -game $gamedir $path\$file

Identifying your CPU and thread count
At this point you'll need to know how many threads your CPU is capable of in order to know what number to put in. If you don't already know, you'll need to find out with a bit of Googling. Open 'My Computer' and look at the Computer properties, it should tell you the name of your CPU. For example, mine is an Intel i7-8700K[ark.intel.com].


Search your CPU make in Google and you'll most likely get the manufacturers website come up as one of the top results. You can use that to find the exact specs for your CPU. So for example, a search of my CPU tells me it has 12 threads.


That means in theory the highest number I can enter in my compiler is 12, which will make it use all 12. This would make it use 100% of my CPU which is the exact issue we're working to avoid, so I would suggest entering a value that is 50-75% of your max thread count. If your CPU has only 4 threads, you'll only want to use 2 or 3. If you have 24 threads, you might want to use 20 of them. I personally set mine to 10 out of 12 (about 83%)
Notes to remember
  • You will need to add the -threads parameter to all 3 of the main compilers; VBSP, VVIS and VRAD. While you could give each a different number, you might as well give all 3 the same number, as they run one after the other so you don't have to worry about 2 of them running at the same time.

  • The fewer threads you use, the longer your compile times will be. A bit like if you had to drive a 100 mile journey, the slow you go the longer it takes, but you do still get there in the end.

  • Altering your threads settings doesn't save you from an unoptimized or badly optimized map. If your map is a buggy mess, this won't help you.

  • You can easily change the number after each compile, so play around with it till you find the right balance for you. As you can see from my example above I use '10' which is 83% of my CPU. For me and my PC, that is enough for me to compile quickly while also having a little spare CPU power to browse the internet while it compiles.

2 Comments
SPRING. # noscope.ro soon 5 Oct, 2021 @ 9:59pm 
Thanks a lot.
K.Saiko 20 Apr, 2021 @ 9:04am 
damn thank you soooo much