Physics Destruction

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Physics Destruction

Post by Adler1337 »

Ok...I have been looking around for a free physics engine that has the ability to destroy objects like Havok Destruction or DMM. My search basically got me nowhere :( I believe Newton and Bullet have the ability to have destructible objects but you have to manually break them up first. Visually I could deal with this, but my problem is I have no idea where I would begin to break up the meshes. What is the work flow? Does anyone have any experience doing this? If I were to just start randomly breaking meshes up I have a bad feeling it will look like crap and just take me a ridiculously long time. I was also wondering if any wrappers had the ability to have destructible objects? (I'd prefer to use bullet :wink:) Thanks in advance for any help. In the meantime I will continue my search...
multum in parvo
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

I have never implemented this myself, but I'll probably have to do this too in the near future

I have no idea how this works exactly within physics engines like havok, but intuitively I'd say it'd be a nice solution to implement destruction as a LOD system where you have the same mesh in different states (and maybe different variations of that state) based on its level of destruction

I haven't really thought this through, so there'll probably be some flaws with this
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

I haven't (yet) tried that, but I have already put some thoughts in. My main idea would be to create an object (e.g. an airplane) out of several meshes (body, wings...) and on destruction break this. This would have the advantage that it should be rather easy to do, but the objects would always break in the same places (OK for an airplane, not OK for a big building I guess). In ODE (my physics engine of choice) you can compose a body (aka "dynamic, movable object") out of serveral geoms (aka "the shape of an object") so it should work if you removed a geom from a body (e.g. a wing of an airplane) and attach it to a newly created body. Other ways of doing this would be rather complicated I guess.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post by Bear_130278 »

I think you'll have to invent an analogue of slicing plane in 3dMax.....
Do you like VODKA???
Image
Image
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Thanks for all the replies :D
@Radikalizm
I have no idea how they do it either. I think dmm uses shaders, but I haven't really touched shaders much so that is over my head. I have no idea how havok does it, but I'm assuming it's similiar.

@Brainsaw
While it doesn't seem that hard on a simple airplane, like you said, it probably won't work that well on a big building. Unfortunately my primary use for the destruction would be on big buildings :( Your ode wrapper is very nice and if you could get some destruction in there I would probably use it for this project. The only reason I said I'd prefer bullet is because I have the most experience with it. So I am open to any engine.

@Bear_130278
Sorry I do not use 3d studio. Thanks for the reply though :)

All that being said, I had a look at physx and they seem to have a very nice destruction system. But when I went to download it last night I found out that you have to be part of their developer program or something. So I signed up and just got the acceptance email about 5 min ago. Unfortunately I don't have access to my computer for the next couple of hours(typing this on ipod) so I am patiently waiting to download and test it out.
multum in parvo
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Well I'm a little pissed. The thing that caught my attention with physx was apex destruction. I get all excited thinking that they had this amazing tool available for free just to find out that it's not released yet and in a private beta. It's fine that it's in a beta but at least put it on the site somewhere, instead of putting vague information up and misleading people into thinking it has already been released. So I guess I continue searching for information from people who have already implemented destruction in their games or wait until apex is released :roll: Anyway anybody with ideas, suggestions, or links please post them.
multum in parvo
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

I've done this using my irrBullet wrapper.

It's very easy to get the beginning of it started, though you'll need to do your own physical parent/child system like I did.

This is a very old video, and it's the early days of my game's damage modelling (It's much better now.), but you should get the idea:

http://www.youtube.com/watch?v=bX-9wDfzFvk

If you're interested I can give you more details on how to do this with my wrapper. I might even do a damage example for it.
Josiah Hartzell
Image
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Thanks cobra :D I remember seeing that video a long time ago. I've used your wrapper in a few of my projects so more details/example would be greatly appreciated. A few things though, I was going to have the destruction be primarily on buildings so I don't know how well that would work on large buildings. Also my main problem was how to break up the model easily in a modeling program. With an airplane you can break it up based on the parts(wings, etc) but with a building it seems a lot more difficult. If you have any ideas or experience with buildings please share :)
multum in parvo
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Although implementing a destruction system would be a great addition to my wrapper I don't think that I'll do that at the moment. I'm currently re-thinking the whole wrapper and might start building a new version with other enhancements soon (e.g. running the physics simulation in it's own thread, better editor plugin...).
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Adler1337 wrote:Thanks cobra :D I remember seeing that video a long time ago. I've used your wrapper in a few of my projects so more details/example would be greatly appreciated. A few things though, I was going to have the destruction be primarily on buildings so I don't know how well that would work on large buildings. Also my main problem was how to break up the model easily in a modeling program. With an airplane you can break it up based on the parts(wings, etc) but with a building it seems a lot more difficult. If you have any ideas or experience with buildings please share :)
Right now I have no experience with building destruction, but I will let you know when I start working on that.


The basic idea is to iterate through all collision pairs (check irrBullet collision example) and check the applied impulse of each collision; but first you have to do your own checks to find out if each object is a child of another (with your own parent/child framework) and, if so, find the child's parent. Then, if the impulse is high enough, remove the constraint between the objects, remove the object from the parent's child list, and add the smoke effects or whatever else you might want to do for effects.

This works well for vehicles, anyway.
Josiah Hartzell
Image
Alpha Omega
Posts: 288
Joined: Wed Oct 29, 2008 12:07 pm

Post by Alpha Omega »

I have had many thoughts of that to put into my physics engine (even though it will be a while until it happens) but in Irrlicht you can seperate each piece of the mesh buffer into its own object. In essence you have to create a new object each independent from each other in the mesh buffer and then delete the old object. Then apply a constraint to bound the independent objects together in your physics engine.

On one hand it will give good results, since your treating each piece of the mesh as its own object, similar to particle physics.

On the other hand you drastically increase the number of objects in the scene. Optimization is your friend in this case. You will need a very good course collision method to reduce the number of collision tests to make this viable.
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

Thanks for all the replies.
@Brainsaw
Those updates would be awesome.

@cobra
I will take a look at that example and try to implement this.

@Alpha Omega
Interesting...I have a lot of thinking/experimenting to do.


I'll try your suggestions out and post updates as I make progress or run into problems. If you can think of anything else or find some interesting links please post them.
multum in parvo
Post Reply