VERC: Combining Brushes with a Text Editor Last edited 16 years ago2002-07-28 06:45:00 UTC by Penguinboy Penguinboy

This article was recovered from an archive and needs to be reviewed

  1. The formatting may be incorrect as it was automatically converted to WikiCode from HTML, it needs to be revised and reformatted
  2. Some information may be out of date as it was written before Half-Life was available on Steam
  3. After the article is re-formatted and updated for Steam HL, remove this notice
  4. Please do not remove the archive notice from the bottom of the article.
  5. Some archive articles are no longer useful, or they duplicate information from other tutorials and entity guides. In this case, delete the page after merging any relevant information into other pages. Contact an admin to delete a page.
Have you ever had a bunch of brushes, and wanted to combine them all into 1? Unfortunately, this is not an option in Worldcraft, BUT it is possible with a text editor as long as the brushes, when combined, would make a convex object!

So first lets define what a convex object is in terms of a .map. A convex object can be stored as the intersection of many 2d planes in 3d space, which is exactly how brushes are stored in .map format. In order for this trick to work, the combination of all your brushes MUST be convex. Think of it like this: if you can draw a line that passes through the object more then 2 times, then the object MUST be concave and you cant combine the brushes.

If, however, the combination yeilded would be convex, then you can proceed.

So lets say you made this really nifty thingamajig out of a ton of triangular prisms, and you want to turn it all into 1 brush because having multiple brushes is giving clipping errors or some other rubbish that is known to occur with such things.
combo1.jpgcombo1.jpg
The first thing you do is to take your thingamajig and put it all into a separate map so that it is easier to browse the .map file, and so that if you mess up, it wont ruin your entire map.

Now take it and cover it all with a single texture, the name of which is distinguishable. I like to use aaatrigger because the aaa catches my eye easily when perusing planes in notepad. It should look something like this:
combo2.jpgcombo2.jpg
Now go around in 3d, and apply the origional texture to every OUTSIDE face, but not the inside faces! the outside should look like this:
combo4.jpgcombo4.jpg
Whereas the inside should look something like this:
combo5.jpgcombo5.jpg
Now export to .map, which can be comprehended in text format.
combo6.jpgcombo6.jpg
Now right click on the .map file, and select "open with" (or just "open" if you have not associated the file type already). It will bring you to a list of programs to open it with. Select "notepad" from the list. The dialog may look like this depending on your OS:
combo7.jpgcombo7.jpg
When you open it, what you see should look something like the following minus the highlighting. Everything that is yellow represente a plane definition for which the texture is aaatrigger, and thus means that it is a plane that we dont want, so delete it! The separations between different brushes are highlighted in red, and since we want it all to be 1 brush, we must delete these as well.

