Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 8th Sep 2013 14:45 Edited at: 8th Sep 2013 15:01
Hey everybody,

I have a question about dynamic terrains (do I use the right term?).

I see more and more indie games popping up with the ability to 'work the land'. Create mountains, valleys (which is not that hard) and dig tunnels (this is what I like to learn!). I do not talk about the minecraft cube terrain, but proper, smooth terrain with these abilities.

Is this possible with Darkbasic Pro? And if so, how would I approach this?


Greetings,
Kenneth

Regards Sph!nx
www.mental-image.net
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 9th Sep 2013 00:55 Edited at: 9th Sep 2013 00:56
Quote: "I do not talk about the minecraft cube terrain, but proper, smooth terrain with these abilities."

I do believe voxel terrains are most suited for that and these do indeed exist with "proper, smooth" looks. I'm fairly certain CryEngine 3 uses voxel terrains, or at least it could be choosen.

Making tunnels in a normal polygon-based mesh is also possible but it gets much more complicated to keep track of vertex positions as compared to a standard heightmap-style terrain (that only has varying Y coordinates). To do it you simply alter the X and Y coordinates of your vertices as well, and, if fitting, remove or add new vertices. This kind of work is probably best done in a 3D modelling program. Of course it can be done in DBPro as well, but it would be quite an ardorous project I believe.
Now that I think about it, I think T. Ed allows something like what I just described. You probably can't add/remove vertices but it does allow altering X- and Z positions. Maybe that is a place to start if those terrains look good enough for your purposes?



Edit: about the dynamic part, a terrain mesh where you can alter x, y and z coordinates would work exactly the same was as one where only the Y coordinates can be maniuplated. Since such terrains can be edited fast enough in realtime, this kind should be able to as well.


"Why do programmers get Halloween and Christmas mixed up?"
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 9th Sep 2013 02:14 Edited at: 9th Sep 2013 02:17
As Rudolpho said, a heightmap terrain system is pretty simple because you only need to modify Y positions for each vertex. I've created a terrain system for my engine that does heightmap terrain by creating 16x16 polygon flat plains and then using the vertexdata commands to deform the vertices. This is fast enough to be done in realtime, and looks good.

If you want to create a game that allows for dynamic manipulation of terrain height only, that's relatively easy and entirely possible in dbpro.

However terrain gets complicated when trying to create a system that can handle multiple layers. This includes tunnels, overhangs, land bridges, anything like that. Creating a system like this is complicated because it requires adding and removing vertices in realtime, and you can't rely on simply having 1 vertice for a given x,y position on a heightmap. I've yet to see an efficient system for terrain in dbpro that allows for this feature.

Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 9th Sep 2013 14:15 Edited at: 9th Sep 2013 23:25
Thanks for your replies guys, much appreciated!

Yes, I need a system that can add vertices. I do have an idea though.

- Create terrain (with heightmap) - easy
- Have a shape (let say a sphere) that functions as a digging, or cutting, tool.
- A hole get cut in the terrain mesh (size of the shape)
- new vertices will fill the hole in the shape of the cutting tool.
- The new "hole"-mesh will be added to the terrain mesh
- Repeat this process to dig tunnels, etc.

What do you think of this approach?

Edit:
I've know about voxels and understand that they can be smooth as well as blocks.

I've found an example for blocks:
http://forum.thegamecreators.com/?m=forum_view&t=187219&b=1

The idea for my game is that I create terrains for planets, thus spherical... Any suggestions?

Regards Sph!nx
www.mental-image.net

Login to post a reply

Server time is: 2026-07-07 11:21:35
Your offset time is: 2026-07-07 11:21:35