L3DT users' community
Large 3D terrain generator

Caverns and Tunnels?

Got a problem or need advice?

Caverns and Tunnels?

Postby nicethugbert » Tue May 11, 2010 2:50 pm

Has anyone had any luck making caverns and tunnels in L3DT? I can see a huge "market" in caverns and tunnels. I'm not aware of any 3D tool that makes then.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby David Walters » Tue May 11, 2010 4:00 pm

L3DT only supports single height samples per position, so caverns and tunnels are not immediately possible.

Perhaps you could design a system (outside of L3DT) that rendered multiple sample layers? - say by using even numbered layers as upside down 'underground' layers. Something like that might be a fun project but would be pretty limited and potentially quite wasteful in terms of memory unless you handled empty regions somehow.

Authoring these caves would be hard to find tools for -- but some algorithm to generate stalagmites and stalactites would probably be relatively simple -- but you wouldn't get any anglular shapes there so it'd look kind of weird probably. But you'd be able to get the basic shapes there before adding some detail models to it.

Personally I think if I wanted to support caverns I would switch out (or just overlay) patches of ground with a traditional 3d mesh. That would also let you have a lot of localised detail independent of the terrain's horizontal spacing - which would probably be more desirable for a cave, tunnel, dungeon, etc.

For organic shapes like you'd find in caves - perhaps take a look at the growing number of sculpting apps that are coming out, e.g. Scultpris, Blender, 3D -Coat, Z-Brush, etc.
David Walters
Doyen
 
Posts: 129
Joined: Fri Apr 24, 2009 1:10 pm

Postby nicethugbert » Tue May 11, 2010 6:03 pm

I forgot about the ceiling. There is a way to make underground ceilings in NWN2. So, what I really need is the ground. I guess what I need is something like a high density low narrow, but not necessarily short, mesa effect.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby Aaron » Tue May 11, 2010 10:01 pm

Hi Nicethugbert,

To make caves of acceptable quality, you really must build them as a 3D mesh model...which of course means using a 3D modelling application, such as Blender.

I've seen some renderers where they use a stack of three heightfields for the cave floor, cave ceiling, and then terrain above. However, it's just a kludgey way to make caves. The main problems are that the multiple heightfields are difficult to build, waste an enormous amount of memory (think about the required pixel density for a cave!), difficult to texture well, and are restricted to simple one-level caves without any twisted geometry.

Because of these limitations, hardly any applications use this method to represent caves. Consequently, I have no intention of adding support to L3DT for caves by the multi-heightfield stack method. I may, at a future date, add support for 3D mesh caves, but that's a lot of work, and there are much greater priorities on the list right now (e.g. forest rendering).

Regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby nicethugbert » Wed May 12, 2010 2:50 am

I don't need multi-level maps. I want to make maps look like a cavern and tunnel system, minus the ceiling. I want close rock formations and paths between them. The ceiling is not important. There is a trick to making them in NWN2. I forgot the relevant key-words so I can show you a sample.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby nicethugbert » Wed May 12, 2010 3:26 am

Hmm, I wonder if I can fake it by experimenting with the horizontal scale and resizing the maps.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby Aaron » Wed May 12, 2010 10:47 am

Hi Nicethugbert,

L3DT's terrain algorithms really weren't designed for this purpose, so you may find it quite difficult to get good results in turning automatically-generated terrain into a cave network.

You might have some more luck using the 'lower-to' heightfield brush in the 3D editor, as this was designed for digging trenches. It will produce a flat-floored trench with sloped edges.

If the editor is a no-go, it's conceivable you might (with quite some effort) be able to build a calculation graph using ZeoGraph to automatically build cave networks for you. Most of the standard calculation filters are now available (perlin, resize, clip, clamp, scale, etc.), and for those that aren't, you could always use the script filter to perform custom operations. With scripting, you do have full control over the heightfield. It's no walk in the park, however.

Cheerio,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby nicethugbert » Wed May 12, 2010 1:43 pm

Can you reference the DM map squares in Zeograph or Zeoscript? Can you use the actual noise strength value in Zeograph or Zeoscript?

I tried the brushes. It's slow work and it just doesn't look right, too smooth or too rough or other kinds of wrong. I'm not an artist by the way.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby lmaceleighton » Thu May 13, 2010 4:48 am

