VERC: Tips For Faster Compiling Last edited 21 years ago2002-11-25 15:32:00 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.

This article was recovered from an archive and needs to be reviewed

  1. The formatting may be incorrect as it was automatically converted to WikiCode from HTML, it needs to be revised and reformatted
  2. Some information may be out of date as it was written before Half-Life was available on Steam
  3. After the article is re-formatted and updated for Steam HL, remove this notice
  4. Please do not remove the archive notice from the bottom of the article.
  5. Some archive articles are no longer useful, or they duplicate information from other tutorials and entity guides. In this case, delete the page after merging any relevant information into other pages. Contact an admin to delete a page.
Here's a quick overview of DOS. If you already know what DOS is, then you dont need to read this frame.

Here's a question you may be asking: What the hell is DOS?
To execute the batch file, double click on the icon. Very few people nowadays in this everchanging world know what DOS or a Batch File is/was. Anyone who used Windows 3.1 will know exactly what a batch file is, because you had to keep going back into it every 5 minutes to change things. You can do wonderful things with a batch file, but it is true, Windows does make things easier with its point and click interface, but DOS is what backs everything in the end, even if you can't see it.

A batch file is a series of commands, one after the other. Like a script if you will (anyone who's had to write PERL before will know what I mean). It processes the commands in the order that they are given to it, and it is even capable of processing logic, and responding to keypresses, if you know the right commands. But we're not going to do anything so complicated now.
I'm assuming that your map's completed (or you're doing a public beta version). It's such a massive map that it's going to take ages to compile.

I'm also assuming that you're prepared to let the computer compile while you do something else (i.e. watch TV, sleep). Therefore you probably won't want to do much with your computer. Let's face it, you can't do much anyway, because the compile tools eat up so much memory.

Writing a batch file

Valve Hammer Editor (and all other versions of Worldcraft) do the equivalent of a batch file when you press the compile button. All it does is copy your .map file to the compile tools directory, run the tools, and then run Half-Life if you told it to.

However, the editor is taking up memory!! So don't use it when you need all the memory you can get. Also, you'll notice that the compile window isn't updated much, if at all. This is because it is not updated as frequently as DOS is, which is another reason to use the beloved batch file. That is why worldcraft appears to crash when this happens.

Using a batch file is beneficial because the compile process isn't using virtual memory. This is why we're trying to free up more real memory. Virtual memory is much slower than real memory, which means that your compile will be a lot slower. Basically, when the compile tools run out of real memory, they use virtual memory. Which is slower, because this memory exists on your hard drive. Which is fast, but no where near the speed of RAM.

Example Batch File

This example assumes that you have got all the necassary compile tools and WADS in the same directory.

Make a batch file called "compile.bat" in any text editor (I recommend EditPlus2), and put this in it:

hlcsg mymaphlbsp mymaphlvis mymaphlrad mymap
That is about as bare bones as a compile.bat can get. If you have any extra options, like -bounce 5 or -wadinclude, you will already know where to put them. I'll write another tutorial on this another day.

HOWEVER... some command lines on some of those applications will make your compile go a lot faster. So I'll explain about these.

Please observe this Very Important Note: These command lines are tried and tested with Merl's latest build of ZHLT. So don't use it with anything else. They are so much better than the ones that Valve made. Download them here (Link: index.php?doc=1034150354-69206000) . These command lines will work with older versions of Zoner's Half-Life tools, but it's a good idea to use the ones that Merl made.

Here are some amazing commands:

The basic ones
hlbsp.exe mapname -leakonly This will do an extremely fast check just to see if your map has any problems with leaks. So if you know you've got a leak, use this to test for one.
hlvis.exe mapname -fast Please, please, for the love of God only use this if you're not doing your final build, otherwise it will make everyone moan. Obviously the -fast tag makes it go faster, but at an expense to the quality of the lighting and visibility determination.
hlvis.exe mapname -full Essentially, this increases the quality of the VIS calculations. This takes a little longer but is worth it. (the ZHLT manual says that the compiles may be up to 30% longer)
hlrad.exe mapname -extra No matter how bad your computer is, you need to run this for final builds of your maps. It doesn't do much for speeding up your compile, infact it will add a few extra seconds onto the end, but your map will look beautiful. Trust me.
<any zhlt compile tool>.exe mapname -estimate This will not slow down your compile at all. It just gives you an estimation on how much time is remaining before your compile finishes. Note that hlbsp will not be affected by -estimate , since it can not display its progress in the first place.

Now, we've got the tools set up, let's move on to the environment in which you can compile.
Important note, in bold and red, just incase you miss it:

DO NOT RUN THIS IN DOS!!!!!!

I know the compile tools run in a DOS BOX, but they require the presence of WINDOWS in order to run!!

Now we've got that sorted out...

The compile environment

This is a very short tip, but it will help you out no end. Restart your computer in safemode (hit F8 when it starts up, (or CTRL on Win XP +)), and select "safe mode" from the menu that appears.

This runs a "bare bones" copy of windows, which has nothing except for windows loaded. This means all of the memory will be dedicated to your compile, windows and nothing else.
Extra bonus tip!!

Changing processor priority!

I recommend using the Windows XP method (later in this article), if you have it, but the built in ZHLT priority changer works just as fine.

Built in method to ZHLT
Running any ZHLT executable with -high on the end will make the compile tools run at a higher CPU level. This means the compile tools are given more access to more of the CPU cycles.

Windows XP users ONLY
Press CTRL-ALT-DEL, which will bring up the task manager. Click on the process tab, and find your process (which should be either named "Compile.bat - hlcsg", or, "HLCSG.EXE"). Either way, right click on it, and a menu will pop up. Click on " S et priority", and then click "Realtime".

Don't expect to be able to use your computer during the compile though. You won't. When you alter CPU priority, you will use so much processing power to compile your map, it will be almost impossible to do anything else on your computer.

For best results...

... compile with both methods if possible.

If your computer is a dinosaur which is so old it takes days to compile a map, or you can't afford to leave your computer compiling, there is another way, brought to you by the VERC..

The Remote Compile System

The remote compile system is your best friend if you have a slow computer. Essentially, all it does is it uploads your map, and runs the compile processes that you specify on it. This will speed up your compile, because it is a fast machine, and does nothing but compile all day, every day.

Click here to go to the RCS site (Link: rcs.valve-erc.com)

Happy mapping.

If you have any problems / questions / additions to make on this article, please feel free to either email me (Link: steve-at-wrenchsoftware.com) , add me to ICQ [98613165], or add me to MSN messenger [the_mad_hacker@hotmail.com]. I'll try and help you with whatever problems you may have.
This article was originally published on the Valve Editing Resource Collective (VERC).
TWHL only archives articles from defunct websites. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.

Comments

You must log in to post a comment. You can login or register a new account.