Tutorial: How to make Caves

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
It has come to my attention (after spending nearly a full day attempting to salvage Oculus) that we be requiring some tutorials on proper cave design. (There's also just so many examples of caves done horribly wrong in MSC, I figure it's best to avoid some reproduction of said BSP butchering.)

The following map contains several examples of several legit methods for making caves, divided into several vis groups:
http://www.thothie.com/msc_dev3/caves_tutor.rar

Terrain Deformation Method:

caves_tutor1.gif
various deformation examples

Ideally, the terrain deformation method involves starting with a box room, and filling the sides with terrain deformations.

There's several examples on how to create basic terrain deformations in the "Before", "Convex", "Concave", and "Dome" examples, immediately NE of the zero point.

Simplest method is to start with a set of spliced cubes (as seen in the "Before" visgroup) - you can either copypasta a couple of cubes spliced 45 degrees across, or simply splice up one large square box into several smaller ones and splice from corner to corner. After that, it's a simple matter of selecting the vertexes on the top and moving them up or down (or, on a vertical wall, left to right). You should only need to move the vertexes across a single plane on a single face. Ye might be tempted to move them across more than one plane when uniting floors with vertical walls, but it should be achievable just by eliminating cubes from one terrain deform group or another. (If you choose to do it anyways, be sure to move vertexes in the opposing plane, or you may get invalid structures.)

Terrain deformation is done quickest with the "Arrow Keys Nudge Vertex" option enabled (Tools->Options->[2D Options Panel]). You can then select the vertex to move in the 3D view, move the mouse to the proper plane in the 2D view (don't click, just hover), and hit an arrow key to nudge the vertex. With some practice you'll be able to do this without taking your eyes from the 3D view.

Scaling, rotating, or otherwise moving terrain deformations of this type can result in deformed brushes that Hammer will fail to detect, causing visual artifacts, or mystery leaks. So once you've decided where your wall is going to be, stick with it. However, if your deformation is simple enough, and on a good grid, you can usually get away with copy-pasta'ing segments, flipping, and rotating them, to be tiled into new areas.

Real world examples of this method are included in this tutorial from Sfor, Wicard Oven, The_Wall, and the WIP map, Sewer Ride.

In the Sewer Ride and Wicard Oven examples, the terrain has been spliced across, post-deformation, to create red-crystal grooves for additional lighting. This works, but is dangerous - you might need a few attempts before you make a splice through them in a way that won't mess with Hammer or the compiler. It should also likely never be done on a segment exposed to the outside of the hull. (Which shouldn't be an issue if you keep your box framework intact.) Once you've made such a splice, forget about moving the wall in anyway.

Generally, you want to keep main pathing of your caves (ie. the floor) as flat as possible. This helps with both monster and player navigation. The tunnel from The_Wall can't be entered (it's clip brushed so you cannot enter - being there just for show). The Sfor example involves some drastically rugged floor terrain, and you'll see there are clip brushes scattered throughout to prevent your getting stuck therein. (Also, all the monsters in there are projectile tossers, and thus do not need to navigate the nasty terrain.)

This method is fairly friendly wpoly wise, but murder on clip and leaf nodes. To help with the clip nodes, the entire ceiling in the sfor example should likely be inside a clip brush. (Though in this instance, it was not). The Wall's example is entirely inside a clip in the actual map.

If you want a manufactured dome look, create a quarter of the dome, copy pasta, and flip, as in the Dome example here (each quarter is grouped). You'll notice the convex group is also done with a similar method - although in two halves, in that case, so even when going for natural looking terrain, you can get away with some copy-pasta and mirroring. All of the walls in the Sfor example are slightly varied versions of the same terrain formation.

Segmented Caves

caves_tutor2.gif
segments from Rickler's sorc_villa


If you have a nicely aligned, and fairly simple cave segment, you can usually get away with splicing and, to a degree, skewing it. Provided in the "rickler_segmented" vis group is an example used in Sorc_Villa. Simply copy pasta your cave segment, skewing it here and there to add some variety. Your base segment should be perfectly square. If it is, you can then copy it onto itself, rotate, and splice each resulting segment at 45 degrees to create a 90 degree turn. If the segment is designed simply enough, and all the vertexes meet, it won't even leak. Notice, in the example, how each segment is in its own group.

Block Caves

caves_tutor3.gif
aleyesu - proving, once again, quick and dirty gets the job done more often than not

In the South West corner are extensive examples of some block caves from Aleyesu. These usually involve three simple blocks and a floor, placed at various angles to create variety. Note that the blocks involved are not twisted to join up, but only meet at their corners, this helps keep VIS from becoming a real issue. The more often you can make your caves meet at 90 degree angles, and the more often you can create cube-like areas that VIS can isolate, the less likely you are to run into issues.

