H-L Compileing Stages Created 17 years ago2007-04-14 09:05:05 UTC by aaron_da_killa aaron_da_killa

Created 17 years ago2007-04-14 09:05:05 UTC by aaron_da_killa aaron_da_killa

Posted 17 years ago2007-04-14 09:05:05 UTC Post #219016
Hay twhl peeps. I thought It would be very intresting to know the stages of compileing hl maps. I'm talking like build vis leafs and leaf thread and final light bounce and all that. What do each of them mean and what do they do. (zhlt) I also need to know because i have a very uncomplex map that takes like 1 hour on 2 stages and does the rest in like 1 minute. So post some links or tell the rest of the world. Note: This page will be posted all over half-life 1 mapping sites so you'll be famous. And sorry for my horrible typeing :)
Posted 17 years ago2007-04-14 10:33:37 UTC Post #219027
Well let us start with CSG.

CSG creates all brushes, vertex, faces, point entities, face normals...ect This is why it must be first before the rest. These things are the base of all maps without them nothing else can be done.

________________________________________________________
The main purpose of the BSP procces is creating the four hulls the game needs. Hulls 0-3.
Hull 0 is the colusion hull, the clip nodes. It determines whats solid and whats not.
In it's prossec bsp split faces into regions, each of these region, each one of these regions is a clip node that derermine that it's solid or not.

The other hulls are visual and determine what faces are on the inside and what are on the outside. BSP determines that by the location of the entities. Entities should be inside the hull so this is a very useful way to know whats the inside or out side. If there are no entities in the hull then BSP can't calculate at all. An entity outside the hull makes BSP think the void is the hull, so it will create a leak, since it wont be able to determine whats the void and whats the inside of the level.

A leak in hull 0 means BSP can't finish all the hull because there is a small hole, smaller then the player, it cannot determine wether it is solid or not. But it can still complete the other hulls to determin whats the inside and whats the outside. The old Q-tools could still run rad and vis with this leak, in ZHLT this behevior was removed to make the mapper fix the leak. Even if the map wont be fullbright the fps will drop.
A leak in other hulls mean the compiler can't even determine whats the inside of the room and whats the outside. In that kind of case the hole is larger then the player and the map wont run usally.
Vis and rad need BSP's 1-3 hull calculations in order to oporate.

_______________________________________________________
VIS is an extremely important procces and should always run.
It's purpose is to detemine from each spot what objects can be seen, things that can't be seen wont be rendered. Running will raise the preformence alot, without it all the map will be rendered at once.

The vis creates leafs and portals to help him calculate. Portals are the edges of the bsp clip nodes.
Leafs are lines that are drawn from each clip node to another, if that line is broken by a solid brush the other node cannot be seen from that point and hence wont be rendered. If there is a straight unbroken leaf between two nodes, even the edge of the nodes' portal, even if in most parts of the nodes that other node can't be seen, it will be rendered.
This is where hint brushes come it. They create a portal and split those nodes, and in this way you can discard a node that normally will be render from another spot. This is how they raise the preformence. A node covered by another world brush will be discarded since it couldn't be seen from any point.
It ignores entities, this is important cause it wont draw portals and split faces they cover.

As you probebly know calculating and drawing leafs from each portal to another is hard work and takes the compiler a long time.

________________________________________________________
RAD simply uses vis's calculations to calculate the light, where everything will be lit and where it will be dark. It calculates everything concerning lighting, all the little special affects like bounce ,and most important what blocks lights, thats why it needs vis to tell it from where each node can be seen. RAd also determines from each light source where the light is broken by by a brush, he uses the same method vis does, leafs.
Making opaque entities(blocks light) makes rad work harder since vis ignores them in it's calculates, rad needs to calculate some of them by his own.

This is it. An explenation on the HL compiling procces, and a little on leaks. :glad:
Posted 17 years ago2007-04-14 11:53:56 UTC Post #219033
Nice Explanation Elon!

Write a tutorial on it!
Posted 17 years ago2007-04-14 15:02:11 UTC Post #219063
okay...

Write a tutorial that doesn't assume I'm a child!
I've drawn an overview so you won't get lost in my technical language.
I got pissed right there...
Posted 17 years ago2007-04-14 17:28:56 UTC Post #219086
A tutorial on the phases and common errors connected to them, might be nice.
In the CSG I can refer to malformed face normal, plane with no normal and coplanar plane.
In BSP, leaks and max clipnodes.
In vis I can refer to leaf saw into portal.
In rad I can refer to too many light styles and allocblock:full.

I'll talk to seventh.
Posted 17 years ago2007-04-14 21:06:06 UTC Post #219104
Thankyou very much people and specialy to Elon Yariv to his great explination. Now that I got this out of the way does anyone know what each of these mean?

>>> Build Face Lights
>>> Build Vis Leafs
>>> Leafthread
>>> Baseportal Vis
>>> Makescales.
>>>Finallightface

Like thats what I need to know next. Mabye you guys don't see this because I use a simple dos program to compile my levels and not hammer or a downloaded program. That would be great if anyone knew.
I use zhlt 2.5.3 to compile my maps. But again thanks you guys :)
Posted 17 years ago2007-04-15 00:15:39 UTC Post #219137
Leafthread- creates leafs.
Build Vis leafs- The phase in which rad uses vis's leaf calculation to calculate light. As far as I know it also draws leafs from each light source. Having many light sources will lengten this phase and might be as long as the leafthread(1000 or more, usally happens because of texture lights, they create lots of light sources).

I can't tell you anymore since I don't know much on the rest of those RAD phases. So I wont start inventing stuff. I will look for something though.

I will explain a bit on RAD's swap file soon but I got to go now.
Posted 17 years ago2007-04-15 02:57:29 UTC Post #219139
thanks man. :)
Posted 17 years ago2007-04-15 18:18:56 UTC Post #219185
Potals don't actually separate the leafs, the leafs are drawn from them. :|
You must be logged in to post a response.