How does hammer compile maps?

Limpet

Newbie
Joined
Dec 27, 2004
Messages
877
Reaction score
0
Ok well this may not be an expected question, but here goes anyway.

Does anyone know how hammer keeps track of what compiling process its doing and know when to execute the next program? Also how does it keep it all in the same window, the command window.

I ask because Im trying to make a GUI (in VB6, yay) to help compile maps outside of hammer. I've heard there a few such things out on the net, but I want to make one anyway.
 
VB isn't the...fastest language out there. So it would probably run quite slower than hammers if you did make one...

You know quite alot of VB right?
 
He would code the GUI in VB6, the actual compiling programs will run in a ms-dos prompt window wich is quite fast. The advantage of using the programs directly (VBSP, VVIS, VRAD) is that it's much faster than compiling within Hammer. And the advantage of a GUI for those programs is that you can set alot of options really easy without having to type 743 lines in a command window.

Oh, lol I forgot to answer your question Limpet :)
Ok so with the GUI you would save the settings the user would set and you would generate a batch file. Then, you only have to run that batch file and that's where the magic begins. This is how the content of the batch file would look like :

"sourcesdkfolder\bin\vbsp.exe" [options e.g. -verbose] "sourcesdk_content\hl2\mapsrc\themapyouwanttocompile"
"sourcesdkfolder\bin\vvis.exe" [options e.g. -verbose] "sourcesdk_content\hl2\mapsrc\themapyouwanttocompile"
"sourcesdkfolder\bin\vrad.exe" [options e.g. -verbose] "sourcesdk_content\hl2\mapsrc\themapyouwanttocompile"

So each line is read and executed, when it's finished, it will do the next one. Hope this helps. :)
 
First off, yes this is a major dead thread revive, but after a week I posted it nobody had responed so I forgot about it until now.

Anyway, what I had in mind was to have the GUI pass the arguments to the compile programs directly without generating a batch.

So my question could be restated like: How does hammer know when, for instance, the vbsp.exe process has finished and should start the vvis.exe program? Also how does it keep it in one command window?

Right now my program has
"batch" compiling: select all the maps you want and they will be compiled, one after the other until the list is done. (I thought its a good idea for mod developers)
A bunch of checkboxes for the arguemnts
Preset arguments (like fast compiling or glview, stuff like that)
Presets for different games (HL2, HL2DM, CSS, and anymods you'd like to add)

Im working on how I should string the different arguments together and how I can execute a program with that string attached. Also going to make a helpbox for the arguments.

Ti, I might talk to you some later this week ;)
 
Why do you absolutely want to pass the arguments without generating a batch file? I don't think anybody notices I generate batch files in my programs. It's on the hard drive for like 1 second. You generate it, execute, delete. The other possibility would be to use the DoEvents between each commands, I think the program will wait for the last command to finish then do the next one. Besides that, I don't have the answer on how to keep track of windows processes.

The batch file would also answer your second question, how to keep everything in one window. I think it's how Nem's Batch Compiler does it.
 
i dont know much on this topic, but would the map compiling programs, which are called by the batch, give output back to the DOS window?
if so then it would be a good idea to use a batch file and make it pause at the end so that people could see what happened. my programme - HL2 Compile Toolkit has batch files like this, and it provides very useful "feedback data".
 
Yea, there are even alot of switches he can use to output the process in progress, like how much % vvis has done etc. And you can have a summary at the end on how long the entire proccess took etc. You can do alot more stuff with that kinf of GUI than with the default Hammer compilation options (you can manually add switches but it's not really user-friendly).
 
Hmmm, yeah I didn't think about the deleting part and dynamically making a new one. Thats a good idea. Thank you :)
 
is that it? dont we get to see this program, i mean i need it, i made a map that for some reson crashes when i open hammer, EVERYTIME, and i need this map built, it took me 4 weeks of my life. please can we see this program?
 
Back
Top