Key thing to avoid here is the "Chinese Fingertrap" effect. Don't use multiple wedges all joined at every angle stretching into unpredictable curvatures, or HLVIS's little mind will explode when you attempt to compile. The compiler thinks in box-like areas, try to work with it, rather than against it.

Simple Geometry

caves_tutor4.gif
simple geometry from ww_shrinkspell

The example from Shrinkspell in the upper North East corner demonstrates various simple geometry turned into caves. This can be the most optimal method, and doesn't look too blocky when combined with some nice textures. There's no real advice here except the usual: Keep it Simple. There's no need to make crazy shapes that the compiler will have trouble digesting.

General Advice

• Keep your floors flat
- Remember monsters cannot navigate ramps in multiplayer, and rugged terrain, in addition to raising your leaf and clip limits, is rough both on players and the compiler.
- If you *must* have a large steep ramp, add a func_monsterclip staircase of 16 unit boxes. You don't have to worry about the monsterclip brushes intersecting with solid map brushes too much.

• Think inside the box
- You should be able to break down the basic structure of your map into boxes, which helps the "golden rectangle" method VIS uses to build nodes. Build from the outside in, with your brushes meeting at 90 degree angles as often as possible. Your rooms should always look simple and logical on at least one of the three planes.

• Keep it Simple Stupid
- The sacred rule of KISS. If you take a month off from mapping, you should have no issues figuring what you did when you come back to it. Group your terrain deforms. Keep a room-by-room style build (don't have brushes stretching across multiple VIS areas - it's hard on the eyes and the compiler).

• Lighting
- Don't attempt to imbed crystal structures into your walls unless both the walls and crystals are extremely simple (and even then, use func_illusionary crystals). The splice method works, but once you've done it, you're going to have to rebuild that wall from scratch if you want to move it. Another, safer method, not demonstrated here, is to use some glowing moss or slime. Take one of your existing textures, photoshop some pale moss or slime onto it, and put it back into your map. You can then stick a point-entity light next to the texture and it should look fairly natural. Don't scale the texture up to allow higher-detailed moss or slime, however, or you'll get that incorrect texture lighting effect when a glowing player runs across it, ala some of the glowing slime textures in Calruin2.

caves_light1.gif
crystal splice

caves_light2.gif
slime lighting - okay, those are trees, so sue me

caves_light3.gif
glowing eyes from ancient artifacts and glowing lava textures work too

• Embed Ruins
- An endless twisting set of caves not only looks bad, but is hard on the compiler. Toss in some walls and a room of stone bricks once in awhile. You can take these opportunities to get your walls to line up, save you some vis nodes, and break up the monotony of your map.


Caves Tutorial said:
Key thing to avoid here is the "Chinese Fingertrap" effect. Don't use multiple wedges all joined at every angle stretching into unpredictable curvatures, or HLVIS's little mind will explode when you attempt to compile. The compiler thinks in box-like areas, try to work with it, rather than against it.

There's an exception to this, and that is if you can keep all the joints lined up in at least one plane (preferably two), and break them up into segments, then HLVIS's little mind will remain intact.

Which brings us to...

The Chinese Fingertrap Method

chinese_fingertrap.jpg

The Chinese Fingertrap method involves this beast:

chinese_fingertrap_segnment.png

Basically, a cave segment, made up of nothing but 4 face alternating wedges, with all the vertexes lined up on a 16 unit grid on either end.

The advantage to a 4 face wedge, is that you can twist it any which way, and it won't cause a malform brush.

You can scale, skew, and vertex manip the segments all you want, and it wont cause errors, nor leak, so long as all the vertexes line up at the mouth to each cave segment.

Thus you can do really nutty things, like this:

chinese_fingertrap_ss1.gif.png

Yes, those are all that same cave segment, including the bulbous room at the bottom, and no, it doesn't leak.

Advantages:
• Extremely flexible, very natural looking caves.

Disadvantages:
• Non-90 degree junctions are kind of a pain.
• Looks like ass in Hammer.

Plus, as with most of these caves, tunnel textures are hard to align.

Surprisingly it isn't too nasty on the clip node count, but if you are saving clip nodes by using a kinder -cliptype during compile, be careful that the caves don't become so narrow or so steep as to stop the player.

Mobs that don't jump will also have a rough time with these caves in laggy situations, so you'll need the usual 16-unit func_mosnterclip staircases used to deal with ramps.