What game engine are you using? Aaron is right though, making caves in the way you make terrain is really not a good way to go about it...BUT you can do this: Use L3DT to make the layers in the way that was mentioned above, then export the layers to a Modeling app. That will give you the dimensions you want and the freedom to link the pieces together permanently, Texture them properly, and the take out the unnecessary parts that you don't need. Really a Modeling App is the way to go, and if you use Torque, there is an option to make "holes" in the terrain, which is where you would want you cave entrance to be at:O) Hope this help some, as I have built many a cave in games before:O)
User avatar
lmaceleighton
Contributing member
 
Posts: 41
Joined: Tue Mar 11, 2008 3:39 am
Location: Bangor, ME(Veazie)

Postby Aaron » Thu May 13, 2010 2:01 pm

Hi Nicethugbert,

nicethugbert wrote:Can you reference the DM map squares in Zeograph or Zeoscript?


Ooh, good question. In ZeoScript you can access the pixel values of maps. However, at this moment, the pixels values for design maps cannot be accessed because ZeoScript does not have a declared datatype for design map pixels. At the next available opportunity I will add some functions to ZeoScript and filters to ZeoGraph to compose/decompose the design map from/into separate map layers. These map layers will be heightfields (for the altitude layer) and byte maps (for the other layers), which can be accessed and manipulated in ZeoGraph and ZeoScript. When you're done playing with the layer pixel values, simply re-combine it into a design map, and away you go.

Thanks for the suggestion/reminder.

nicethugbert wrote:Can you use the actual noise strength value in Zeograph or Zeoscript?


For certain definitions of the word 'use', yes. You certainly can apply your own noise peak overlays, where you control the radius, height and position of each peak directly. Ditto for the terraces, perlin noise (including the Perlin noise bomb used for the 3D brush), smoothing, etc. The fractal roughness is still set by the design map, but if I make the above changes, you'll be able to access that programmatically also.

Regards,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby nicethugbert » Thu May 13, 2010 4:18 pm

lmaceleighton wrote:What game engine are you using? Aaron is right though, making caves in the way you make terrain is really not a good way to go about it...BUT you can do this: Use L3DT to make the layers in the way that was mentioned above, then export the layers to a Modeling app. That will give you the dimensions you want and the freedom to link the pieces together permanently, Texture them properly, and the take out the unnecessary parts that you don't need. Really a Modeling App is the way to go, and if you use Torque, there is an option to make "holes" in the terrain, which is where you would want you cave entrance to be at:O) Hope this help some, as I have built many a cave in games before:O)


I'm using NWN2. I agree that it's not a good way to go about making caverns/tunnels. But, that's a limitation of NWN2. The walkmesh does not support multi-valued z coordinates or however else you say overlapping walkable elevations.

In NWN2 underground areas are officially done using interior areas. Interior areas use tilesets. Exterior areas are brushed, not tiled.

You can make excellent underground areas in NWN2 using exterior areas, but you have to hang something over the area to cover the sky. But, the developers or publisher didn't think of this or care for it so they didn't make it easy. The technique for making underground areas using exterior areas was discovered by a player/modder but I forgot who and I haven't found the demo yet.

I think you can have a mix of above ground and below ground areas in an NWN2 exterior area. But, you will not be able to walk over the underground area. You'll have to put a shear face, or other suitable impassable terrain, over it to make it blend in and keep creatures off. So, you'll be limited to that.

But, it's much better than using tiles. Tile are too monotone, or discrete, in dimension, like legos.
Last edited by nicethugbert on Fri May 14, 2010 12:51 am, edited 1 time in total.
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby nicethugbert » Thu May 13, 2010 6:17 pm

aaron wrote:Hi Nicethugbert,

nicethugbert wrote:Can you reference the DM map squares in Zeograph or Zeoscript?


Ooh, good question. In ZeoScript you can access the pixel values of maps. However, at this moment, the pixels values for design maps cannot be accessed because ZeoScript does not have a declared datatype for design map pixels. At the next available opportunity I will add some functions to ZeoScript and filters to ZeoGraph to compose/decompose the design map from/into separate map layers. These map layers will be heightfields (for the altitude layer) and byte maps (for the other layers), which can be accessed and manipulated in ZeoGraph and ZeoScript. When you're done playing with the layer pixel values, simply re-combine it into a design map, and away you go.

Thanks for the suggestion/reminder.

nicethugbert wrote:Can you use the actual noise strength value in Zeograph or Zeoscript?


