Jump to content
  • Advertisement
Sign in to follow this  
glhf

How do you create terraforming in games?

This topic is 2277 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What is the code design you need to create terra forming?

Like for example digging a hole in the ground?

I know a easy way to do it is making everything made of blocks..
But it's ugly and I don't like that.. and I guess that making microscopic blocks would be way too expensive on performance.

Like imagine a ground terrain... It's made of a plane mesh. If it's completely flat it's just 4 vertices.. but if it's not flat it has a lot more.
So if someone start to dig in the ground.. it should create vertices in the plan where he is digging.. and extrude them?

Share this post


Link to post
Share on other sites
Advertisement
You could use a heightmap for the terrain, (it is quite easy to raise/lower the ground then) (allthough if you want to dig tunnels its not really working)

Edit: You could also use medium sized cubes/voxels for the internal representation but render a smoothed version of the terrain instead (using for example metaballs) (This would work for tunnels but requires quite a bit more horsepower to render, with decent culling it should be a viable option though)

Share this post


Link to post
Share on other sites

You could use a heightmap for the terrain, (it is quite easy to raise/lower the ground then) (allthough if you want to dig tunnels its not really working)


I'll look into heightmaps but yeah... I think digging tunnels is important.

Is it possible to create new vertices in a mesh? I mean when the player is playing the game. And then alter the vertices.

Share this post


Link to post
Share on other sites

[quote name='SimonForsman' timestamp='1335040605' post='4933598']
You could use a heightmap for the terrain, (it is quite easy to raise/lower the ground then) (allthough if you want to dig tunnels its not really working)


I'll look into heightmaps but yeah... I think digging tunnels is important.

Is it possible to create new vertices in a mesh? I mean when the player is playing the game. And then alter the vertices.
[/quote]

Yes it is possible.

Share this post


Link to post
Share on other sites
A couple of good starting points for you might be:

  • The chapter "Volumetric Representation of Virtual Environments" in the book Game Engine Gems: Volume 1.
  • The paper "An Algorithm for Automated Fractal Terrain Deformation" (pdf) (very theory-based).

    If you want to search for more resources on the topic, a couple of good keywords include "terrain deformation" and "destructible environment". The technique you describe of using "blocks" is known as "voxel terrain" or "voxel rendering" -- and although the prominent example of Minecraft chooses to make use of a simple blocky environment it's possible to use this approach to create smoother terrain as well.


    If possible given your other requirements, the easiest way to make use of destructible terrain in a game would be to utilise an engine that already supports it, such as UDK. If it suits your needs you could also consider PolyVox, which is a zlib-licensed C++ library for voxel-based terrain (if you look at some of the "projects using polyvox" you'll see not all of them have "blocky" terrain).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!