Advertisement

Breaking a wall of stones

Started by November 22, 2013 04:23 PM
21 comments, last by VladR 11 years, 2 months ago

You're underestimating the difficulty of solid body physics in a big way. I've developed 2D ragdoll physics, as well as 3D soft body stuff and a 3D solid body engine with support for boxes, spheres, and object to triangle collisions.

The solid body physics is easily the hardest of the lot. To get a solid body engine to be accurate, stable, with good performance is not trivial in the slightest.

Soft body dynamics is relatively easy in comparison, just not as fast if you use loads of particles and constraints.

By all means give it a go though if you want a challenge. Remember to develop a fast broadphase too, even if you don't necessarily need it at first with a small group of objects.

If this isn't a major feature of your game, you might just want to have a particle effect that is bricks flying apart.

Oh, that would not work. The camera is FPS-style and you'd be about 5-10 meters from the wall, so that would look totally out of place these days. Besides, you need to be able to see through the hole / pile of stones, so that's why it has to look as realistic as possible.

Actually, if all your doing is wanting to put a hole in a wall, a particle effect might work. Remember that particle effects can be done with geometry, not just textures. You'd simply swap the model of the wall to one with the hole, then spawn brick particles where the current holes are at, and give them some semi random velocity and rotations. They wouldn't bounce off each other, but they could easily bounce off the ground or nearby walls while alpha fading out of existence. (that would take a lot less complicated physics when you cut down interactions to moving objects that only collide with statics, and having them just fade out helps not having to worry about having them settle, or slowdown if the player just ends up with bricks all over the place)

Implementing someone else's physic's library is never as easy as just clicking some GUI =)

But that said, seems like you have the time, so feel free to dive in, you can always fall back to the easier solutions if you need to.

Advertisement

Actually, if all your doing is wanting to put a hole in a wall, a particle effect might work. Remember that particle effects can be done with geometry, not just textures. You'd simply swap the model of the wall to one with the hole, then spawn brick particles where the current holes are at, and give them some semi random velocity and rotations. They wouldn't bounce off each other, but they could easily bounce off the ground or nearby walls while alpha fading out of existence. (that would take a lot less complicated physics when you cut down interactions to moving objects that only collide with statics, and having them just fade out helps not having to worry about having them settle, or slowdown if the player just ends up with bricks all over the place)

Yeah, I am aware of 3d "particles". I just think it sucks when they suddenly disappear (alpha fading). having said that, you do bring a very important point - an easy fallback solution that still looks good. Which is kinda important, since it's still better than nothing.

Also, after reading over through the 4 pdfs I mentioned earlier, I did come up with few simplifications that would still look good (after all, it's not going to be slow-motion), but will be much easier to implement.

Implementing someone else's physic's library is never as easy as just clicking some GUI =)

Yes, I understand that. I've read lots of threads over the years where people spent weeks playing physics libraries (be it ODE, PhysX, ....) and accomplish nothing.

If one spent few weeks actually coding the functionality, he might have at least some basic stuff working and integrated in his own engine. For example, I am pretty sure I can implement at least these things with the stone cuboids in 2 weeks:

1. Simple fall (just gravity) from any given height

2. Simple tip over (when on top row of the wall) -> fall on ground -> Rotate on the larger side of cuboid upon collision with ground

3. Random speed of rotation during fall (but only along one axis)

4. Scripted event for a wall of stones (6 rows of 10 stones) (without any interaction between them, of course)

Now of course, the above won't look as realistic as a proper physics, but will serve as a pretty nice fall-back solution once the deadline really hits.

But that said, seems like you have the time, so feel free to dive in, you can always fall back to the easier solutions if you need to.

Yeah, when the deadline finally hits, one does usually reconsider his options. But I do want to aim for the highest quality upfront, so that when I need to make concessions, the next easier solution won't look totally cheap.

VladR My 3rd person action RPG on GreenLight: http://steamcommunity.com/sharedfiles/filedetails/?id=92951596

This topic is closed to new replies.

Advertisement