question about compiling

Shadowfield

L2: Junior Member
Aug 14, 2008
59
3
Just out of curiosity, I was wondering what "portal flow" and "building visleafs" in the compile list mean. Those two are what take the longest when compiling, and I was wondering if I could reduce that time.

Also, is there a way to do a fast compile just to run your map to see if it's looking like what you want it to be?

Thanks for your time.
 

TheDarkerSideofYourShadow

L10: Glamorous Member
Apr 12, 2008
792
286
When you compile, if you're doing a normal rather than an expert, there are all of those radio buttons in 3 boxes called Run BSP, Run VIS, and Run RAD. If you just want to get a feel for space, or see if you have a leak, then turn both VIS and RAD off. You'll have no lighting, but you can figure out where things are, etc. If you want a basic idea about lighting, put them both at Fast. It will still take some time, but not nearly as long as Normal.

Another tip. If you want to see only a certain area, use the cordon tool. Its the yellow/black hazard box on the top toolbar. The button to the right of it lets you edit its bounds. What this does is it closes off that section of your map. Ie, no leaks. and you can see what that one particular area looks like.
 

Username

L2: Junior Member
Aug 26, 2008
96
61
I can't go into it very in depth here, so I'll refer you to the excellent article in the SDK wiki here. But basically, to keep from rendering the entire world, even things you can't see, the program vvis cuts up all the open space in your map into various rectangular areas. Each area is called a "visleaf", short for "visibility leaf", and all the visleafs are collected into a "visibility tree". Each leaf knows all the other leaves the player could potentially see while in it, and so the engine only renders those leaves. Without visleafs, games like TF2 would run at the speed of a powerpoint slideshow.

Now, on to why they could take so long. First of all, did you create any irregularly shaped objects, like spheres or cylinders, particularly if they have a large number of faces? Objects like these are the achillies heel of visleaf compilers. If you had an empty room with a 32 sided sphere on a 16 sided column, that room would be cut into hundreds of visleafs. I had 8 of those in my first map lining a walkway, and it still wasn't done compiling after an hour. However, hammer gives you tools to combat this. If you do have a complex or ornate object made out of brushes, they tend not to block visibility at all. Whether you cut it into 100 visleafs according to the faces of the object, or remove it, the engine will still render practically the same number of objects. In this case, it's best to turn all of them into a 'func_detail' brush. Func_details are ignored while building visleafs, and therefore don't impact the compile time almost at all. However, detail brushes can't be used to separate the inside of your map from the outside. If you do make this mistake, you'll cause a leak in your compile.


Hopefully I was able to help. Good luck mapping. :)