Half-Life Re-imagined competition results on their way...
Check out Skewing textures in Hammer, our newest tutorial!
Say hello to csapdani, our newest member!

logo

Site Stuff

Reference

Maps

Community

ShoutBOX

Poll

Feeling Blue

What's your favourite shade of blue?

Azure

8

Cobalt

15

Turquoise

4

Cyan

7

Royal

3

Teal

3

Onliners

51 secs

Windawz

15 mins

Bruce

19 mins

Jessie

20 mins

Strider

21 mins

Admer456

22 mins

Solokiller

32 mins

Urby

Affiliates

A gaming and technology blog by TWHL admins Penguinboy and Ant. A music blog by TWHL users Ant and Hugh.

Combining Brushes with a Text Editor

By Nick "Mazemaster" Alger

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.

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:

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:

Whereas the inside should look something like this:

Now export to .map, which can be comprehended in text format.

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:

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" "\sierra\half-life\valve\halflife.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" "\sierra\half-life\valve\halflife.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:

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.