# Need some pointers on dynamic terrain

Hello fellow monkeys. I was hoping I might be able to get a few pointers from someone with a little more knowledge, or someone who has attempted something like this before. I have made quite a few games with Jmonkey now, and you all have been an amazing help! I have become incredibly adept at static worlds and games but here is my problem.

I am wracking my brain trying to find a good way to make a dynamic terrain. What I mean by this is a terrain that I could effectively remove “chunks” from similar to the style of minecraft. I have made procedural minecraft-esque world generators, and when everything is just a bunch of cubes, this is trivial. What I am going for is a world with that same type of digging and terraforming control but on a smooth surface. Now, I’m not coming and bugging you guys without doing some work first I have tried to implement a few different ideas and done a few thought experiments but nothing seems to work. Initially I tried to have an invisible voxel world, and then just generate a nice terrain over what would be the top layer of cubes, but the issue with that is find a fast and effective way to move these quads (which would make up the sudo terrain) upon the event that the surface has been changed.

This method wouldn’t work for any underground tunneling that my occur. Sorry for the rant, I am just trying to better explain what I am going for. A good example of the game I am working on is a 3d dwarf fortress, but I am trying to avoid having the world appear to be blocky. Any advice or pointers would be greatly appreciated. As it is now, I am doing some hard research into marching cubes and the like, hopefully I can find a way to manipulated a 3d density function and used a dumbed down algorithm to generate my terrain in real time.

Paragraphs

You need to think about what you are trying to achieve some more. For example will your world support caves?

If not then you can simply adjust the points on a hightmap up/down. If so then things become more complex.

Either way you are looking at defining a mesh for the surface of the world and then deforming that mesh as required.

Very hard topic, afaik @pspeed worked on stuff like that for more than ten years “on the side” to finally accept that blocks or “lego pieces” will probably yield better working results Haven’t really seen something like this in any game yet either. “From Dust” basically also uses a heightmap terrain for example.

Like zarch said, do you really need caves? If not then the TerrainGrid already support most of this out-of-the-box. For me I’m sticking with what is available (like terrain grid) since I’m still learning to create procedural terrain.

But you can of course make more advanced things if you put in the time, I thought thetouchers work was very impressive: http://hub.jmonkeyengine.org/groups/user-code-projects/forum/topic/terrain-side-project/

Yes, caves will be the very essence of the game. Thank you guys for your input! I understand the modification and construction of terrain and I have played with the terra monkey examples, so if push comes to shove I can axe the cave system. However, although this is a little complex I think I am going to try my hand at a more sophisticated marching cubes implementation. If it ends up not working for my game, hopefully it will be something you guys would enjoy having :). And The Toucher can do no wrong, haha, I will certainly look at his project. Thanks again.

Edit: Ahh that is amazing, and give me some hope, it looks like The Toucher was using a very similar algorithm (Marching Tetrahedrons) which will give much higher smoothness (not what I’m after). Looks like I may have a chance :).

To give a little more information I am trying to simplify the marching cube style of terrain generation to use it as a form of terrain modification. I believe if I localize the algorithm to work in small areas upon the even of a change, it should be incredibly fast… but may be prone to some serious side effects. I’ll keep you all posted.

1 Like

@Etane

hey i just read your article about proper threading and that you are working on a dynamic terrain. Me and a friend of mine just want to do nearly the same. I wonder how much you are into it yet and if we may exchange expieriences. I started a thread myself a while ago and I also read much about the marching cubes and even more advanced techniques.

http://hub.jmonkeyengine.org/groups/free-announcements/forum/topic/dynamic-infinite-procedural-voxel-terrain/