Outerra forum

Outerra Engine => Technology => Topic started by: ZeosPantera on June 30, 2010, 02:26:53 pm

Title: Tunnels and Caves.
Post by: ZeosPantera on June 30, 2010, 02:26:53 pm
I know in most engines the creation of tunnels and caves is a painstaking process of fakery and models made to look like mountains..

(http://media-cdn.tripadvisor.com/media/photo-s/01/06/39/85/malinta-tunnel-entrance.jpg)

How does this engine handle things like ... well tunnels and caves.
Title: Tunnels and Caves.
Post by: cameni on June 30, 2010, 03:04:33 pm
In fact I don't know how other engines are doing it and "models made to look like mountains" quite surprised me.

I think there are two things needed here. First is removing the terrain mesh around the hole so it doesn't occlude it. Now, the road system allows to place different materials on the terrain, and there is also a special case that allows to remove triangles from the mesh (placing an invisible material). So making a tunnel will consist of placing patches for erasing the terrain at the holes, and putting tunnel entrance models there. Insides of the tunnel will be generated as an enclosed bridge (not yet ready). Physics-wise the invisible material won't intersect with anything.

Caves should be done similarly except the modeled or generated cave areas should fit to the hole in a natural way.
Note also that the hole, being essentially a vector patch, will have the same attributes like the road system, namely the ability to blend into the surrounding terrain so the hole can be shaped as desired and it should look properly on the terrain, not just like a cut out mesh.
Title: Tunnels and Caves.
Post by: MatthewS on June 30, 2010, 11:01:26 pm
Will you be able to texture the tunnel interior with different textures?  

I'm thinking of subway tunnels where some parts might be brick and other parts might be concrete.
Title: Tunnels and Caves.
Post by: RaikoRaufoss on July 01, 2010, 12:40:45 am
Related question: how will textures in caves/tunnels appear if no texturing is done by humans?  In other words, if I make a tunnel through a hill and leave it the way it is, what will it look like?
Title: Tunnels and Caves.
Post by: ZeosPantera on July 01, 2010, 01:18:35 am
Quote from: RaikoRaufoss
Related question: how will textures in caves/tunnels appear if no texturing is done by humans?  In other words, if I make a tunnel through a hill and leave it the way it is, what will it look like?

I imagine it would either default to raw stone all the way around or the floor may act like the ground outside and have grass on it. They will probably write in a stalagmite-tite auto-generator for caves. This aspect really interests me because it is lacking from most open world environments.

I may start a new topic if the answer is relevant but how is water handled? The landscape is surprisingly dry in the screens and videos considering the oceans are right around the corner. Thought of underground rivers and such.
Title: Tunnels and Caves.
Post by: cameni on July 01, 2010, 02:54:32 am
The interior of a tunnel will be generated from predefined segments that follow a curved path; the same technique will be used for bridge roads and railroad tracks.

So if you are making a tunnel, you will have to select a profile that includes the segment geometry - thus there will be no untextured tunnels. The profile type can be changed at the spline points, just like with the roads.

Caves are different, we will need a cave generator of some kind.

Water currently only includes flat seas. That's because there's no wind, you know :D

Looking from Alcatraz to where the Golden Bridge should be:
(http://www.outerra.com/shots/k285.jpg)

(http://www.outerra.com/shots/k286.jpg)
Title: Tunnels and Caves.
Post by: MatthewS on July 01, 2010, 07:58:20 pm
Quote from: cameni
The profile type can be changed at the spline points, just like with the roads.

Ok... and this would work for runways/taxiways/aprons too?  Each segment can have its own texture so you might have a asphalt runway but concrete taxiway/apron.   Sounds flexible.
Title: Tunnels and Caves.
Post by: Vicious713 on January 19, 2011, 02:50:05 am
I've seen various engines do tunnels like this, and it does indeed strike me as a pain when it comes to custom map making. The idea of 'removing' patches in the terrain and filling it in with a model is an old one, and has been used in engines to this day. This would work fine for tunnels, seeing as that's pretty much a metaphore for tunnels in real life, however i think for caves it could be handled differently.

Since halo is pretty much all 3ds max, theres no real terrain in the game, just all 3d models, however in Unreal, one would use this technique of filling in the hole in the terrain with a model that resembles the terrain and inevitably leads into a cave. The entirety of the cave would be custom modeled, or a combination of various rock meshes thrown together to look like an enclosed area. In Half Life and Source powered games, this is all handled a little different, i believe the Terrain is generally handled as bsp. You can take blocks of bsp and convert them into an editable mesh, and people have used that for everything from curved walls to destroyed looking bridges, and of course, caves and tunnels.  I personally have no expierience with Cry Engine, so i can't say if it handles it differently.

In short i don't think theres a single engine at the moment that has the capability to making it's own cave, and on another note, what if one were to make a cave or tunnel under water, how would the engine know to place an air bubble down there? Surely somebody will inevitably want to make "Rapture."


As far as ideas to solutions, perhaps if you took some of these heightmaps and applied them to a cylindrical mesh. This could work, perhaps, untill it gets to branching tunnels apart..

Perhaps you could take vectored paths, generate cylinders around them, and then apply height maps to the insides of those. It'd have to use some kind of means of knowing how to unwrap itself i'd suppose, but being an artist, i'm just tossing out ideas, i've little expierience as to the tech that would have to be implimented behind this. I can keep going if you think it's getting somewhere though, i love learning more about the limitations of programming, it helps me gear art more towards being a little more programmer friendly, haha.
Title: Tunnels and Caves.
Post by: cameni on January 19, 2011, 06:49:09 am
Quote from: Vicious713
I've seen various engines do tunnels like this, and it does indeed strike me as a pain when it comes to custom map making. The idea of 'removing' patches in the terrain and filling it in with a model is an old one, and has been used in engines to this day.
Um, I was actually describing what engine would do with the terrain, not that it will be a process undergone by a modeler. Custom map making will mean using in-engine tools to mod the existing generated terrain. In case of tunnels it will be probably like defining a road spline with tunnel geometry generated around it, and the entrances will come from custom models. Fitting it to terrain geometry will be automatic.

Caves could use two oppositely placed matching heightfields (or an interconnected series of them), a generator could output these along with an entrance fittings to the above ground terrain (and in between the cave parts).
Title: Tunnels and Caves.
Post by: Vicious713 on January 19, 2011, 08:41:45 am
Aaah, yea, splitting the top and bottom half of the cave definitely solves branching tunnels!
Title: Tunnels and Caves.
Post by: monks on March 31, 2011, 09:37:12 am
Very interesting thread. The idea of re-using the code for the vector roads is the obvious way to go if possible. I liked Zeos Pantera's thinking on this. What I'd like to be able to do is input a tunnel map as a vector network. Then have the engine autogen the tunnels. I've got a keen interest (obsession heh) with Middle Earth, and if anyone is finally to do something like Moria justice, then you need imo, vectors (with z of course- not all formats support per node elevations) and autogen.
 Have you thought of using a GIS industry vector format such as the shp file Cameni? It would make the use of real world datasets of many kinds (street maps, veg distribution, climate, geology, weather) a breeze if you had support for that. Last I heared the guys at Planetside (Terragen) were asking users about shp support in the future. Their's is also a procedural planet renderer with dem support and shp make sense for a few reasons.

 There's also vector maps of real world cave systems out there.

 Faking it with models of mountains is such a naff, and I imagine, incredibly innefficient way to do things. It's about time the world moved on. We had a discussion over on Ogre forums about this a few years ago, but nothing major really came from it- apart from a few cool and interesting experiments.

 The procedural creation of stalactities and stalagmites would make for a sublime engine. I've got maps for vast underground networks, Moria one them, and I can't imagine the fun I'd have creating that  :D
Title: Tunnels and Caves.
Post by: cameni on March 31, 2011, 12:18:47 pm
I guess supporting shp won't be a problem, or rather it's the least problematic part :)

We obviously have to process the vector data internally into a format suitable for the hardware and effective with the large areas. Currently it's a one way conversion, as there are no tools that can be used to edit the paths once created, or once imported. We need to add some back-end support for it, but mainly it's about proper UI.

There are also some unclear parts about how to handle tunnel intersections, when some path passes close to another (or to itself). How the generator should handle it. And the collision handling then.
IMHO the random intersections should be disallowed - i.e. it should not be possible to "touch" or intersect tunnels else than with controlled connections between them, that will have some limitations. This won't apply to sections that were created from two opposite heightfields, which are considered one tunnel.
Title: Tunnels and Caves.
Post by: monks on March 31, 2011, 01:54:59 pm
It's clear that you're pretty forward thinking around here ;) I guess it would be down to the user to avoid the bad intersections.

   I did experiment using some caving software a number of years ago now, and was able to create stuff by faking the survey stations in the input file, but I gave it up because the UIs and renderers were not there. It was tedious. There are a few renderers out there that convert cave data to simple models, but they're not too pretty  :|  as you would expect.

 For any one who's interested you can see the kind of tools cavers use here
http://fountainware.com/compass/

 I'm pretty sure the survey stations in rw cave data just act like nodes. Compass uses svg to export to 2D topo maps, but I seem to remember svg doesn't support per vertex z info.  World Machine supports svg and it's use was limited by that. The dev said he'd like to include shp support at some point. I know that Compass does support kml and shp file export of cave survey data. So it would be possible via that route to get rw cave systems into OuTerra should you decide to support shp.

 Well, it's an option but users wouldn't necessarily want to include rw cave systems anyway; they're a bit chaotic! I think it would be much more fun designing layouts.
Title: Tunnels and Caves.
Post by: ZeosPantera on March 31, 2011, 04:18:54 pm
If natural caves exist. Then they should be in Outerra. No point in not including something at this point especially since planet rendering and using vector data is what this engine is all about. I still want to see how rivers and other water bodies get handled before caves.
Title: Tunnels and Caves.
Post by: Spudly on April 20, 2011, 12:34:21 am
Quote from: cameni
The interior of a tunnel will be generated from predefined segments that follow a curved path; the same technique will be used for bridge roads and railroad tracks.

So if you are making a tunnel, you will have to select a profile that includes the segment geometry - thus there will be no untextured tunnels. The profile type can be changed at the spline points, just like with the roads.

Caves are different, we will need a cave generator of some kind.

Does this mean that you could actively carve your own tunnels by hand?  It would be really cool to have the ability to build underground.  Using profiles you could probably also switch from unsuspecting cave entrance to cement bunker walls.

Maybe you could procedurally generate resource veins that you might stumble upon or survey for.
Title: Tunnels and Caves.
Post by: cameni on April 20, 2011, 01:19:58 am
Quote from: Spudly
Does this mean that you could actively carve your own tunnels by hand?
Eventually, yes. Normally there will be a design mode where you can draw tunnel paths and then have the generator build them, but it can be also made to work incrementally in a game mode.
Title: Re: Tunnels and Caves.
Post by: mrsquish on February 20, 2013, 06:12:03 pm
Not quite on topic, but along a similar vein. Will it be possible to push and or pull the terrain to model things like bull dozers etc.
Title: Re: Tunnels and Caves.
Post by: Edding3000 on February 20, 2013, 07:00:24 pm
Not quite on topic, but along a similar vein. Will it be possible to push and or pull the terrain to model things like bull dozers etc.
I cannot answer this 100% sure, but i guess: yes.
Title: Re: Tunnels and Caves.
Post by: monks on May 07, 2013, 06:04:47 pm
I imagine it's fairly straightforward to generate tunnels procedurally from vector input (he says!  ;D )- especially if you had a design mode. But, why not initially save yourself the work and just import from external formats? I can see though that most people would want an internal editor (maybe in the editor you could see the above ground location and how the underground stuff relates to the position- with some control over the opacity of the overlay). Procedurals on vector input I think is the only way you're going to be able to generate content on Outerra scale.
 
monks
Title: Re: Tunnels and Caves.
Post by: PytonPago on May 08, 2013, 04:16:02 am
 ... i just got a little thought, as there will be caves and for antenworld there will be a mining-system needed, it would be interesting to simulate raw resources. Making a set of nice textures of several resources (coal, ferites, antracites etc.), wich would be possible to mine. As for my idea, if textures made very nicely, i would like to have some kind of information-captions existing. Just looking at the right texture from a limited distance, pressing the caption-key and it would show the type of it ( Magnetit --- (Fe2+/Fe3+)2O4 ) where the rough chemical composition would be nice to have with it. It could be an overall OT function showing such captions for objects and other stuff, maybe even a little funny or sarcastic ones by special, or random objects (looking at dirt - "dirt, dirt, dirt and some more dirt. VERY interesting to look upon." and such  :D). Maybe even a series depending on how often you look at a the same object. Some interesting info about some mined minerals/resources whyte photos : http://www.fns.uniba.sk/index.php?id=4121 (http://www.fns.uniba.sk/index.php?id=4121) ... Would be even more interesting and informative to go mine some Antimonit than just saying stibium, sulfur, iron, and so on, whyle getting the people and community get some chem. composition feeling of reality.
Title: Re: Tunnels and Caves.
Post by: monks on May 08, 2013, 04:49:01 am
Yes that would add another dimension to the game and you could extend that to other resources such as fungus... Maybe more useful for a fantasy type game for alchemic ingredients and stuff. ;)

monks
Title: Re: Tunnels and Caves.
Post by: Sunnyyello on May 09, 2013, 06:55:08 pm
It would be pretty cool to build my house on top of an underground fortified bunker...Bruce Wayne style!  8)
Title: Re: Tunnels and Caves.
Post by: PytonPago on May 10, 2013, 02:34:00 am
It would be pretty cool to build my house on top of an underground fortified bunker...Bruce Wayne style!  8)

And hawing the Maginot line for a perimeter fence!  ;D ... would be nice to have stalaktits/stalagnits being generated too. If the mineral-texture way would be made, it could depend on calcium minerals presence in caves. ... would simplify the Dobšiná style cave creation  :D.