Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/archive/global.php(40) : eval()'d code on line 2
[TUTORIAL] Brush merging [Archive] - TF2Maps.net Forums

PDA

View Full Version : [TUTORIAL] Brush merging


A Boojum Snark
02-16-2008, 04:14 PM
This is a rather advanced technique, and isn't often needed or useful. I tend to use it in cases where an object can be better vertex manipulated if it's one brush. Remember that the resulting object still has to be a valid convex solid. This includes not having two faces lie on the same plane.

For the tutorial I made an odd conical shape out of three cylinders and a spike, don't ask what it is as I have no idea. :P

http://img.photobucket.com/albums/v401/aboojumsnark/long/brushmerge01.jpg

First, copy the brushes to be merged to a new document. This will both ensure the safety of your original VMF, and make finding things easier.

http://img.photobucket.com/albums/v401/aboojumsnark/long/brushmerge02.jpg

My object is made of four pieces, as you can see, and we need to differentiate between the inside faces that touch each other and the outside faces we see so we know what to remove. How many of each you have will determine which ones to change, I have 33 outside and 6 inside, so I'll change the insides. Material doesn't matter, for the tutorial I'm using nodraw on the faces to be removed.

http://img.photobucket.com/albums/v401/aboojumsnark/long/brushmerge03.jpg
(brushes expanded to show what I did, keep them together for the next part)

Save the map, then open it in a text editor. If you've never done this before it can look complicated, but it's easy to follow once you learn to recognize pieces.

http://img.photobucket.com/albums/v401/aboojumsnark/long/brushmerge04.jpg

First we want to locate and remove all the inside faces, and we do so with the help of the material property each face block has in the VMF.

http://img.photobucket.com/albums/v401/aboojumsnark/long/brushmerge05.jpg

Here I've found a side with nodraw on it, so I know this is one I wanted to remove. Select the whole block, as I have in the picture, and delete it. Continue doing this throughout the whole document, use the find function to search for the material you used on the inside faces to ensure you don't miss any.

Right now we have a bunch of invalid brushes, since we removed some of their faces. So now we need to do the actual merging of the brushes. To do this we will locate and remove every start and end of brush data, except for the very first and very last.

http://img.photobucket.com/albums/v401/aboojumsnark/long/brushmerge06.jpg

Save the document, open it in hammer, and you should have a single brush to copy back into your original map. :)

http://img.photobucket.com/albums/v401/aboojumsnark/long/brushmerge07.jpg

Vander
02-16-2008, 05:15 PM
Very nicecly done. I had no idea you could edit in the actual text file.

Youme
02-16-2008, 06:54 PM
awesome, rep ++

phatal
02-16-2008, 08:44 PM
Awesome man! This is something new and old designers will and can use!!!

rep +++

Scotland Tom
02-16-2008, 10:17 PM
Wow, that's fascinating. I wouldn't have ever thought you could edit a brush through text. Nice work, and very helpful!

A Boojum Snark
02-17-2008, 09:57 PM
Thanks, all of you. Glad it was what you needed, phatal... it's a tidbit I picked up years ago and have never used or talked about much.

Godling
02-18-2008, 01:56 PM
What can you do with the new object in Hammer that you couldn't have done with the original 4 part object? I don't get it?

Youme
02-18-2008, 02:00 PM
What can you do with the new object in Hammer that you couldn't have done with the original 4 part object? I don't get it?
its tidyer, easier to texture, posibly quicker to compile (not sure on that one) easier to select....etc

A Boojum Snark
02-18-2008, 02:11 PM
I'll admit that yes, what I showed here is, in itself, nigh useless. I didn't have the time or interest to actually devise an example object that lets you do something afterwards that you couldn't before. I have ran into such in the past, but can't remember any of them.
This isn't so much something that you can tell someone what you can do with it, but rather you just end up running into a case where you instantly know you need this. (as I said in the tut, it's almost always a case of being able to VM the resulting object in ways you couldn't with a bunch)

Termaximus
02-25-2008, 03:37 PM
"For the tutorial I made an odd conical shape out of three cylinders and a spike, don't ask what it is as I have no idea"

Looks like the Pope's hat. Nice tutorial, although a bit above my pay grade at this point.

MangyCarface
02-26-2008, 08:55 PM
I remember Goldsrc mappers would sometimes write their entire maps in notepad... takes a hell of a mind to do that. Awesome tutorial though rep ++