Archived

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

Digging a hole

This topic is 5169 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

How would you go about the act of digging a hole in the ground or maybe into a wall? What I would like to do would be to do is to allow for somebody to dig a whole to whatever depth and width for the sole purpose of discovering something (mineral, weapon, chest, etc). Also, the hole would have to be real so that a character could go into the hole. Any ideas? I''ve looked around and don''t want to have to use voxels.

Share this post


Link to post
Share on other sites
This is a very complex issue that has yet to be solved in a very nice way. The best method is to either use voxels or metaballs. Using standard polygons is far too complicated to get good holes without creating millions of polygons.

Try searching around for deformable terrain and/or deformable geometry.


Good luck!

Share this post


Link to post
Share on other sites
Assuming you''re talking about full 3D rather than something 2D like Worms or Lemmings...


Alternatively take a look at CSG (Constructive Solid Geometry).

Howver, as ApochPiQ mentions, making holes in things has lots of problems and issues - for example what does the texture of "inside" the hole look like? - usually not the same as the outside surface.

Volume textures combined with plain Z buffering can be used to do some of this - if supported on your target hardware.

Most games that allow things to be deformed to that extent tend to cheat and only have the holes available at certain places - and define what the inside looks like (in shape and texture).

--
Simon O''Connor
3D Game Programmer &
Microsoft DirectX MVP

Share this post


Link to post
Share on other sites
This is for full 3D and I definately would not want to limit it to specific areas. I had thought about the textures being different, but it''s the concept of how to structure everything and the lack of existing articles, etc that has me both curious and frustrated.

Share this post


Link to post
Share on other sites
Come to think of, there is another method you could consider, and that is the layered terrain system that the upcoming Worms 3D uses. It may only be good in the sort of cartoony world that they use, but it''s probably worth looking into.

Share this post


Link to post
Share on other sites
Use bezier patches for your terrain. When you want to add a hole, just add a control point where it is and adjust it so it digs downward. Tesselate as high as you need to for that area to get it smooth, and there you go .

Share this post


Link to post
Share on other sites
I appreciate the responses. All my research has led back to Voxels, though I''m concerned that the speed of a Voxel engine for terrain would be too slow. Underground, I don''t see any problems.

Share this post


Link to post
Share on other sites
you could limit the voxel area, and then try to combine it with your real polygonal 3d envoirement, its a bit tricky on the hole-edges but its better than using a ''total'' voxelengine...


T2k

Share this post


Link to post
Share on other sites
quote:
Original post by Pipo DeClown
How would you dig a hole in 2D?



Quite simply, you could create a 2D buffer of whatever size.. and fill it with dirt (say, 1''s). Say you want to start digging at the top, you can simply change those one''s to zero''s.. and do whatever other processing needs to be done. For screen representation, it could represent vertices.. or represent individual or groups of pixels.

Share this post


Link to post
Share on other sites
Something else that I need to consider is density of the material being dug into. Since a voxel is represented as xyz, do I just add another value on the end that would represent the density of the voxel? For instance, digging into soft dirt takes less force and energy than trying to dig into clay.

Share this post


Link to post
Share on other sites