This tutorial explains what is Batch Compiler and teaches how to use it.
Batch Compiler Tutorial
Hi folks, today I’m going to show you how to install, configure and use a simple program, called BATCH COMPILER. This program I believe will help you substantially during the compile process, which is a tedious task at best. some of the key benefits BATCH COMPILER offers:
- Decreases total compile time;
- Keeps Hammer free to work with you;
- Uses less memory;
- Reduces cpu allocation;
- The ability to automatically add custom stuff in the map file at the end of the compile process (what you have done with Pakrat until now, but without the errors).
Installing and configuring it
O.K., let’s go!
The Batch Compiler requires at least, NET Framework 1.1 or a newer version. If you don’t have it, you have to download and install it before continuing. Download it from:
Once you have installed .NET Framework, we can start with the Batch Compiler: download it from:
http://nemesis.thewavelength.net/files/files/batchcompiler312.exe
Start the installer and follow the simple steps in the wizard.
Once you have installed Batch Compiler, start the program. It should look like this:
Now you may have noticed that there are no controls for compiling your map on the form. This is because Batch Compiler 3.0.0 (and up) works with Batch Compiler Specification (BCS) files. These dynamic configuration files allow you to use the Batch Compiler to compile a Counter-Strike:Source map.
Before we take a look at these specifications, it is a good idea to make sure they are all up to date. To do this, select Check For Updates from the Help menu.
This brings up this dialog box which can be used to update all the official specification files. Clicking Update will do just that. Once the update process is finished you can close this window. It is recommended that you check for updates every so often to be sure you have the latest specifications and tool updates.
We are setting the Batch Compiler up for Source mapping, so make sure you pick one of the specifications that has the word Source in it. To load the specification click it in the Specifications menu. Click on Source Tools Advanced. The program should look like this:
Now that we have the specification open, we need to proceed to set the Batch Compiler up to use it. In the Options menu click the Setup button. This will show this dialog:
In the General tab we can set the opacity of the program window, the .exe file of your preferred text editor and the number of recent files that can be shown in the File menu. Finally we can tell Windows to open .bcp files always with this tool by pressing the BCP Files button. Adjust your settings as you prefer them, this is not a fundamental step.
Now we have to make some internal configuration, in order to tell the Batch Compiler where to find the Source Engine’s main files. To do this click on the Stage Paths tab.
The Stage Paths tab allows you to set the paths to all the tools used in your current specification. To specify the paths for each tool you have to select it from the list, press the browse button (the button with the three dots) and browse to the *.exe file located on your hard drive.
BSP, VIS, RAD, ZIP, BSP Info and GLView, are files that are part of the Source SDK and can be found in the folder:
..\Steam\SteamApps\your steam name\sourcesdk\bin\ep1\bin.
Steam is the main Steam program and it can be found in the folder:
..\Steam
Once you have finished it looks like this:
Once you have finished with your settings in the Stage Paths tab, move over to the Variables tab. The Variables tab allows you to set the paths to various other resources used in your current specification. These paths are set in a similar manner to those of the Stage Paths tab and should be set as follows:
BinRoot: (Source SDK bin directory.) ..\Steam\SteamApps\your steam name\sourcesdk\bin
ValveProject: (GameInfo.txt directory.) ..\Steam\SteamApps\your steam name\counter-strike source\cstrike
Output: (BSP output directory.) ..\Steam\SteamApps\your steam name\counter-strike source\cstrike\maps
When you have done all this stuff, it looks like this:
Once you are happy with your paths click the OK button to return to the Batch Compiler's main screen.
Using It
In Batch Compiler's main screen we can see a set of tabs we call “Stages”. Each of them is responsible for a particular stage of the compiling process. Stages are executed from left to right (when we look at tabs) and up to down (when we look at check-box panel). In the tabs we can set what each stage will do and in the check-box panel we can select if we do or don't want that stage to be executed. On each tab we can see a lot of checkboxes. Every checkbox can turn on and off a particular option for each stage.
BSP Stage is the compiler’s stage responsible to create polygons and to generate the .bsp file from our .vmf file. BSP2 Stage is the same as previous but includes some other options.
VIS Stage is responsible for the optimization of the *.bsp file.
The RAD Stage deals with the creation of lights and shadows.
The Shared Stage handels compile process’s priorities.
The ZIP Stage deals with packaging all the stuff that was generated in one single file. Later I’ll explain how to do this.
BSP Info Stage shows information during the compile process.
The Batch Stage: after the map has been generated, this stage cleans some files and copies the map to your maps folder.
GLView Stage is the stage we can use to generate *.gl files, which are very useful when we optimize a map.
At the end there’s Steam Stage, which launches the map after compilation.
All you have to do is check which option you wish in the stages’ tabs, selecting which stage to run, selecting the *.vmf file and then run the batch! That’s all!
When you press the Run button Batch Compiler will execute each stage you have selected, launching each program in the same command prompt.
At the end of the compile process the program will show the log file. Closing it will close the command prompt and return to main program window.
Now check your map folder: if the compilation process ran correctly, you will find the *.bsp map file.
Adding stuff to maps after compiling
If you have to add some custom files in the .bsp file, we can take advantage from the ZIP Stage. Before starting to compile, we have to make a .lst file in which we write down which files we want to put in the map file and where they are located. I'll show you an example.
Let's say we have a map called csmymap and it is a *.vmf file saved in C:\myfolder\. Start the Batch Compiler, open Specifications menu and select Source Tools Advanced. Then set all the options you want and which stages you want to run. Select C:\myfolder\csmymap.vmf as the source file name. Now save the preset you have just created (pressing the disk button) in the same folder in which we have the *.vmf file, in our case save it in C:\myfolder\ and name it cs_mymap.bsp.
Now we want to add a custom sound (soundname.wav) and the nav file (cs_mymap.nav) in the map file. Make sure that those files are located in the same folder in which we have saved the *.vmf of the map:
C:\myfolder\soundname.wav C:\myfolder\cs_mymap.nav
and suppose we would insert it respectively in
inside the *.bsp file. In this case we have to open a text editor (Notepad will be fine) and write down those lines:/sounds/cs_mymap /maps
sounds/cs_mymap/soundname.wav C:\myfolder\soundname.wav maps/cs_mymap.nav C:\myfolder\cs_mymap.nav
Hit return at the end of last line!
Now we have to save the file in the same folder in which we have the .bcp and the .vmf file and we have to name it reflecting the name of the *.vmf file. If we have a cs_mymap.vmf we have to save it as cs_mymap.lst.
Ok. Now, when we hit run, the map will compile and after that all the files we have included in the *.lst file will be inserted in the map file.









