For this tutorial, I'll be assuming you have:
"Tetrahedron" is a more elaborate name for three-sided pyramid, which is known as the most primitive three-dimensional shape possible. Unlike a wedge with six vertices and five faces, it only has four vertices and four faces.
The most common complex terrain method used in GoldSource mapping, usually called "Triangle terrain", involves manipulating the vertices of wedges to produce more complex surfaces with minimal risk of creating invalid solids (don't say I haven't told you to read that tutorial on terrain.. ;> ). This method, even if visually superior to any other method(s), always ends up choking your level with huge wpoly/clipnode/leaf counts, making it nearly impossible to use in multiplayer maps where terrain plays a bigger role.
Tetrahedron terrain is pretty much the same above mentioned technique with a single twist: Tetrahedrons instead of wedges. Tetrahedrons are triangular shapes, therefore can be used to form the same squares of triangles you'd make from wedges and have the same flexibility when it comes to Vertex Manipulation. Most importantly, however, using them instead of wedges will usually cut down wpoly/clipnode/leaf counts by 20-30%
The main reason behind this is that tetrahedrons in terrain have only three edges touching their surrounding objects, whereas wedges have six. This reduces unnecessary face-splitting done by the compile tools, thus decreasing the aforementioned figures.
Convinced in giving this a go? Start by opening Hammer and creating a wedge of any size (I'd suggest using standard dividable-by-16 dimensions, though) and texturing it all with the BEVEL texture (ZHLT.wad). In the example, I used 96
is extremely important there, as it tells the compile tools to completely discard the faces it's applied to during the process. That does a great deal in reducing face-splitting. Select your newly created shape and go into Vertex Manipulation mode. Then select each bottom vertice one-by-one and move it to one point in the center of the shape. Merge vertices when prompted. Now you have a nice clean tetrahedron! Apply your texture of choice to its top face. Select and drag it in top view, while holding Shift
to clone the shape. Finally, rotate the clone by 180°
and fit it to the existing triangle to form a square of two tetrahedrons. Clone the square as many times as you want (like you usually would when making triangle terrain) and you'll have yourself a VM-ready triangle field, ready to be transformed into your most low-poly terrain yet. Do read the next section before rushing off to VMing, as it covers some..
Precautions to take
Sadly, as pretty much every technique for terrain in GldSrc, this one definitely has its downsides & problems..
First of all, a VMed field of tetrahedrons will probably be the dirtiest thing you'll ever see in Hammer's perspective views, making everything fairly indistinguishable there. In this case, VIS Groups
are your best friend and should certainly be utilised in bigger maps. Second, when manipulating tetrahedrons, always keep track of the center vertex, sticking out to the void/outside area. Chances are, it may end up inverted, creating concave brushes, which produce "Entity/Brush outside world
" errors in CSG. Always check for problems in Hammer (Alt+P
) to at least partly avoid that (you'll still have to run CSG to find every concave brush, though). You may also encounter clipping problems in-game, ranging from simple invisible barriers to your player falling through the triangle seams into the void. The "-cliptype precise
" command for CSG plus using the BEVEL
texture as described earlier seem to usually
fix both problems.
And finally, since each tetrahedron side is joined with the other by only one edge, LEAKs
may occur in more complex terrain. I haven't run into that problem myself yet, though I believe shifting vertices in the X/Y axis (Top view) may cause that, so to avoid bigger problems, perform LEAK-only BSP checks regularly.
So, as you see, this technique, albeit providing better performance, may cause bugs even if handled properly and is generally much harder to work with.
To sum it all up, I'd say don't be bothered with tetrahedrons unless you really need to reduce wpoly/clipnode counts and any other optimisation methods you try fail. Stick to triangles when you can.
Check out the example maps for a better idea/example on how this works. Good luck! :>