Ropes in 0.8.0?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
The Burrito
Party member
Posts: 153
Joined: Mon Sep 21, 2009 12:14 am
Contact:

Ropes in 0.8.0?

Post by The Burrito »

So I noticed that 0.8.0 has "rope" joints, looking them up in the box2D manual I saw
"This can be useful to prevent chains of bodies from stretching, even under high load."
and thought awesome, now I can make rope like structures that don't wig out all the time.
So I made a rope demo, but it still fails given what I would consider a reasonable amount of force.

Wheel down adds segments, wheel up removes, space bar adds a brick to the chain every other key toggles smooth view / shape view. As you can see as you add stuff it starts to stretch a bit and then hits a certain threshold and sort of snaps.

Am I doing something wrong? I'd like to make a game in löve thats reliant on rope physics but thats not happening if I can't prevent it from breaking down like that.
Attachments
rope test.love
requires 0.8.0
(1.38 KiB) Downloaded 170 times
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Ropes in 0.8.0?

Post by Boolsheet »

I don't know if the rope joints were specifically designed to be more stable with the iterative solver. With your test it looks like the mass ratio limitation still applies. From chapter 13 in the Box2D manual:
2. Chains of bodies connected by joints may stretch if a lighter body is supporting a heavier body.
For example, a wrecking ball connect to a chain of light weight bodies may not be stable.
Stability degrades as the mass ratio passes 10:1.
It's possible to make it more rigid by lowering this ratio to 1:1, doing more timesteps, or increasing the number of iterations per timestep (not possible with the current LÖVE API).
You could also try connecting one rope joint directly to the heavy body and the rope origin.
Shallow indentations.
User avatar
The Burrito
Party member
Posts: 153
Joined: Mon Sep 21, 2009 12:14 am
Contact:

Re: Ropes in 0.8.0?

Post by The Burrito »

hmmm, my specific interest is making a game which involves a rope reliable enough that it can be wrapped around a large shape and when pulled would be able to haul a heavyish object around the shape rather than just stretching or eventually clipping through it.
It seems increasing the number of iterations is the only viable option there since I need at least a couple dozen points to make a smooth looking rope. Maybe that can make it's way into 0.8.0 since rope joints aren't that useful as is :P .
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests