Contagion

Contagion

46 ratings
Setting up Contagion SDK's Hammer properly
By Light08⁧⁧ ⭐
The Hammer software from the Contagion SDK isn't configurated properly. Learn how to set your software correctly and how to get hammer to run.
   
Award
Favorite
Favorited
Unfavorite
Introduction
So, you're new to Mapping for Contagion? You want to create some great maps for Contagion? You perhaps even tried to run Hammer but encountered that it's not working properly or doesn't even start?

Congratulation! You did nothing wrong. (Probably)
After the release of the Contagion SDK, which includes Hammer, people already encountered the first problem after trying to start Hammer: It isn't even running. There was no window that was opening. Even after fixing that issue there are some other problems afterwards that makes mapping impossible. But first steps first! I'll explain you why your software isn't working and how you can fix it!
First step: Getting Hammer to run (Fixed, no more necessary)
== Fixed! ==
You no longer have to follow this step since it was fixed. Try running Hammer, if the window is opening you'll want to skip this part. If your window is not opening, you might try to follow that step in order to fix it. But by default it isn't anymore necessary, so just skip this step if Hammer runs.

The first problem that occurs with Hammer is already when you're trying to open it:
It won't open. The problem behind this is that the .exe tries to open the hammer_dll.dll file, but oh wait- It's missing! The devs forgot to add that little file to their release, which results in an .exe that does absolutly nothing.

But don't worry, the devs uploaded their file on their site. You can grab it here:
http://www.contagion-game.com/temp/hammer_dll.rar

Just download that file, unzip the archive and put the inside file 'hammer_dll.dll' into your
'SteamApps\common\ContagionBeta\bin' folder. In case your 'Contagion' folder is called 'Contagion' instead of 'ContagionBeta' - don't worry. It's only called ContagionBeta if it was installed before release.

That's it! Now your software should open correctly. And if not, make sure the .dll file is in your gamefolder's bin folder and don't forget to unzip the archive!
Second step: Adding Contagion's content to your software
Oh well, you just run Hammer and it looks like this?


So, how do get Hammer to look correctly like this?


First, you need to know what's causing that problem. It's simple: It has no content.
Hammer always tries to load all the content from the game you're mapping for, but it seems like Hammer has some issues with loading the content. The problem behind this is that it has no content to load. This Hammer version is set to load all the content that is saved inside the 'models' and 'materials' folder that can be found in your '...\SteamApps\common\Contagion\contagion\' folder.
That's basically how the developer are working with content. But all your Contagion content is saved inside so-called .vpk files that are stored in the same folder. It's a mistake that the developer made, so they'll need to change the directory from these folders to the .vpk files.
Also, you can clearly see all these 'Missing' lines in the Messages-Window.

So, how to get the contents for Hammer?
Either the developer change the directory code of the software or we'll need to do a workaround in the meantime.
First, you'll need a programm that is called 'GCFScape'. You can download it on its website under http://nemesis.thewavelength.net/index.php?p=25.
With that programm we're able to open these .vpk files to extract the content we need.
Install GCFScape. Then go into your '...\SteamApps\common\Contagion\contagion\' folder and you'll see many .vpk files. The only two files we need are called 'materials_dir.vpk' and 'models_dir.vpk'.
Open them with GCFScape and you'll see two folders in both files: 'root>materials' and 'root>models'.

These are the folders we need. Rightclick on these two folders and press on 'Extract'. The programm asks you where to extract these folders. Just do it on your desktop. It will take some time until both folders are completly extracted since they're pretty big in size.
IMPORTANT!!! Make sure you have enough space disk since these files are a few gigabyte big.


Now you should have both folders we need. Now just drag these folders into your '...\SteamApps\common\Contagion\contagion\' folder, where already empty 'materials' & 'models' folders exist. After the process you should have now both folders full of content. And that's it!
Hammer should now correctly recognize the content from Contagion and it will work!
Third step: Configurating Hammer
So, you're trying to compile your map and let Hammer open the map ingame automatically, but the game just won't open?
Two ways to fix it: Either you open the game manually and open your map - or...

you're setting the configs right for Hammer.

It seems like the configurations of Hammer are false. But don't worry, that's an easy and quick fix:

Open your Hammer window and on the top, click on the 'Tools' button and then on 'Options'.
There should now pop up a window called 'Configure Hammer'.

The bottom three bars are set wrong. In fact, they aren't even set at all. But that's an easy fix.
Just add these lines to their related bars:
  • Add under the 'Game Executable Directory (ex. c:\Half-Life):' line this:

    $SteamUserDir\Contagion

  • Add under the 'Game Directory (where GameInfo.txt is, ex: c:\Half-Life\cstrike):' line this:

    $SteamUserDir\Contagion\contagion

  • Add under the 'Hammer VMF Directory (ex. C:\Half-Life\maps):' line this:

    $SteamUserDir\Contagion\contagion\maps


