Terrain Tunneling/Arching

Feedback on past, current, and future development.
User avatar
Posts: 53
Joined: 07 May 2012, 01:16

Re: Terrain Tunneling/Arching

Post by SGMonkey » 18 Jan 2014, 20:21

I think the easiest and most practical way to do caves is the way its done with the landscape system in UE3. I really wish bethesda had taken up using this a long time a go as its so damn simple and removes all those immersion breaking loading screens.

Far Cry 3 does the same thing. You don't notice half the time that your under the terrain mesh.

About the 3:20 mark you can see a hole being painted on the ground.

User avatar
Posts: 1420
Joined: 26 Aug 2011, 02:04

Re: Terrain Tunneling/Arching

Post by Greendogo » 19 Jan 2014, 02:21

SGMonkey wrote:http://www.youtube.com/watch?v=HpTSK9aBP1c
About the 3:20 mark you can see a hole being painted on the ground.
That terrain editing is really slick. The various Unreal Engines seem to have a lot of really cool features.

User avatar
Posts: 3054
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: Terrain Tunneling/Arching

Post by raevol » 19 Jan 2014, 03:22

Greendogo wrote:The various Unreal Engines seem to have a lot of really cool features.
*drool* WOW. I love how much attention they are paying to lighting. I wonder how well this handles outdoor environments? UE tends to be for indoor-centric games, but they have made some pretty big maps before.

User avatar
Posts: 53
Joined: 07 May 2012, 01:16

Re: Terrain Tunneling/Arching

Post by SGMonkey » 19 Jan 2014, 06:39

EU4 is looking very promising. I just hope they allow access to C++ now hat they have done away with Unreal Script.

As for landscapes, both UE3 and UE4 can handle landscapes much bigger than what we've seen in any Bethesda game so far.

Also, the painting holes idea is a much better idea than voxels, at least in case for morrowind. Saves having to implement voxel terrain, plus you can stick to the heightmaps.

Posts: 44
Joined: 13 Mar 2014, 11:15

Re: Terrain Tunneling/Arching

Post by Antsan » 13 Mar 2014, 12:14

