Game Maker Community: -= Ragdoll Rope Physics =- - Game Maker Community

Jump to content

Advanced Users Forum Rules

This is a Q&A forum for advanced GML users ONLY. Moderators will remove inappropriate topics. Make sure that you READ these rules prior to posting: Advanced Users Forum Rules
  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

-= Ragdoll Rope Physics =- [SOLVED] =) Rope Demo inside..

#21 User is offline   TheGreatGuy 

  • GMC Member
  • Group: GMC Member
  • Posts: 25
  • Joined: 25-February 05

Posted 14 March 2005 - 01:06 AM

They actually didn't start with a doll, someon whos user name is viestituote posted this: http://kotisivu.mtv3...agdoll_rope.gmd and its a rope. :) So it might help.

This post has been edited by TheGreatGuy: 14 March 2005 - 01:06 AM

0

#22 User is offline   kow 

  • GMC Member
  • Group: GMC Member
  • Posts: 334
  • Joined: 21-September 04

Posted 14 March 2005 - 02:53 AM

yeah i have that one .. and theres another file like it with a 2 at the end .. which i linked way at beggining .. Doh .. now im going back in circles here cause thats similar to what i just thought about .. but .. that one still stretches and it wouldnt be able to swing ..

[edit] im going to rename this topic .. its not wrecking ball any more .. its rope i guess lol ..

This post has been edited by kow: 14 March 2005 - 04:14 AM

0

#23 User is offline   kow 

  • GMC Member
  • Group: GMC Member
  • Posts: 334
  • Joined: 21-September 04

Posted 15 March 2005 - 01:17 AM

gasp!! .. http://www.tokamakph...s.com/intro.htm
THAT LOOKS LIKE WHAT I NEED!! ... im looking into this now!!


i got that link from this post ..
http://forums.gamema...showtopic=97600

too bad the download link is down ATM..

[edit] this is exactly what i need ! i saw the demo on the main site.... it acts how i want it to and its fast .. i just need it in 2d lol ..

This post has been edited by kow: 15 March 2005 - 01:28 AM

0

#24 User is offline   kow 

  • GMC Member
  • Group: GMC Member
  • Posts: 334
  • Joined: 21-September 04

Posted 17 March 2005 - 02:56 AM

ok forget that dll , noone replies to me and it seems glitchy still .. ill have to find a GML way to do it....

so ... keep talking .. ill be listening to all suggestions..

and ill be going back to RustyBadger's grapple rope demo.. its definatly the best looking so far .. i think we should build off that..

then again im going to take a look into cdsand's idea first... it seems simple in its own way ....

This post has been edited by kow: 17 March 2005 - 04:13 AM

0

#25 User is offline   kow 

  • GMC Member
  • Group: GMC Member
  • Posts: 334
  • Joined: 21-September 04

Post icon  Posted 18 March 2005 - 02:09 AM

DAMN IT .. i sit here for 20 min to post this Huge post .. and server error ..


anywho .. ill repeat myself short ..

http://nehe.gamedev....n.asp?lesson=40
this website has a tutorial on how to do ropes in 3d .. but i cant figure out the formulah right because all the terminology throws me off into stupid mode .. and like i said .. 3d .. so theres extra stuff involved ..

http://nehe.gamedev....et/lesson40.zip
heres a sample of the finished product.. theres an exe in there ..

the only problem is that the tutorial is in 3D.. but i was thinking there should be a way to convert that formulah to 2D use .. the way they described it .. it works similar to the way cdsand's demo does .. with the push and pull tension... which i got from this post .. ( except this is 2d ..)
http://forums.gamema...howtopic=108176

befor i had found that website above though i did some tinkering and came up with this .. http://www.darksweep...ow/theropes.gm6
and then i realized its almost alike to how
RustyBadger's grapple demo does it ..
one keeps the links distance tightly in place .. but they spin a lot .. the other is stretchy .. but it doesnt spin .. though it does go a bit crazy if you move it fast..

----------------
point is .. i found that website later with a perfect rope tutorial .. can anyone please take a look and see if they can figure out the formulah from there to work in 2d ?? thanks in advance.. sorry for 4 posting in 4 days .. but its the only way to get things done =P

This post has been edited by kow: 18 March 2005 - 02:11 AM

0

#26 User is offline   xot 

  • media multimixer
  • Group: Global Moderators
  • Posts: 3472
  • Joined: 07-May 04

Posted 18 March 2005 - 10:02 PM

Check this out:
http://freespace.vir...net/hugo.elias/

On the right side, "Models", then "Strings". It's only pseudocode, but it is simple. Here's a direct link:
http://freespace.vir...ls/m_string.htm

