[TUTORIAL] Brush merging

Discussion in 'Tutorials & Resources' started by A Boojum Snark, Feb 16, 2008.

  1. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    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

    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]
    (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.

    [​IMG]

    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.

    [​IMG]

    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.

    [​IMG]

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

    [​IMG]
     
    • Thanks Thanks x 4
    Last edited: Feb 16, 2008
  2. Vander

    Vander L8: Fancy Shmancy Member

    Messages:
    507
    Positive Ratings:
    110
    Very nicecly done. I had no idea you could edit in the actual text file.
     
  3. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,739
    awesome, rep ++
     
  4. phatal

    phatal L6: Sharp Member

    Messages:
    259
    Positive Ratings:
    21
    Awesome man! This is something new and old designers will and can use!!!

    rep +++
     
  5. Scotland Tom

    Scotland Tom L6: Sharp Member

    Messages:
    332
    Positive Ratings:
    64
    Wow, that's fascinating. I wouldn't have ever thought you could edit a brush through text. Nice work, and very helpful!
     
  6. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    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.
     
  7. Godling

    Godling L2: Junior Member

    Messages:
    55
    Positive Ratings:
    8
    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?
     
  8. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,739
    its tidyer, easier to texture, posibly quicker to compile (not sure on that one) easier to select....etc
     
  9. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    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)
     
  10. Termaximus

    Termaximus L5: Dapper Member

    Messages:
    229
    Positive Ratings:
    32
    "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.
     
  11. MangyCarface

    aa MangyCarface Mapper

    Messages:
    1,616
    Positive Ratings:
    1,275
    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 ++