This post has been edited by TheGreatGuy: 14 March 2005 - 01:06 AM
-= Ragdoll Rope Physics =- [SOLVED] =) Rope Demo inside..
#22
Posted 14 March 2005 - 02:53 AM
[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
#23
Posted 15 March 2005 - 01:17 AM
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
#24
Posted 17 March 2005 - 02:56 AM
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
#25
Posted 18 March 2005 - 02:09 AM
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
#26
Posted 18 March 2005 - 10:02 PM
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
#28
Posted 19 March 2005 - 05:03 PM
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 ..
[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
#29
Posted 20 March 2005 - 09:36 PM
--------------------------------------------------- ---------------------------------
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
#33
Posted 30 March 2005 - 11:18 AM
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
#34
Posted 05 April 2005 - 01:20 PM
...... 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
#35
Posted 07 April 2005 - 02:01 PM
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.
#36
Posted 07 April 2005 - 04:48 PM
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

Help

MultiQuote