#27 User is offline   kow 

  • GMC Member
  • Group: GMC Member
  • Posts: 334
  • Joined: 21-September 04

Posted 19 March 2005 - 02:12 PM

hey .. thanks to that .. i think i figured out what a vector is ..

Quote

X_vector1 = String1_X(i- 1) - String1_X(i)

0

#28 User is offline   kow 

  • GMC Member
  • Group: GMC Member
  • Posts: 334
  • Joined: 21-September 04

Post icon  Posted 19 March 2005 - 05:03 PM

i took a good look at that strings page ...

and i noticed that its setup was similar to the
ragdoll_rope2.gmd thats on page 2 of the ragdoll physics post ..

so i took that example and i modified it .. with the formulahs from the strings page ..

the stuff on that page are not perfect .. so i had to modify some things a tiny bit specialy toward the end ..
for instance i cant use hspeed and vspeed .. or it went crazy .. i used velocity_x or whatever.

anywho .. its NOT completed .. but it has NO jigglyness .. and moves VERY smooth. it needs gravity , a limit to stretch ... and if anyone can properly reattatch the ball at the end and make it work right, then i think were good.
http://www.darksweep.../Kow/string.gm6

the reason it attaches to the top right of the screen is because each link compares itsself with the one next to it .. and unfortunatly since there is nothing after the last link .. the one its looking for would have x = 0 and y = 0 ...
also though .. if i dont have it compare to the next one at the end i get a division by 0 error so i left it for now till i get a workaround .. all i can do to it is manualy set the last point to be any other location .. this type of chain link stretches well between 2 points...

final note .. if you uncomment the lines after vector, the rope will limit itself to length = dis ( which is declared above). the only problem with that is that it seems to be constrained to a square .. not sure why ..

ill shut up now and see what people think .. :lol:

[edit] i just went and saw this demo .. http://www.tokamakph...tokamakdemo.zip
if you unzip this into a folder ( keep folder names ) and open sample1.
you can play with a rope that has the perfect physics i want .. except i want those in 2d. and it occurd to me .. are we taking the correct approach to this rope ? what do you guys think

This post has been edited by kow: 19 March 2005 - 05:25 PM

0

#29 User is offline   kow 

  • GMC Member
  • Group: GMC Member
  • Posts: 334
  • Joined: 21-September 04

Post icon  Posted 20 March 2005 - 09:36 PM

** Does a little Dance * WOOT WOOT! ;) :D :D ;) B)
--------------------------------------------------- ---------------------------------

well .. ive spend about a week on this .. and i knew eventualy i would get somewhere even if i meant posting to myself over and over to give myself hope after this seemed abandoned....

so i awoke this morning and it dawned on me .. the answer!!
neo said it best ... "i know kung foo" .. ( well in my case physics! )
i awoke this morning and all the stuff i had been reading all around came together into my head finnaly!!

and thus i present to you guys .. ragdoll-rope-physics.. in its purest and simplest form.
use the mouse left button to attract all the links toward the mouse ...
use the right mouse button to set the ropeend to the mouse_x and mouse_y.


thank you guys for all the help!! now with some tweaking and graphics work i can finnaly have a chain sword.

if you have any questions just ask.. all i ask is that you read the read me if your going to use this in your game.

This post has been edited by kow: 20 March 2005 - 09:51 PM

0

#30 User is offline   xot 

  • media multimixer
  • Group: Global Moderators
  • Posts: 3472
  • Joined: 07-May 04

Posted 20 March 2005 - 11:36 PM

That's pretty cool, Kow. I'm gonna have fun playing with this.

#31 User is offline   cdsand 

  • GMC Member
  • Group: GMC Member
  • Posts: 153
  • Joined: 26-October 03

Posted 27 March 2005 - 08:16 PM

:D Woah that is alot of work you did on my engine. COOOL!
0

#32 User is offline   theantiglitch 

  • GMC Member
  • Group: GMC Member
  • Posts: 7
  • Joined: 16-March 05

Posted 27 March 2005 - 11:08 PM

Could you post a gm5 as gm6 wont work on my comp.
0

#33 User is offline   spacerat 

  • GMC Member
  • Group: GMC Member
  • Posts: 231
  • Joined: 20-January 04

Posted 30 March 2005 - 11:18 AM

Thats amazing ::lmao:: i once kinda made a sorta rope physics thing, but it was nothing compared to this, actualy mine was hardley even physics, just plain dumbness...

one problem i spotted is that the links in the rope aren't solid, which means the rope can go through stuff if you pull right... I tried to fix it by setting the distance between each link to 1, but when i pulled it right, it still happened. Ofcourse, im not really the one to complain, since i couldnever have got have this far.

-Spacerat
0

