This project has moved and is read-only. For the latest updates, please go here.

Problem with chains

Topics: Developer Forum, Project Management Forum, User Forum
Sep 6, 2009 at 11:06 AM
Edited Sep 6, 2009 at 11:07 AM

Hey everyone.

I wanted to make a few ropes (chains) etc...

I did get it working pritty much how i wanted except they get very unstable when they get pulled on.
here is a video that shows the problem.

Also how do i get the physics debug box to also show me the times for the different parts of the simulator?

anyway i would be very happy if anyone knows how i can solve this issue as i cant have it stay like this.
Also i have tryed most link types and they all do it and the only one which gets the right feel is Revolute Joints

Also some other settings i use are:

Link stuff
float LinkBias = 0.05f;
float LinkSoftness = 0.4f;

Rope body stuff
Body.RotationalDragCoefficient = 10f;
Body.LinearDragCoefficient = 0.5f;
And the rope bodys masses are 1 each;


Thanks in advance.

Sep 6, 2009 at 12:47 PM

To me it seems like the chain links are placed wrong. Could you send me your code so I can have a look at it?

Sep 6, 2009 at 12:59 PM

Yer sure that would be great.
Here is all the relevent code in a code bin.

Any help would be great genbox...
Also if you have any ideas on how to do the rope or the rope shooting (youll see it in the code) better i would really love to know.

Also on another nice its a very nice article you wrote on high performance game development on ziggyware, a truely great read.
It you need any other code i forgot to give me just let me know here (i subscribe to all the forums here) or on

Thanks for any help you can give.

Sep 6, 2009 at 1:24 PM

I'll take a look a little later. Glad you liked the High Performance Game Development article. I have a new version coming out soon. Most non-game related stuff have been moved into articles on my blog so the new version will be more concentrated. I'll post it on my blog when I'm done with it.

Sep 6, 2009 at 1:26 PM

Thankyou very much.

That would be great and i will look out for that too.

Sep 6, 2009 at 7:25 PM

I don't think the bug is in the code you linked. From the debug view in the video it seems that the attachment point of the revolute joints are at the bottom & center. I ran some tests on Demo4 from the AdvancedSamples and it all seems fine (using revolute joints - the first chain to the left)

Have you tried using pinjoints? they are two revolute joints with a fixed distance between them. You simply attach the pin joints at the ends of the geometries and set the target distance to be a small value. As for the rope: Chains are rigid and ropes are elastic. You should use joints in chains and springs in rope. Using elastic rope will have a bouncing effect (bungee jump alike) - the elasticity of the springs can be controlled using damping and other constants.

As for the shooting of rope. It should be straight forward if you don't have intercolliding links (no geometries in the rope). Attach a grappling hook to the end (a circle geom) of the rope and apply a great impulse to that body. When it collides with something, attach the two geometries using a pinjoint.

Sounds like a lot of fun with grappling hooks - be sure to keep me posted on your progress :)