For certain definitions of the word 'use', yes. You certainly can apply your own noise peak overlays, where you control the radius, height and position of each peak directly. Ditto for the terraces, perlin noise (including the Perlin noise bomb used for the 3D brush), smoothing, etc. The fractal roughness is still set by the design map, but if I make the above changes, you'll be able to access that programmatically also.

Regards,
Aaron.


NEAT! Will this allow me to solve the protrusions/depressions problem I've been having?

I suspect that the solution to my protrusions/depressions problem is something like:
Code: Select all
for(each DM pixel)
If(noise amplitude < 0)
{
  reduce terracing locally;
  //or other ops;
}


I am assuming that the noise equation operates on each DM pixel and produces a single value for each.

Will the upcoming Zeograph additions let me do this?
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby Aaron » Thu May 13, 2010 10:59 pm

Hi Nicethugbert,

Will this allow me to solve the protrusions/depressions problem I've been having?


It will allow you to try to solve the problem, yes.

I am assuming that the noise equation operates on each DM pixel and produces a single value for each.


Alas, it's not that easy. The peak values in the DM pixels range from 0 to 255, and represent a strength, in arbitrary units. The peak noise overlay uses this to generate, for every pixel, between 0 and 100 peaks. The amplitude of the peaks is in the range of up to plus or minus 150 metres, but with a complex distribution that's dependent on the horizontal scale, and is skewed towards the lower (i.e. closer to zero) height ranges. As mentioned previously, the polarity of each peak may be flipped as required to maintain (almost) zero net displacement.

You may be able to limit the terraces when the magnitude of the peak noise is large, but not when the noise amplitude is negative, as that's not stored in the design map, but generated on-the-fly for each peak.


Thinking about it some more, what I guess you need is a way to swap-out the default peak noise generator and replace it with your own, without having to replace the rest of the terrain generator sequencing. I'll have a look at modifying the DesignInflate plugin so that when it comes to generate peak noise, it will look for your custom script and run it if found, and if not, run the default peak generator. Your script would then have full responsibility for and control over every noise peak placed on the map. Would that suffice?

Will the upcoming Zeograph additions let me do this?


ZeoScript will allow you to do this. ZeoGraph is not so useful for per-pixel custom logic operations, unless you're using the script filter, in which case it's just ZeoScript anyway.

Cheerio,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby nicethugbert » Fri May 14, 2010 1:16 am

aaron wrote:Thinking about it some more, what I guess you need is a way to swap-out the default peak noise generator and replace it with your own, without having to replace the rest of the terrain generator sequencing. I'll have a look at modifying the DesignInflate plugin so that when it comes to generate peak noise, it will look for your custom script and run it if found, and if not, run the default peak generator. Your script would then have full responsibility for and control over every noise peak placed on the map. Would that suffice?


I think that would be very useful even if I can't use it. So, I don't want to reject this feature. You're noise function is much more involved than I suspected and, setting aside my depressions/protrusions problem, does very good work. But, I liked the results when you shunted the negative values in your "Moria" experiment. What I would do with this proposed feature is call your noise function and do something simple like cut the positive peaks to a 5th and the negative peaks to a 10th or something like that before I go and replace entire stages of the process. I would even put a null function so that I can observe what happens in the absence of noise.

What about comparing each HF pixel to it's corresponding DM pixel? The negative noise affected HF pixels are lower than their corresponding DM pixel? What could I do to them then?
nicethugbert
Doyen
 
Posts: 132
Joined: Sat Feb 02, 2008 12:58 pm

Postby Aaron » Thu May 20, 2010 10:41 pm

Hi nicethugbert,

aaron wrote:At the next available opportunity I will add some functions to ZeoScript and filters to ZeoGraph to compose/decompose the design map from/into separate map layers.


Done! The new ZeoGraph filters are 'DesignMap.GetLayer' and 'DesignMap.SetLayer', and the ZeoScript functions are 'calc.DM.GetLayer' and 'calc.DM.SetLayer'. They are available in the second beta release of L3DT v2.9, which is on the downloads pages now.

The functions/filters all take a 'LayerID' argument, which identifies the layer in the design map you'd like to get/set. Layer 0 is altitude, 1 is peak roughness, 2 is fractal roughness, and so in (in same order as given in design map brush). The altitude layer is get/set using a heightfield map, whist all other layers are get/set using a byte map.

Regards,
Aaron.
Last edited by Aaron on Mon Aug 23, 2010 9:57 pm, edited 1 time in total.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Next

Return to Help and support

Who is online

Users browsing this forum: No registered users and 12 guests