[TIP] Stopping builds on leaks

henke37

aa
Sep 23, 2011
2,075
515
Leaks suck, they at best creates a completely unoptimized map and more often than not result in very nasty visual errors.

As such you probably don't even want to bother with vvis, vrad and starting the game if the map leaked. Especially not if you were going to do a time consuming final build.

There is a trick that you can do to stop the build process if the map leaks.

You see, when the map leaks vbsp creates no *.prt file. So if you can detect the lack of this file you can halt compilation. Note that areaportal leaks does not prevent this file from being created and as such can not be detected this way.

Thankfully the advanced version of the run map dialog in Hammer allows you to check if a file has been created or not after each build step. This is perfect for this purpose.

But there is a slight flaw, it can only check for one file, but vbsp is supposed to create two, both the *.bsp and the *.prt file. If you want to check for the existence of both you need to use multiple steps.

What I do is that I add a dummy step that does nothing after vbsp and add in a check for the second file. The dummy step I use is "copy nul nul".
 

Freyja

aa
Jul 31, 2009
2,994
5,813
Valve Batch Compile Tool cancels the compile on leak automatically, and most of us here use that for major version releases.
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
you can also just check for leaks by doing a fast VBSP compile. Turn off VVIS and VRAD, set VBSP to fast, and compile. Super fast leak checker.

This.

If you're not sure your compile will work or if it's an initial compile there's absolutely no reason you need to compile with full VRAD.
 

henke37

aa
Sep 23, 2011
2,075
515
Of course you shouldn't be doing that. But mistakes do happen.
 

Jeremy

L11: Posh Member
Oct 24, 2010
829
299
I always compile with VVIS and VRAD off before doing a full compile.
 

Bloodhound

L6: Sharp Member
Jan 3, 2011
316
489
We do?

Hammer's is fine for me

Yes we do, I knew that you are completely unprofessional! :p

No srsly, I don´t know whats your case. But Hammer don´t show me any progress, it hangs in VBSP and after VRAD the log window is updating again. VBCT is showing me every progress, which is IMO much better.
 

Jeremy

L11: Posh Member
Oct 24, 2010
829
299
I personally have no problems with Hammer's compile functions.
 
Last edited:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
You might want to actually explain how to add the check, or some screenshots of your compile dialog. For someone who has not used expert mode, or has only used it to edit the existing items, this would be rather confusing.
 

Dr. Spud

Grossly Incandescent
aa
Mar 23, 2009
880
854
Yes we do, I knew that you are completely unprofessional! :p

No srsly, I don´t know whats your case. But Hammer don´t show me any progress, it hangs in VBSP and after VRAD the log window is updating again. VBCT is showing me every progress, which is IMO much better.

Hammer's compiler is what the hardcore pro elite use. Nice GUIs are for the weak.

Also I didn't know you could check for created files in expert compile, neat trick.
 

Freyja

aa
Jul 31, 2009
2,994
5,813
Hammer's compiler is what the hardcore pro elite use. Nice GUIs are for the weak.

My apologies. If things that make our lives easier are "weak," I'll take away your electricity, gas, processed food, computer, shower and hot water system, machine-made clothes and furniture.
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
I use Hammer's default compile UI mostly because i can get away with it. Such is the benefit of owning an i7 with hyper threading. That and the fact that i'm not troubled by doing a 30 second test compile after major changes, coupled with the experience of knowing when a compile may or may not have died in its sleep.

Of course this is all kinda nice to know but then the issue isn't that leaks suck because they cause Hammer to hang, because they don't. In fact Hammer has an in built safety which prematurely ends the compile should a leak prevent a successful compile. The problem you're trying to combat is with Hammer crashing/hanging in general, which has very little to do with leaks and more likely to be one of 3 other issues. A) The steam cloud went down (I still have no idea why or how this can interupt an offline process, but it can mess hammer and the SDK up entirely and can only be resolved by restarting steam). B) Your computer had a hickup, more often than not this seems to be memory related. It's often worth restarting your computer to clear your memory if you intend to start some long sessions and do multiple mid-level compiles. C) A bug that doesn't have a fail safe that interrupts the process so that it can be rectified ASAP.
 
Last edited:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
In fact Hammer has an in built safety which prematurely ends the compile should a leak prevent a successful compile.
I'm not really sure what you mean by that... I've never seen any such thing, and have on numerous occasions purposely compiled with a leak (completely unsealed/unskyboxed) early on to check scaling/etc and it goes through and loads in the engine just fine. Leaks are never fatal to a compile.

As for the whole discussion at hand... once past VBSP there is very little need to actually see what the compilers are writing to the console, you'll probably have a decent idea of how long it will take after one compile... and you know the old saying "a watched pot never boils" :p
Not to mention, previously known length is all you have to go on. Nothing in the during-compile output will give an accurate estimate of the time remaining.

If there is a necessity to see what they are saying before it finishes, one can go open up the log file and check it, as that is written to simultaneously with the console window.