Rope in GS
iTopGames
Member Posts: 71
Hi GS guys, i need to make a rope, just like in "Cut the Rope"
Which is the best way to do it?
Which is the best way to do it?
Best Answer
-
RThurman Posts: 2,880I posted a link to a demo in this thread:
http://forums.gamesalad.com/discussion/44274/how-to-make-a-swinging-pendulum-effect#latest
Hope this helps. (But yes -- it will hopefully be much easier when joints are formally implemented in GameSalad.)
This discussion has been closed.
Answers
Once theres joints you can make a real rope.
I agree with you. Its a pretty poor rope! But OK as a pendulum. (Or if shortened, as a rope segment.)
The above demo was something I was experimenting with last December. I did, in one experiment, join a bunch of rope 'segments' together. It got pretty close to cut the rope behavior. If you look closely at cut the rope, each rope is a series of 1/6 inch (1.5mm) segments, alternating light and dark brown.
But as you indicate, this demo is not set up for collisions. (Because it uses constraints, instead of interpolation.) Also, with a bunch of segments chained together, the framerate drops pretty quickly.
I agree that once GameSalad implements joints it will be easier to make a rope. But I am worried that their implementation of joints might not work as we hope. For example, what if they can't figure out how to have joints work with collisions either? What if their version of joints also lowers framerates to unacceptable levels.
Meanwhile, I'm willing to experiment and see what can be done. Its fun to learn new ways to use GameSalad.
RThurman
Joints don't need collision to be defined as a joints. In fact, the pendulum demo I gave is a joint. Its just a 'hand-coded' joint.
I hope you are right, that is, I hope the good people at GameSalad do figure out how to integrate Box2D joints into the engine. (If they indeed continue to use Box2D as their underlying physics engine.)
Im not knocking your demo, its a very nice effect and some nice math in there, but in fact in most programming both connected objects have to be a rigidbody to even be able to connect a joint between them, so they have to respond to physics and collisions ect and you cant connect non physics objects with a joint.
Here is a demo I made last November. Perhaps it might be of use:
http://www.mediafire.com/download.php?vwd856cbku8vhpr
This demo is based upon FireMapleGames' really great "Swinging/Hanging Demo" that can still be found in the new section of GameSalad. (All I did was take the pendulum and make a chain out of it.) It uses a different integration scheme than the demo I posted previously.
Hope this helps! But I really hope it might spark others to experiment with making joints in GameSalad.
RThurman
I guess we'll just have to disagree on the definition of a 'joint'. To be honest, I didn't even consider that the definition of a joint needed to include collisions. Sometimes joints need collisions, and sometimes they don't -- depending on the need.
For example, joints in Box2D (GameSalad's underlying physics engine) do not use collisions by default. In order to get a Box2D joint to register collisions, one needs to explicitly turn on the boolean flag 'collideConnected' or the joint wont ever detect collisions. (But it is still a very valid and useful joint.)
If they continue to use Box2D, the coders at GameSalad will need to explicitly turn on this boolean variable -- or we many never get joints in GameSalad that collide properly. Either that, or when they get around to creating joint behaviors, they will need to include a "turn collisions on" checkbox that will allow us to designate if the joint needs collisions or not.
RThurman
@RThurman Sorry for bringing up this old thread. I'm interested in the demo you made, unfortunately the download link doesn't work anymore. If you still have it, could you upload it here? Thanks in advance!
Wow... that is an ancient thread! I am not sure I have that anymore. It might be stored on an old USB drive somewhere. But who knows!
I'm gonna go ahead and close this very old thread. GameSalad is really a very different engine than it was then.
I would suggest starting a new thread where you can explain your requirements and lets see if the current crop of GS experts can work their magic.