home · browse · search · game entities · user directory · message board · IRC | register

October 27, 2006, 4:47 pm PDT
forgot password?

Popular Resources
  • Half-Life 2 Mod FAQ
  • Valve Hammer Editor
  • Hammer 3.5 beta test
  • Half-Life Utilities
  • game data files
  • ZHLT 2.5.3 custom build
  • Half-Life SDK
  • Feedback
    If you've got any feedback, suggestions, or bugs to report regarding the Collective website, go here!

  • Feedback (301)
  • Newsletter
    Enter your email address in the above form to add yourself to the email newsletter list. Click here for more info.

    Hosted Sites
  • Valve ERC
  • Collective
  • TFMapped
  • Spirit of Half-Life
  • Selective Design
  • Pixel Reviews
  • recent articles

    NPC and Item Placement Theory
    17/03/05 11:35pm PST
    Non-Player Character (NPC) and item placement can influence both the gameflow and immersion of a level. This article aims to give some pointers on how to properly place them.
    - Hugh 'Hugh' Lloyd

    Got Props?
    13/03/05 08:32am PST
    A common problem in HL2 mapping is props not showing up in game. This article explains why and offers solutions.
    - Jeff 'Yesukai' Pritchard

    Simulating Randomness
    18/12/04 11:29pm PST
    This article focuses on how to properly simulate random events that should occur at a certain average frequency, or within a certain probability per period of time.
    - Skyler 'Zipster' York

    Adding Single-Player Weapons to Half-Life 2
    15/12/04 06:52pm PST
    Covers the process behind adding weapons to a single-player Half-Life 2 modification.
    - Skyler 'Zipster' York

    Your world in HL2
    06/12/04 12:17am PST
    This article gives tips and advice to anyone wanting to make custom photorealistic textures to be used in Half-Life 2.
    - Oksid

    Hiding in Shadow
    21/08/04 01:11pm PDT
    Describes how to create a function that has monsters disregard you if you are hiding in a certain level of "darkness," which can be set from within map properties.
    - Anders [Wolf] Jenbo (NoBody)

    XSI EXP for Half-Life 2 Tutorial - Camera Control
    23/09/04 12:43am PDT
    A SOFTIMAGE|XSI tutorial explaining all of the camera controls available to you in XSI!
    - Josh Enes

    Bump Mapping in Half-Life
    08/08/04 11:58am PDT
    Details a method of achieving real-time bump mapping in Half-Life, and provides an implementation of the algorithm.
    - Francis 'DeathWish' Woodhouse

    Real-Time "TRON 2.0" Glow For Low-Spec Hardware
    19/06/04 02:06pm PDT
    A sequel to the original "Real-Time 'TRON 2.0' Glow" article, this describes how to implement real-time glow that works on low-spec graphics cards.
    - Francis 'DeathWish' Woodhouse

    Hitboxes and Code
    05/06/04 06:25pm PDT
    How do I make only one part of a monster take damage? Learn about the relationship between model hitboxes and what you can do with them in a characters code.
    - Jonathan 'Teh_Freak' Smith

    Tips For Faster Compiling
    [Mon Nov 25, 2002 / 10:32am PST] TMH - comments (15) comments enabled

    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 mymap
    hlbsp mymap
    hlvis mymap
    hlrad 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. 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:
    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 "Set 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

    Happy mapping.

    If you have any problems / questions / additions to make on this article, please feel free to either email me, 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.
    article created on Wed Nov 20, 2002 / 10:34am PST
    this item has been viewed 5243 times
    [Half-Life / mapping]

    Only registered users can post comments. Have you registered yet?

    user comments

    displaying comments of normal or higher rating


    Jeff 'Yesukai' Pritchard
    Tue Nov 26, 2002 / 08:14pm PST

      Hmm... setting the priority of a thread to higher in winxp... good idea.


    Wed Nov 27, 2002 / 12:56pm PST

      nice article, some good tips there
    i was hoping to see some more commands for batch files, like how to copy the .map file and then the .bsp into your maps directory. i guess that would be left for another article on batch files.


    Wed Nov 27, 2002 / 12:58pm PST

      that is easier than you would think:
    copy mymap.bsp c:\half-l~1\mymod\maps
    comment modified on Wed Nov 27, 2002 / 12:59pm PST


    Jesse 'EsBe' Kipp
    Wed Nov 27, 2002 / 04:35pm PST

      Any DOS command is valid... right? I believe that scripting is too, but that's kind of... erm... well, that would be content for another article.


    Wed Nov 27, 2002 / 06:12pm PST

      Nice article, however...

    You went WAY off-topic. It's supposed to be about tips for faster compiling, however you go into a lot of other, general compiling stuff as well. Stuff like -full, -estimate, and -extra make the comipile go SLOWER, not faster. Plus, you covered a lot of ground that I already covered in my Compiling 101 tut (Pejalo, I discuss all of that stuff there).

    And I didn't know that you could run vis and rad off of the .bsp. I just always ran them off the .map file. Come to think of it, though, that shouldn't work, yet it does. Why?


    Thu Nov 28, 2002 / 02:14am PST

      esbe: I don't pretend to know everything about DOS. There should be some reference guides floating around the net, I'll see if I can post a link to one or two of them here. But, yes, any command you could use in DOS will work in a batch file.

    arch: I was actually trying to show the trade-off between stuff that makes the compile go slower, but makes it look better. And if you're running in full processer priority mode, unless you're compiling on a 486 or something, you can do almost any map in a night.


    Steve Roberts
    Thu Nov 28, 2002 / 10:01am PST

      I've read the article a couple of times incase I missed it, but, I don't think you put in how to actually RUN the bat file.
    comment modified on Thu Nov 28, 2002 / 10:02am PST


    Chris 'autolycus' Bokitch
    Thu Nov 28, 2002 / 12:51pm PST

      A batch file can be run several ways:

    • it can be clicked on and run like a normal program
    • a map file can be dragged onto it -- in this case, the map file would be passed to the batch file as a parameter. it would be referenced in the batch file with the %1 variable.
    • it can be run from a command prompt -- in this case, variables can be passed to it by including them as parameters

    Batch files are most versatile when you run them from a command prompt. This allows you to specify whichever parameters you want. Each parameter is refered to with a % variable. For example, in the following line...

      compile mymap fast

    compile is the batch file
    mymap is the first parameter, referenced by %1
    fast is the second parameter, referenced by %2

    There is plenty of information available on the net about working with batch files.


    Sun Dec 01, 2002 / 03:02am PST

    You can also set the priority settings in the same way I explained above (the XP method), but also in Windows 2000 and Windows NT.


    Sun Dec 01, 2002 / 08:00am PST

      Note that i prefer running winxp in normal mode for compiling. When you're about to run your compile, do ctrl-alt-delete and close down everything except for system processes. In the first line of your batch file, put a PAUSE command. Then launch your compile batch file. In the ctrl-alt-delete dialog, now close explorer.exe. This effectively closes the windows xp frontend, thereby freeing up about 90% of your computers power ;). DO NOT CLOSE THE CTRL-ALT-DELETE DIALOG. highlight your batch file and 'press any key to continue'. Then when the compile is finished, go to Applications>new task. Type in explorer and windows will re-launch.
    This pretty much gives you the same amount of power as running in safe mode, and you don't have to restart the computer to get decent resolution or colours.


    Sun Dec 01, 2002 / 08:53am PST

    Don't close anything connected with the RPC components of win XP. It will give you a minute to close your programs, then it will shut down windows.


    Sun Dec 01, 2002 / 10:16am PST

      What's RPC?


    Mon Dec 02, 2002 / 01:00am PST

      Remote Procedural Call... needed by a LOT of programs, so many in fact that it shuts down windows if it gets killed.

    I still have no idea what it does!! :D


    Sun Dec 29, 2002 / 08:33pm PST

      "What is Remote Procedural Call?"
    It is a method of invoking a procedure on a remote system- microsoft's version of RPC is tied to just about all of wintels processes.
    But if you go into Administrative Tools and click on Services you'll find most of the processes that start up at boot up, from there you can either speed up, slow down, or crash your system...take note to spend a bit of time to know what the hell is going on before you start stopping processes and pay attention to dependencies and you will find your computer running a lot faster!
    To go a bit more in depth on the performance issues and focusing mostly on running a single Process (aka zhlt) at full blast- from what I know there is 4 areas in which program automatic start up at every boot:
    1. Microsoft only software
    2. Third party software
    3. If you can guess it...\Start Menu\Programs\Startup
    4.Administrative Tools\Services
    err, I guess you could also look in config.sys and the autoexe.bat for useless lines...
    did I leave any areas out?
    CTRL+SHIFT+ESCAPE can get you into Taskmanager alot faster than ctrl+alt+del, if your looking to set programs at a higher priority at the touch of a button check this place out:

    hint: More Multitasking
    comment modified on Sun Dec 29, 2002 / 08:37pm PST


    Mon Apr 21, 2003 / 01:41pm PDT

      If you do happen to accidentally close an RPC program, then you can abort the shutdown by hitting windows key and R, typing cmd, then in the DOS box that comes up, type shutdown -a. This stops the shutdown with no ill effects as far as I can see.

    I have the feeling that this will only work if you are logged in as an administrator, however. But that shouldn't be a problem for most people.

    VERC © 2004. All content copyright its respective owner, all rights reserved.
    script execution time: 0.430181026459 seconds