#34 User is offline   kow 

  • GMC Member
  • Group: GMC Member
  • Posts: 334
  • Joined: 21-September 04

Posted 05 April 2005 - 01:20 PM

well technicly its not really a rope.. its a series of springs with super controlled friction between a set of points to which i applied gravity...

...... ok .. ill stick to rope its nicer =P

anywho .. check this out..
=====================
to spacerat :

spacerat noted that the lines arnt solid .. they really are just lines i drew between the points,if you want solids, make a solid object thats 1 pixel wide and make it stretch between points, then have it detect for collision and that should work ( ok ok only for collision detection between the lines, it cant really affect them.. sorry =( .. ) .. i personally planned to replace the points with small blades and just swing that around.
but anywho .. he also mentioned theres a chance they will get stuck..
so heres a solution i am currently implementing in my game....

in the getforce script under the line that has superstoper add what i did below .. so it looks like so ..

superstoper = 1; // enable links to move when not in collision.

if (point_distance(x,y,part2.x,part2.y) > 80) {
x=part2.x
y=part2.y }


this makes it so if the chain gets any single link stretched too far from the top that link and all the ones after it will teleport to the link it got far from. it may look a bit crude in this example in action, but in a game, and using this as a weapon, this will prevent many problems =P

the best thing to do is to make sure you design your levels appropriatly to avoid this sort of stuff, =)


==================

cdsand :
yeah actualy i used your file and worked from that to get to what i did.. but i copied the scripts from RustyBadger's rope, and used his method of one link object and one controller rather then your individual object for each link.
thats why i gave you both credit if you look at the readme in there.

after hours of research into game design i realized that what you were both missing was an extra boost of friction determined by the speed. and finnaly a control to stop the jerkyness upon collision. =)

now keep in mind im still not a physics expert, just a lucky guy who solves everything i start due to brute force at being stuborn! ( as you can see with countless self replies.. lol ) im sure if anyone who knows physics can take a look at it, perhaps the values can be tweeked a bit more to make it realistic, currently i see it a bit stiff , as if it looses energy a bit too fast. ( but good enough i guess =P)

...hmm ... maybe i should start a tutorial page on my site =P


=======================
theantiglitch :
sorry i dont have GM5 =( .. maybe you can try it at a school computer or a friends house, its a very small file so it shouldnt take too long to convert if it can be converted.

if anyone wants to convert this to GM5 i will be glad to host it, just PM me =)

This post has been edited by kow: 05 April 2005 - 01:23 PM

0

#35 User is offline   MACARRAUM 

  • GMC Member
  • Group: GMC Member
  • Posts: 270
  • Joined: 29-October 03

Posted 07 April 2005 - 02:01 PM

Very Cool examples, like my DLL engine 2D physics. Rope and bodies simulations: Physics 2D :rolleyes:

Commands: C to create Cubes, E to create Spheres, D for create Cilinders, J for create Ball´s linkeds, F1 for DebugAxis, Click inside object´s to aply force or torque.
0

#36 User is offline   kow 

  • GMC Member
  • Group: GMC Member
  • Posts: 334
  • Joined: 21-September 04

Posted 07 April 2005 - 04:48 PM

neat, so now you have your own physics engine, how did you keep the links so perfectly together AND rotate ? care to give any pointers ? :blink:

the only reason i didnt use tokamak was that i mostly had problems with objects teleporting when they got disabled and re-enabled in my game using instance deactivate functions..

and after that i got stuborn i guess .. =P
0

#37 User is offline   Consoft 

  • GMC Member
  • Group: GMC Member
  • Posts: 383
  • Joined: 06-May 04

Posted 14 April 2006 - 07:47 AM

seems more like elastic to me

good job
0

#38 User is offline   Mr. Midi 

  • GMC Member
  • Group: GMC Member
  • Posts: 188
  • Joined: 22-February 04

Posted 29 August 2006 - 08:34 PM

Ok, man. I want to use this in my game, but I can't figure out how to place an object on the tip of the rope. ALl i need is to make it jump to one of the parts, but I'm not sure which one I need to make it. Help?
0

#39 User is offline   Mr. Midi 

  • GMC Member
  • Group: GMC Member
  • Posts: 188
  • Joined: 22-February 04

Posted 02 September 2006 - 02:02 AM

Having LOTS of problems incorporating this into my game. A little bit of help? First, I can't get an object to jump to the last link on the rope. Second, if I merge my game and your engine, I get a "Unknown variable P1, P2, etc" error.
0

#40 User is offline   michael-bass 

  • GMC Member
  • Group: GMC Member
  • Posts: 106
  • Joined: 24-April 06

Posted 16 September 2006 - 12:20 AM

try gm physics
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users