I have a few questions for the terrain.

As far as I understood there is the TerrainPage which should be used for large terrains for better culling.

Now the terrain can be generated with multiple ways. However all ways are flat.

What I mean is that you cannot describe a cave/tunnel in this terrain.

So the questions goes as follows:

  1. Is there a better way to make the caves/tunnels other than building multiple terrains? (One over the other)
  2. How do I export a generated terrain for a later use. Let's say i made a terrain editor in JME, I drag and drop with the mouse and morph a terrain. Then I want to save it. Also what will be best format to save in performance wise?

    PS. Due to my game design I cannot have the caves/tunnels as other node models and have collision detection to pass through since I want the terrain to be changed dynamically while the player is playing. So I'd rather seve a heightmap (image) rather than a whole model.

I believe one way to achieve this is by having 2 heightmaps.  One for the terrain and another for caves and such.  But I may be all-wet here…

using 2 heightmaps won't work. you would at least need 3. with 2, the "ceiling" of your cave would be flat, which would look lousy at the entrance.

the best way i can think of is to make ur terrain a model intead of using the terrrain generation classes in jme. model it in maya and export it into jme.

for the format issue, u can simply use BinaryExporter to export ur terrrain node into a binary format. in the future u can just use BinaryImporter to load it in as a node or whatever u saved it as.

What about just putting a 'ramp' down with the terrain and a model cave entrance??

We use a triangle mesh for our earth skin state.  Currently I have it subdivided into a quad tree for scene culling, but we have triangle cutouts for areas that go underground and have separate mesh's for tunnels, caves, highway 'underpasses', etc.

If you want to stick with heightmaps ( and not use any of the CLOD stuff for the time being ) then you could extend the TerrainBlock to not tessellate triangles for certain height values (say 0), then you could attach a second mesh node (say… plain jane TriMesh) at the precise point where the terrain hole is and you'll have your cave.

I think i'll just extend the terrainblock class and make it to built a multi layered terrain block

by using multiple layers (TerrainBlocks) we should be able to draw not only a cave but also a cave with different levels like a dungeon.

i'm getting exited now  :evil:

Anyway if I manage to do it you will see it in the user code  :slight_smile:

I also saw the Terra thingy made by Llama which loads the terrain dynamically which is pretty kewl and solves my question 2.  :smiley:

for now i need to find free time  :wink:

In any case thanks for all your ideas. :smiley: