#### Archived

This topic is now archived and is closed to further replies.

# Deformable 2d Terrain?

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

## Recommended Posts

Deformable 2d terrain...does anyone know how to do it? I was thinking about creating a massive array of pixels and having gravity act on each of the pixels and having the pixels rest on top of one another and give the pixels an array of health, so that when one pixel dies the pixels above it would fall in to its place, however, there is no way a computer would handle running through several arrays with like 200+ entries... Any idea would be helpful! Thanks...

##### Share on other sites
What you''re describing is REALLY close to how you might do a deformable Voxel terrain. As the voxel "takes damage" it''s apparent height becomes shorter. You would need to create a damage filter that allows your damage to spread convincingly across multiple voxels in the same general location (ie, blast damage).

Doing it pixel-fashion would probably be incredibly slow. You need to figure out how to make it work at the triangle mesh level, so you can cram more tri''s rather than calculating lightmaps and stuff for individual pels in a triangle - also time consuming...

----------
-WarMage
...ereh gis yttiw tresnI...

##### Share on other sites
Whew, sounds complex, can you think of any easier ways to do it using a few large arrays or something of that sort?

##### Share on other sites
Have you looked at 2D Surface Deformation at Gamasutra.com?

While it deals more with vertices than voxels, it''s still good for the theory.

I think for deformation, you''d want to create an array, yes, and have a three-dimensional array for each object which could deform the terrain, say with the bottom layer looking something like:

-5 -4 -3 -4 -5
-4 -3 -2 -3 -4
-3 -2 -1 -2 -3
-4 -3 -2 -3 -4
-5 -4 -3 -4 -5

And then just adding the object array to the landscape array.

"NPCs will be inherited from the basic Entity class. They will be fully independent, and carry out their own lives oblivious to the world around them ... that is, until you set them on fire ..." -- Merrick

"It is far easier for a camel to pass through the eye of a needle if it first passes through a blender" -- Damocles

1. 1
Rutin
24
2. 2
3. 3
JoeJ
18
4. 4
5. 5

• 38
• 23
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631708
• Total Posts
3001839
×

## Important Information

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!