{

"classname" "worldspawn"

"classname" "worldspawn"

"sounds" "1"

"MaxRange" "4096"

"mapversion" "220"

"wad" "sierrahalf-lifevalvehalflife.wad;
"

{

(
-256 224 0 ) ( -256 256 32 ) ( -128 224 128 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0
-1 0 ] 0 1 1

( -192 352 0 ) ( -256 224 0 ) ( -128 224 128 )
-1OUT_RK5 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1

(
-192 352 0 ) ( -256 256 32 ) ( -256 224 0 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1
0 0 ] 0 1 1

(
-256 256 32 ) ( -192 352 0 ) ( -128 224 128 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0
-1 0 ] 0 1 1

}

{

(
-192 352 0 ) ( -256 320 64 ) ( -128 224 128 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0
-1 0 ] 0 1 1

( -224 384 160 ) ( -192 352 0 ) ( -128 224 128 )
-1OUT_RK5 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1

(
-224 384 160 ) ( -256 320 64 ) ( -192 352 0 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0
-1 0 ] 0 1 1

(
-256 320 64 ) ( -224 384 160 ) ( -128 224 128 ) AAATRIGGER [ 0 1 0 0 ] [ 0
0 -1 0 ] 0 1 1

}

{

(
-192 352 0 ) ( -288 288 64 ) ( -224 384 160 ) AAATRIGGER [ 1 0 0 0 ] [ 0 0
-1 0 ] 0 1 1

( -352 384 32 ) ( -192 352 0 ) ( -224 384 160 )
-1OUT_RK5 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1

(
-352 384 32 ) ( -288 288 64 ) ( -192 352 0 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1
0 0 ] 0 1 1

(
-288 288 64 ) ( -352 384 32 ) ( -224 384 160 ) AAATRIGGER [ 0 1 0 0 ] [ 0
0 -1 0 ] 0 1 1

}

{

(
-288 288 64 ) ( -192 352 0 ) ( -256 224 0 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0
-1 0 ] 0 1 1

(
-288 288 64 ) ( -352 384 32 ) ( -192 352 0 ) AAATRIGGER [ 1 0 0 0 ] [ 0 -1
0 0 ] 0 1 1

( -192 352 0 ) ( -352 384 32 ) ( -256 224 0 )
-1OUT_RK5 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1

(
-288 288 64 ) ( -256 224 0 ) ( -352 384 32 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0
-1 0 ] 0 1 1

}

{

(
-320 192 96 ) ( -256 288 64 ) ( -256 224 0 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0
-1 0 ] 0 1 1

(
-256 224 0 ) ( -256 288 64 ) ( -352 384 32 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0
-1 0 ] 0 1 1

( -320 192 96 ) ( -256 224 0 ) ( -352 384 32 )
-1OUT_RK5 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1

(
-352 384 32 ) ( -256 288 64 ) ( -320 192 96 ) AAATRIGGER [ 1 0 0 0 ] [ 0
-1 0 0 ] 0 1 1

}

{

(
-224 320 64 ) ( -352 384 32 ) ( -320 192 96 ) AAATRIGGER [ 1 0 0 0 ] [ 0
-1 0 0 ] 0 1 1

(
-224 320 64 ) ( -224 384 160 ) ( -352 384 32 ) AAATRIGGER [ 1 0 0 0 ] [ 0
0 -1 0 ] 0 1 1

( -352 384 32 ) ( -224 384 160 ) ( -320 192 96 )
-1OUT_RK5 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1

(
-224 320 64 ) ( -320 192 96 ) ( -224 384 160 ) AAATRIGGER [ 0 1 0 0 ] [ 0
0 -1 0 ] 0 1 1

}

{

(
-224 384 160 ) ( -320 192 96 ) ( -224 256 32 ) AAATRIGGER [ 0 1 0 0 ] [ 0
0 -1 0 ] 0 1 1

(
-128 224 128 ) ( -224 384 160 ) ( -224 256 32 ) AAATRIGGER [ 0 1 0 0 ] [ 0
0 -1 0 ] 0 1 1

( -128 224 128 ) ( -320 192 96 ) ( -224 384 160 )
-1OUT_RK5 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1

(
-320 192 96 ) ( -128 224 128 ) ( -224 256 32 ) AAATRIGGER [ 1 0 0 0 ] [ 0
0 -1 0 ] 0 1 1

}

{

(
-320 192 96 ) ( -256 224 0 ) ( -224 320 64 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0
-1 0 ] 0 1 1

(
-224 320 64 ) ( -256 224 0 ) ( -128 224 128 ) AAATRIGGER [ 0 1 0 0 ] [ 0 0
-1 0 ] 0 1 1

(
-320 192 96 ) ( -224 320 64 ) ( -128 224 128 ) AAATRIGGER [ 1 0 0 0 ] [ 0
-1 0 0 ] 0 1 1

( -128 224 128 ) ( -256 224 0 ) ( -320 192 96 )
-1OUT_RK5 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1

}
}

So, once this is done, we get a much nicer plane by plane definition of our one intended object, which should look something like the following:

{

"classname" "worldspawn"

"classname" "worldspawn"

"sounds" "1"

"MaxRange" "4096"

"mapversion" "220"

"wad" "sierrahalf-lifevalvehalflife.wad;
"

{

( -192 352 0 ) ( -256 224 0 ) ( -128 224 128 )
-1OUT_RK5 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1

( -224 384 160 ) ( -192 352 0 ) ( -128 224 128 )
-1OUT_RK5 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1

( -352 384 32 ) ( -192 352 0 ) ( -224 384 160 )
-1OUT_RK5 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1

( -192 352 0 ) ( -352 384 32 ) ( -256 224 0 )
-1OUT_RK5 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1

( -320 192 96 ) ( -256 224 0 ) ( -352 384 32 )
-1OUT_RK5 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1

( -352 384 32 ) ( -224 384 160 ) ( -320 192 96 )
-1OUT_RK5 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1

( -128 224 128 ) ( -320 192 96 ) ( -224 384 160 )
-1OUT_RK5 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1

( -128 224 128 ) ( -256 224 0 ) ( -320 192 96 )
-1OUT_RK5 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1

}
}

Now all that is left to do is save the .map, exit notepad, and open it up in your editor of choice!

Here is what the tutorial thingamajig looks like in worldcraft once completed:
combo8.jpgcombo8.jpg
If yours didnt come out correctly, then EITHER,
1: Your objects, when combined, make a concave object.
OR
2: You didnt texture correctly: an inside face was textured as an outside face, so you have redundant plane definitions since it didnt get deleted, or an outside face got textured as an inside face, so you deleted a necessary plane definition.
OR
3: You screwed up somewhere in notepad/wordpad.
This article was originally published on the Valve Editing Resource Collective (VERC).
TWHL only archives articles from defunct websites. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.

Comments

You must log in to post a comment. You can login or register a new account.