Rope (implemented like Bridge) quirks.

Hi.

First of all, let me thank you guys for this great physics-engine and the flash-port!

What i try to achieve is to build a "rope" and some kind of sign that is attached to this rope. So far, the "bridge" example in the Testbed provided a excellent starting-point, but now i'm encountering problems. That's why i'm here 🙂

Whenever i apply a force (by mouse-input) to my "sign", or if i increase the mass of the sign, the rope breaks and the parts of the rope end up in erratic movement. I'm not sure if this is due to a bad joint setup on my part, or if that's the behavior that must be expected.
I disabled angle limits, because it looks unnatural for a "rope".

You can try it out for yourself: http://bummzack.ch/Test.swf. It all works fine, until you give a strong "pull" on the sign.
Increasing the density of the rope-parts seems to reduce this behavior, making the rope somewhat stiffer and more robust. I'm not quite satisfied with this solution however, because from my point of view, the sign should be the object with the highest mass and the rope should have a much lower mass.

Maybe i could get a better behavior by replacing the distance joints with revolute joints?
Thanks for reading, any input is greatly appreciated.
Hey,

I am not sure what the cause of your problem is, but I can advise you to do the following, for performance at least.

1) Don't use rectangles for each section, but use circular particles.
2) Turn all collision off for the circle particles. (Set their maskBits to 0).
3) Connect them using distance joints, all starting/ending at the centers of the circles.
Hi android

Thanks very much for that tip. I'll try it out asap.

Cheers!
I did as android proposed and used circles instead of boxes. It didn't change that much, but reducing the amount of joints in a chain greatly increases "stability". Now i just need a good smoothing algorithm to make it look more like a rope in the final "rendering".

Here's the updated version for comparison: http://bummzack.ch/Test2.swf. I also added a force-threshold that allows the user to break the rope when pulling hard on the "sign" element.
banal wrote:
I also added a force-threshold that allows the user to break the rope when pulling hard on the "sign" element.

That's a much better solutions. Ultimately, Box2D is not going to be able to handle long ropes with high tension in them, it's just difficult circumstance for the solver. Tricks can mitigate the problems, but actually drawing a line in the sand like this when things get too unphysical is waay better.
Hi.

I'm developing a game which uses JBox2d (Java port of Box2D) for physics, and I wanted to simulate a crane consisting of a rope with a hook attached at the end, which would be able to lift up heavy objects.

As you may expect, I've been struggling to simulate a rope properly. The approach to create a chain of bodies connected with distance joints produced very elastic rope, which behaved like it was made from rubber. When lifting heavy objects it was bouncing too much, and sometimes even disintegrating.

Reducing the number of chains helped, but I didn't want to reduce the number of chains because it would not look like a rope anymore. I found out a solution, which is a mixture of pendulum and a rope.

Step 1) I created a standard rope consisting of chains connected together with distance joints: first chain was connected to the ceiling, second chain was connected to the first one, third to second, and so on...
Step 2) To make it stiff, for each "chain" I created additional distance joint, which connected that chain directly to the ceiling.

This already produced nice effect, but I've been able to improve it even more. Instead of creating a distance joint is step 2, I created a combination of revolute and prismatic joints, to enforce that the distance between the chain and the ceiling is not constant, but in (0..N) range, where N denotes the length of single chain.

You can take a look at the effects here:

http://www.dustedpixels.com/download/webstart/Hook.jnlp

Regards,
Michal.
Sweet!
Good job there Michal.
Maybe you should write a wiki article about this.. or something.
Nicely done.
I agree.
Another trick would be to have the mass of each link be roughly equal to the mass of the objects being lifted.
Hi, Erin.

Since this is my first chance to do this,
I'd really like to thank you for your efforts in the development of this engine.
It's just great!

Going back to your comments.
That's true, that making the mass of the chains comparable to the mass of lifted objects would make it better, however:
- you'll not avoid bounciness,
- the solution would be not scalable (adding more chais would make it worse),
- and the mass of the rope would be not "real".

In my demo, the weight of the chain is about 1000x lower than the weight of lifted object,
so the proportions are real. I'm able to connect the rope not only to the ground,
but also to other moving objects (like helicopter), and I'll not go into troubles.

Imagine how powerful the helicopter would need to be if the mass of a rope (with 20 chains)
was 20x higher than the mass of the helicopter.

Regards,
Michal.

Original thread: https://box2d.org/forum/viewtopic.php?t=1527