Voxel terrain isn't as unfeasible with high detail as it was once anymore.
Take a look here:
This guy is writing a fully procedural voxel engine. I think the terrain looks better than Skyrim.
Also the engine can convert back and forth between vertex and voxel data, so mappers can use whichever method they prefer. That also means that terrain need not be generated procedurally.
It comes with automatic LOD that scales better than LOD of meshes (at least that's the impression I got from viewing forests and buildings from a distance). This works by keeping the calculated voxels per screen space approximately constant independently of distance.
It also seems to run just fine on an average PC (of course there is no game running underneath in the demos). n the blog are also several posts highlighting games where the engine is going to be used, among them "EverQuest Next".
The engine is only in charge of generating geometry, if I remember that right, so using some arbitrary rendering engine on top shouldn't be a problem.

The whole thing unfortunately is not open source. It makes heavy use of OpenCL and throughout his posts he describes the technical aspects of what he is doing.

Not that I think you should try to recreate his work. I guess you've got better stuff to do.

Posts: 401
Joined: 21 Dec 2013, 22:18

Re: Terrain Tunneling/Arching

Post by SquireNed » 13 Mar 2014, 18:24

The problem with adding voxel support is that it's extra functionality not in Morrowind. It might come post 1.0, but it's not something OpenMW is terribly concerned about unless it would impact the game, and the old "add a mesh and put it in" is probably simpler than going into voxel work just for that purpose.

Posts: 4
Joined: 26 Apr 2012, 08:43

Re: Terrain Tunneling/Arching

Post by asmageddon » 03 May 2014, 15:41

Honestly, basic voxel meshes border on trivial, in the simplest case all you need to do is copy-paste some open source code for marching cubes, and perhaps adapt it a slight bit to whatever data format you're using.

As for performance, they can be fast, very fast, consider that in Minecraft, in the worst case, the meshes are regenerated 20 times a second in the worst case, and besides, due to the fact that they can be modified, the chunks are small, and bigger meshes = more performance, because you can optimize vertice order to be more cache friendly, you can render them in less draw calls, and well, you get the idea.

The biggest problem is that you probably want LoD, and transitioning between levels of details is much more than a trivial algorithm, though it's still been done, documented, and has tables for all the cases that you could freely use(dual marching cubes).

That said, marching cubes result in tons of triangles, many of which are not necessary, if you're good at 3D math, you could probably find some articles on mesh decimation and implement that. Still, with big-ish chunks, and/or not a lot of voxels used(say, only used for caves, arches, etc.), performance should not be a huge problem.

As for how to use them, you could always combine them with the heightmap based terrain - treat above ground as empty unless specified for voxel meshing purposes, and below as ground unless specified, and just cut holes in the heightmap terrain. As far as I'm concerned, marching cubes produced meshes always contain the midpoints of the grid for "full" blocks, so you could just render one voxel thick outline around the voxel-enabled sections, and render the terrain grid halfway into it(say, if voxel/heightmap grid is 20cm, render the edges of heightmap terrain 10cm inwards)

Sorry if I'm being a bother, just wanted to say my perspective on this, being both a voxel and Morrowind fan.

User avatar
Posts: 58
Joined: 19 Mar 2013, 09:13

Re: Terrain Tunneling/Arching

Post by Markelius » 04 May 2014, 18:34

The question still remains, could some functionality for adding "holes" to the terrain be added, even before 1.0? I don't see this affecting the vanilla game at all and doesn't seem like it would be a difficult feature to add.
Known as starwarsgal by the Morrowind Modding community.
modding tumblr | bethsoft forum profile

User avatar
Posts: 2157
Joined: 07 Aug 2011, 17:21

Re: Terrain Tunneling/Arching

Post by sirherrbatka » 04 May 2014, 19:12

could some functionality for adding "holes" to the terrain be added
It is possible.
even before 1.0
This is not possible. We will have 1.0.0 out rather soon so we lack time to implement this. Also, even if somebody could do this fast, it would be useless without editor. Currently editor has rather small team of Zini, me and graffy. I can't do a lot with my skills right now (yes, i'm learning but that takes time), graffy is often busy and this leaves only Zini who is superb programmer but on his own he won't be able to finish everything in the opencs before openmw will reach 1.0.0.

Posts: 11
Joined: 04 Jun 2012, 08:32

Re: Terrain Tunneling/Arching

Post by Ruarl » 09 Jun 2014, 18:54

Normally height maps can be expressed as a .bmp file, with a 0 - 255 Grayscale value that presents the height (the (z) axis) Thus a darker color is a low altitude and a light color is a high altitude or that is how I understand it.

One way to add overhangs, tunnels, ect. is to split the Grayscale image into a RBG image, thus you get two more values to use in the (z) axis, and use it as such:

Red channel == Normal height map as commonly used.
Blue channel == Cave/Overhang "ceiling"
Green channel == Cave/Overhang "floor"

See the embedded picture for more details...
The Illustration of the Overhang
Example.png (2.07 KiB) Viewed 3828 times
Short explanation how it might be coded:
Spoiler: Show
You can also attach a different texture to each z value (Color Channel).

And there you have it! :D An easy way to add a cave/overhang on a height map (I think). (Since Morrowind uses a different way to store map data, you will need to add two more values and use it as explained above.)

Theoretically you can use this to create seamless interiors, but I don't think that will be wise, since this does not allow you to create more than one cave over another. That requires advanced code. But it can be used to create a small single room cave that is hidden from view and some sorely needed overhangs. Now a modder does not need to create a bunch of meshes/objects that will only be used once in his landscape. I suspect the people in tamriel rebuilt will love this feature.

This is a more compact version of Greendogo's three height maps idea that was mentioned earlier in this thread.

TLDR: Add two more z values to create overhangs and caves on height maps.

Post Reply