The easiest way to vertex manip these batards, is to select two segments, hit Shift+V then drag out a box to select the joined vertexes away from the center:
chinese_fingertrap_anim3.gif
(Mind you I've the "Arrow Keys Nudge" option active.)

But if you don't have to make a hard turn, or make a room from them, skew works just as well without vertex manipulation, so long as it's on a 16 unit grid.

This particular segment won't work well for artificial tunnels, but those generally end at 90 degree angles, making this unnecessary anyways. You can, of course, make smoother, rounder, and more complex tunnels, the same way, but this is about as many vertexes as my eyes can handle. (Plus, you need to keep your floors flat, so as not to mess with your mobs).

Mind the four seemingly superfluous brushes on the outside of the cave segment in this particular example. Leave them - they are guides to make it possible to scale/skew the segment on a 16 unit grid. The compiler will discard them.

This method really requires it's own RMF and BSP, so:
http://www.thothie.com/msc_dev4/chinese_fingertrap.rar

There's a lone example segment, sitting just NE of center.

chinese_fingertrap_akbar2.png


todo's:
• Add slice&dice method
• Add model method
 

Tigerkev

New Adventurer
The Dragonknights
Heroes of Dawn
Joined
Aug 18, 2010
Messages
214
Reaction score
0
Age
34
This makes me wanna go into mapping again :roll:
 

littleaznboi

New Adventurer
Blades of Urdual
Joined
Oct 26, 2008
Messages
185
Reaction score
0
Location
dallas,tx
Thanks, been looking for a tutorial to make caves for a while. This should be stickied.
 

Crow

New Adventurer
RiP
Joined
Feb 26, 2005
Messages
1,219
Reaction score
0
Location
YOU DONT GOT TIME TO MAKE A PROFILE
Terrain deformation is done quickest with the "Arrow Keys Nudge Vertex" option enabled (Tools->Options->[2D Options Panel]). You can then select the vertex to move in the 3D view, move the mouse to the proper plane in the 2D view (don't click, just hover), and hit an arrow key to nudge the vertex. With some practice you'll be able to do this without taking your eyes from the 3D view.


Holy shit.





This is awsome.
 

Stoned

New Adventurer
Joined
Jul 24, 2009
Messages
856
Reaction score
0
Age
28
Srgnt Rehab said:
Thothie said:
Terrain Deformation Method:

caves_tutor1.gif
various deformation examples

Would it be bad if I made all my rock walls like this?

I'm doing that in ecave and Thothie said it ran fine.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
It's ideal for rock walls, however, if it's going to be visible from multiple angles, like an outdoor cliff, you want to use a much larger grid than in these examples (32 or 64) and larger base blocks to boot. Don't do what Stoned did and overlap brushes or change methods in the middle of a wall or you'll get leaks and mystery missing faces.
 

Stoned

New Adventurer
Joined
Jul 24, 2009
Messages
856
Reaction score
0
Age
28
Thothie said:
It's ideal for rock walls, however, if it's going to be visible from multiple angles, like an outdoor cliff, you want to use a much larger grid than in these examples (32 or 64) and larger base blocks to boot. Don't do what Stoned did and overlap brushes or change methods in the middle of a wall or you'll get leaks and mystery missing faces.

Yeah, there are quite a bit of bad mapping habits in ecave. Is there anyway to fix missing faces?
 

jon50559

Adventurer
The True Followers of the Lost
Crusaders
RiP
Alpha Tester
MSR Developer
Joined
Mar 6, 2010
Messages
648
Reaction score
21
Age
30
Location
U S A
Delete and remake the brushwork, or if that still fails, alter it a little bit to simplify it.
 

J-M v2.5.5

BANNED
BANNED
Joined
Feb 26, 2005
Messages
5,675
Reaction score
1
Age
35
Location
Nijmegen, the Netherlands.
Whyyyyyyyyyyyyyyyyyyyy is this thread not stickied and whereeeeeeeeeeeeeeeeeeeee is Thothie's post or thread (forgot) that explains monster chaining in full detail?

I only remember there was a fancy tutorial picture with some wolves as example.

Edit: I found this ancient thread but I still vaguely remember a newer thread with MOAR info. Does anyone know where to find it?
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
I *think* this thread, and that one, are both linked in the mapping tutorial. I dunno where there's a more detailed link for monster chaining, beyond some with some additional pondering as to why exactly it buggers up.

The chaining monster spawns proper tutorial is a little dated however. I shall re-link image from said for reference right quick:

chaining_waves.gif

Two things be different.

For one, yer better off using the point entities: ms_monsterspawn and ms_counter, to save on resources.

For two, as be covered in the changelog, the default behavior when a monster spawn is deleted is no longer to delete-fade the critters tied to it. Rather, it just stops more from spawning. If you want the creatures to vanish when the spawn is deleted, you must add the "Additional Params" (params) "set_die_on_spawn_removed". Even then, the monster will either die when the spawn is removed, or fade, if he spawned <2 seconds ago (while still invulnerable). Either way, you aren't "robbed of xp" when the monster you were thwacking on has its spawn removed.

The fireallperish event on a monster spawn should still be viable, so long as it isn't activating another monster spawn, and so long as every creature tied to the spawn has the same number of lives.

If you want more details than that, feel free to ask, I just can't think of anything else pertinent, off hand.
 

J-M v2.5.5

BANNED
BANNED
Joined
Feb 26, 2005
Messages
5,675
Reaction score
1
Age
35
Location
Nijmegen, the Netherlands.
Heyyy I was helping someone attempt to fix his test map and I stumbled across this:
Thothie said:
Scaling, rotating, or otherwise moving terrain deformations of this type can result in deformed brushes that Hammer will fail to detect, causing visual artifacts, or mystery leaks.
Can moving even cause visual artifacts?
Also, some (thusfar undetectable) visportal errors popped up even though the newly made cliff ceiling/floor weren't moved at all after the vertex manipulation was done. Got any tips for combating these errors?
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
It can, as it's very easy to boff it up. If you move them while snap-to-grid is on, and the grid doesn't exactly match every vertex in the grid in all three dimensions, though the entire move, the individual vertexes will snap, often in fractions of a unit, causing imperceptible flaws in the design.

It's less likely to do this is if all units are on a very large, very simple grid (16 or 32) and not vertex manipulated in more than one axis. You can further mitigate the chances of this happening by temporarily turning off the snap-to-grid function and using the Ctrl-M manual move, instead of the click and drag.
 

Thothie

Administrator
Staff member
Administrator
Moderator
MSC Archivist
Joined
Apr 8, 2005
Messages
16,342
Reaction score
326
Location
lost
Talking with Crow, and recent nightmares with Oyster, reminded me that I've been meaning to tack this on to the caves tutorial for a long time:

Caves Tutorial said:
Key thing to avoid here is the "Chinese Fingertrap" effect. Don't use multiple wedges all joined at every angle stretching into unpredictable curvatures, or HLVIS's little mind will explode when you attempt to compile. The compiler thinks in box-like areas, try to work with it, rather than against it.

There's an exception to this, and that is if you can keep all the joints lined up in at least one plane (preferably two), and break them up into segments, then HLVIS's little mind will remain intact.

Which brings us to...

The Chinese Fingertrap Method

chinese_fingertrap.jpg

The Chinese Fingertrap method involves this beast:

chinese_fingertrap_segnment.png

Basically, a cave segment, made up of nothing but 4 face alternating wedges, with all the vertexes lined up on a 16 unit grid on either end.

The advantage to a 4 face wedge, is that you can twist it any which way, and it won't cause a malform brush.

You can scale, skew, and vertex manip the segments all you want, and it wont cause errors, nor leak, so long as all the vertexes line up at the mouth to each cave segment.

Thus you can do really nutty things, like this:

chinese_fingertrap_ss1.gif.png

Yes, those are all that same cave segment, including the bulbous room at the bottom, and no, it doesn't leak.

Advantages:
• Extremely flexible, very natural looking caves.

Disadvantages:
• Non-90 degree junctions are kind of a pain.
• Looks like ass in Hammer.

Plus, as with most of these caves, tunnel textures are hard to align.

Surprisingly it isn't too nasty on the clip node count, but if you are saving clip nodes by using a kinder -cliptype during compile, be careful that the caves don't become so narrow or so steep as to stop the player.

Mobs that don't jump will also have a rough time with these caves in laggy situations, so you'll need the usual 16-unit func_mosnterclip staircases used to deal with ramps.

The easiest way to vertex manip these batards, is to select two segments, hit Shift+V then drag out a box to select the joined vertexes away from the center:
chinese_fingertrap_anim3.gif
(Mind you I've the "Arrow Keys Nudge" option active.)

But if you don't have to make a hard turn, or make a room from them, skew works just as well without vertex manipulation, so long as it's on a 16 unit grid.

This particular segment won't work well for artificial tunnels, but those generally end at 90 degree angles, making this unnecessary anyways. You can, of course, make smoother, rounder, and more complex tunnels, the same way, but this is about as many vertexes as my eyes can handle. (Plus, you need to keep your floors flat, so as not to mess with your mobs).

Mind the four seemingly superfluous brushes on the outside of the cave segment in this particular example. Leave them - they are guides to make it possible to scale/skew the segment on a 16 unit grid. The compiler will discard them.

Example map, source, and related textures:
http://www.thothie.com/msc_dev4/chinese_fingertrap.rar

There's a lone example segment, sitting just NE of center.

chinese_fingertrap_akbar2.png
 
Top