Archived

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

webmunkey

Deformable 2d Terrain?

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 this post


Link to post
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 this post


Link to post
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?
Thanks for the reply...

Share this post


Link to post
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

Share this post


Link to post
Share on other sites