Alright. The first page should be fixed now. Now we need to head over to 'Build Programs' (Top right corner of the window).
And again, all the bars are set wrong. We need to fix these ones too.
Just add these lines to their related bars, just like we did above:
  • Add under the 'Game executable:' line this:

    $SteamUserDir\Contagion\contagion.exe

  • Add under the 'BSP executable:' line this:

    $SteamUserDir\Contagion\bin\vbsp.exe

  • Add under the 'VIS executable:' line this:

    $SteamUserDir\Contagion\bin\vvis.exe

  • Add under the 'RAD executable:' line this:

    $SteamUserDir\Contagion\bin\vrad.exe

  • Add under the last line this:

    $SteamUserDir\Contagion\contagion\maps

    It should now look or almost look like these pictures above.

    IMPORTANT NOTE: In case you installed Contagion before release, your Contagion folder might be called 'ContagionBeta', in this case replace all the '$SteamUserDir\Contagion' lines with '$SteamUserDir\ContagionBeta', just like in my case. That's really important otherwise it won't work! If you are not sure about how your folder is called, just go into your '...\Steam\Steamapps\common\...' folder and check it.

    These are configs that are telling hammer where the game (to open after compile) is, where it should create your .vmf & save your .bsp files and where the .exe files are that are used during the compile-sequence.

    Now your game should open properly after a compile. If not, then your settings are set wrong. Double-check them if you did something wrong!

    And that's it! Congratulations, Hammer should now be completly & correctly set up!
The most frequently issues
This is something that doesn't have to do with configurating Hammer anymore, but since these notes might be important, I'll add them anyway. There are some issues that were reported. Most of them were caused by not properly configurating & following my guide. In this case check if you did everything right!

First of all, in case you're experiencing the problem that Contagion can't find your map:
Some people couldn't open their maps ingame. Please make sure that your compiled .bsp files are stored inside your '...\SteamApps\common\Contagion(/-Beta)\contagion\maps\' folder since this probably might be not the case after porting maps to the new SDK. You probably won't have a 'maps' folder, so just create one and put your maps inside. Now Contagion should find your maps...

You're still seeing missing materials & models?


In case you didn't know:
Contagion is a standalone title that is based on a modified SourceEngine. This means that all the content you see in Contagion are mostly self-made and almost nothing is taken from Half-Life or any other Source title. Though, there are some exceptions like the development-textures that are seen in my map for example. But most content from other Source games won't load, resulting in missing content (See the missing texture in the background of the screenshot?).
This will probably make it harder to import maps from other games like 'Zombie-Panic' or 'No More Room in Hell' since you'll need to replace all the missing contents with these ones from Contagion. Also, it's possible to add content from other games into Contagion. But that's something you'll find in other guides.

Your entire map is lit?
This is something many people encountered. Even after adding light sources into the map, the map ingame might be fully lit. There might be different reasons for it, but I'll tell you the three most common reasons for it:

Having leaks
The most common issue a mapper could do and a map could have. Check your map for Leaks! That's mostly causing issues in maps, so checking for this first is always wise.

Broken game config
This might happen if you open the game via the compiler. It'll start the game but with a different config, which is having all your game settings like resolution & graphic details saved. That's the reason why the resolution might be different from this one you set before. Additionally, it might activate mat_fullbright by default, resulting in every map being fully lit. This setting is deactivated by default since it's only used for special use and not for playing. Two ways to fix it: Either you deactivate it by typing 'mat_fullbright 0' into the console (without '') or you start the game through Steam as usual.

Missing map content
If mat_fullbright is activated, but deactivating it isn't working, resulting into just reseting the value back to '1', than the reason might be because of broken content. If you're using Contagion SDK's Hammer and create a map with invalid content, it will break your map. This might be the result of not properly adding content to Hammer. In this case you did something wrong in the Second step of my guide. Double-check if you did something wrong and the content isn't loaded! You can tell by checking the grids within the 2D camera. Just take a look at my both screenshots above in step two, showing the grid of a broken and a working Hammer.
Enjoy mapping for Contagion!
I hope this guide helped you setting up Hammer correctly.
In case you're still having some issues or questions about mapping for Contagion, just let me know below and I'll try to answer your questions here.

In the meantime, Cheers and enjoy mapping for Contagion!
I can't wait to see all these great maps that are coming for this game. :)

Also, don't forget to check the forum!
64 Comments
Tiniestkuriboh 25 Aug, 2020 @ 9:18pm 
There is an issue with the path for the gameinfo.txt being messed up for some people still.
arbuz 17 May, 2020 @ 5:50am 
Yep they fixed it in the latest update
Light08⁧⁧ ⭐  [author] 15 May, 2020 @ 9:03am 
Actually, now that I think about it. I saw someone else complain about hammer not working. Apparently that's a game update bug and they're gonna fix this sometime this month, just remembered after posting my previous comment.

https://steamhost.cn/steamcommunity_com/app/238430/discussions/6/2270320616975766076/
Light08⁧⁧ ⭐  [author] 15 May, 2020 @ 9:01am 
I'm afraid I'm heavily out of the loop in regards to this game. This guide hasn't been updated in half a decade and I haven't played the game in as long. I've been curious for a long time on how accurate my guide is still holding up and considered updating it at one point. As for your problem, can you check your "Messages" window and tell me what it says, when you boot up hammer?
arbuz 14 May, 2020 @ 11:35pm 
Do you know what should i do, because when i try to file -> new or load, the window shows up, without anything just white, and a sec later hammer crashes
Light08⁧⁧ ⭐  [author] 14 May, 2020 @ 2:36pm 
So the files are no longer present in the base folder of the game? Interesting.
arbuz 14 May, 2020 @ 12:53am 
I found out that .vpk files went to the vpk folder in common/contagion
arbuz 13 May, 2020 @ 4:15am 
Hello, i cant see .vpk files in the contagion folder, pls helf
Rally Cat 24 Jun, 2019 @ 3:22am 
Although his comment may be old for those passing by in the future it may help
Light08⁧⁧ ⭐  [author] 27 May, 2019 @ 6:46pm 
As much as your help is appreciated, you're over a year late. The guy either gave up or probably already found the solution. Heck this guide is extremly old and I'm not even sure if its even helpful anymore since everything might be already fixed. Haven't touched the game in ages.