Stable rope physics in Farseer/Nez

Hey guys,

I’m currently working on a physics-based 2D platformer and wanted to implement vines/ropes you can swing on.
The game uses Nez and its Farseer physics implementation, which works pretty decently overall. So it thought implementing ropes shouldn’t be too hard.

I’m using Farseer’s LinkFactory.CreateChain() method to generate the vine(chain) as a list of rectangular shapes that are connected by revolute joints. And under the right circumstances it does work pretty well.

However, if my character connects to the vine with too much velocity, it gets completely messed up, like the revolute joints fail(see attached images). If I get the chain segments close to each other, the joints mostly recover and work as usual again.

Is “joint failure” a thing that can happen in Farseer? If yes, what could I do to prevent it from happening?



I don’t know these tools but maybe just limit the maximum velocity of each link?

1 Like

You would need some fine-tuning of the physics and probably a bit of cheating. I would start by calling the physics twice per frame with half the step time.

Make sure the game runs on a fixed time step.

Tune some of the values in the Settings class like VelocityIterations, PositionIterations , MaxSubSteps, MaxGJKIterations, Baumgarte.

Start reducing the number of actual physics chains until it’s stable, then interpolate with Catmull–Rom to generate fake sprite chains.

Reduce the mass of the character to get lower momentum/inertia.
(or increase the mass of the chain…)

Finally the cheating is to add a RopeJoint between the first and last chain,
or to limit the velocity of the character once you attach it to the rope.


i think the default settings are fine and if u should first try make the rope more dense or increase the mass of the segments it will be fine and have less side effects on the rest of the simulation. or make character less dense as was mentioned. mass ratios beyond 1:3 between any two connected items don’t converge well… also that rope joint trick between the two ends is good to keep it from separating when pulled straight, or being too springy, but only if its not bent over a cliff or something… also i would use capsules make sure there is circular overlap at least as much as the thickness, so they cant see if it separates a bit… u might need to cheat and change the mass only when the rope s grabbed or something though…if u cant leave it heavy for whatever reason…

I spent a long time trying to get physics to work perfectly in a game and i think the answer is actually to “cheat” in most cases. So I would create a separate body just for vine swinging and then attach that to the vine instead and tune that and then just set the position of the player to the new body while they are attached to the vine.

Thanks a lot for all of your responses!

I’ll try out a combination of the following methods:

  • Increasing density/mass of the ropes
  • Reducing the number of chain elements and using interpolation
  • Using a seperare “swinging” body for the player with reduced mass
  • Limiting the velocity of the player when attaching to a rope

I will post the results once I got time to try them all out!

1 Like