[TIP] Stopping builds on leaks

Discussion in 'Tutorials & Resources' started by henke37, Mar 9, 2012.

  1. henke37

    aa henke37

    Messages:
    1,914
    Positive Ratings:
    448
    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".
     
    • Thanks Thanks x 3
  2. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,869
    Positive Ratings:
    4,896
    Valve Batch Compile Tool cancels the compile on leak automatically, and most of us here use that for major version releases.
     
    • Thanks Thanks x 2
  3. Fr0Z3nR

    aa Fr0Z3nR Creator of blackholes & memes. Destroyer of forums

    Messages:
    6,391
    Positive Ratings:
    4,906
    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.
     
  4. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,568
    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.
     
  5. henke37

    aa henke37

    Messages:
    1,914
    Positive Ratings:
    448
    Of course you shouldn't be doing that. But mistakes do happen.
     
  6. Jeremy

    Jeremy L11: Posh Member

    Messages:
    829
    Positive Ratings:
    251
    I always compile with VVIS and VRAD off before doing a full compile.
     
  7. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,742
    We do?

    Hammer's is fine for me
     
    • Thanks Thanks x 2
  8. Fr0Z3nR

    aa Fr0Z3nR Creator of blackholes & memes. Destroyer of forums

    Messages:
    6,391
    Positive Ratings:
    4,906
    I use VBCT for final or major releases (ie. Beta and final)
     
    • Thanks Thanks x 1
  9. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,869
    Positive Ratings:
    4,896
    Similar. I use hammer for everything, then VBCT for betas.
     
  10. Bloodhound

    Bloodhound L6: Sharp Member

    Messages:
    316
    Positive Ratings:
    239
    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.
     
    • Thanks Thanks x 1
  11. MangyCarface

    aa MangyCarface Mapper

    Messages:
    1,616
    Positive Ratings:
    1,275
    Why all the non-love? Great additional step for the huge majority of us who do use Hammer's compile functions and don't want to rerun after a "test" run
     
  12. Jeremy

    Jeremy L11: Posh Member

    Messages:
    829
    Positive Ratings:
    251
    I personally have no problems with Hammer's compile functions.
     
    Last edited: Mar 12, 2012
  13. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    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.
     
  14. Dr. Spud

    aa Dr. Spud Grossly Incandescent

    Messages:
    879
    Positive Ratings:
    802
    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.
     
  15. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,869
    Positive Ratings:
    4,896
    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.
     
    • Thanks Thanks x 3
  16. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,112
    Positive Ratings:
    6,065
    See the quote in my sig.
     
    • Thanks Thanks x 1
  17. Bloodhound

    Bloodhound L6: Sharp Member

    Messages:
    316
    Positive Ratings:
    239
    I don´t care about a GUI, I care about the console window, that shows me the progress. Because, as I already said, the hammer console isn´t updating.
     
  18. grazr

    aa grazr Old Man Mutant Ninja Turtle

    Messages:
    5,436
    Positive Ratings:
    3,568
    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: Mar 14, 2012
  19. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    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.
     
  20. Fr0Z3nR

    aa Fr0Z3nR Creator of blackholes & memes. Destroyer of forums

    Messages:
    6,391
    Positive Ratings:
    4,906
    It's called crashing and not telling you.