Brush Hulls

Discuss the construction of maps and the tools to create maps for 3D games.
Post Reply
Mexicouger
Posts: 514
Joined: Sat May 01, 2010 10:12 pm
Contact:

Brush Hulls

Post by Mexicouger »

I am curious about The Hulls on Brushes. When I make a model-like Brush in worldcraft, and use it as a setmodel in QC with self.solid = SOLID_BBOX, is the hull the same size of the box, or does it goto one of Quakes 3 Hull sizes?

If I am unclear, please let me know
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

you misunderstand hulls.

every non-stripped brush is part of all three hulls (specific exceptions apply). each and every brush.

a hull is used for each collider size, rather than each brush size, so if your ent/line is '0 0 0' by '0 0 0' it'll use hull 0, if your ent is player-sized, it'll use hull 1, shambler sized and it'll use hull 2. it doesn't matter what size your brushes are.

Specifically, a hull is a complete copy of the world, but with every brush's face expanded by a certain number of units (depending upon the direction of the face and the hull number that is being built). This is how different bbox sizes work against the world. Faces facing upwards are expanded by 24 units, faces facing down by 32, faces facing sideways by 16. These examples are for hull 1 (player-sized). This means that your trace can use just the origins and do a line trace through the relevent bsp tree, which is nice and fast.

The hull sizes are not described by the bsp itself. The sizes are hardcoded in both qbsp and the engine. The engine only needs the sizes to choose which hull to use, and to offset the ground position to keep the mins_z (actually, the entire mins, which is evil) actually on the ground.
Quake has 3 hulls, with 1 extra as padding.
Halflife has 4 hulls, only hull 0 matches quake. With the right hull size coded in the engine, quake player models can be offset to keep them on the floor, but you won't be able to run though any holes smaller than non-crouching halflife players, who are 24 units taller.
Hexen2 has 5 hulls, with 3 extra as padding. Hulls 0 and 1 match quake, while the other hulls do not, and potentially change size based upon regular and missionpack h2 maps. The 8 slots instead of 4 is the only file format difference from quake.

the exceptions I mentioned:
sky/water surfaces are not solid and thus cannot normally be clipped against. However, such brushes affect the contents and are thus still present and effective in all hulls, despite not being solid (which is kinda the reason for this exception).
The second exception is the 'clip' texture. Surfaces with this texture will be present in all *but* hull 0, and will be invisible. This means projectiles will travel through, but players and monsters will find it solid, and can walk on it and stuff.


So yeah, hulls are copies of the world, but with the faces expanded depending on the hull index.
Does that answer your question?
Mexicouger
Posts: 514
Joined: Sat May 01, 2010 10:12 pm
Contact:

Post by Mexicouger »

I just thought that If I made a brush 40 units in each direction, that that would be how big the bounding box would be. I suppose I could put a clip in the bsp model too.
andrewj
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Post by andrewj »

Clipping (colliding) against brush models is the same as normal world geometry , so yeah you can using clip brushes in them.

Spike is mostly correct, except about sky/water surfaces. Clipping hulls only distinguish solid/non-solid and don't specify other contents. Sky surfaces just become solid, and water/lava/slime is completely ignored when making those hulls.

P.S. some map compilers support "detail" brushes which are the opposite of "clip" brushes : they exist only in the rendering hull and don't exist in the clipping hulls. A wall made of detail brush would let you pass straight through it, but bullets and rockets would hit it.
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

andrewj wrote:P.S. some map compilers support "detail" brushes which are the opposite of "clip" brushes : they exist only in the rendering hull and don't exist in the clipping hulls. A wall made of detail brush would let you pass straight through it, but bullets and rockets would hit it.
That's not a detail brush in the Q2 sense. A detail brush is nothing to do with hulls but instead affects vis processing.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
andrewj
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Post by andrewj »

mh wrote:That's not a detail brush in the Q2 sense. A detail brush is nothing to do with hulls but instead affects vis processing.
Ahhh ok. Guess I had the wrong term.

Looking at the Q2 bsp code, I see that detail brushes are mainly to keep vis clusters at a reasonable size (and have a lot less of them), helping to speed up the vis step (by a large factor if used well, I'd say).
Post Reply