Jump to content


Photo

Ragdoll + Physics Engine(s) - Submit Your Editable


  • Please log in to reply
415 replies to this topic

#1 SSNautilus

SSNautilus

    S.S.Nautilus

  • New Member
  • 137 posts

Posted 13 February 2004 - 01:19 PM

Greets.

A lot has happened since we first started this topic. :) New versions of GM have appeared with better functions (and 3D) and our community has finally learned that nothing is "impossible" when it comes to GM. :blink:

I shall be periodically updating links in this post for DLLs and EDITABLE examples for physics related "innovations". :(

If you have made (or know of) any unique GM physics related example/dll, and would like to share them with the GM community please PM me.
________________________________________
Links of interest:

CoderChris's SUPERB GM Physics DLL + Examples
http://forums.gamema...howtopic=141853

Atrius's Examples:
http://www.kousougam...k/?act=download

Steffen Itterheim's GM + ODE DLL:
http://ode.org/
http://gamegestalt.c...o...7&Itemid=40

Macarrum's Tokamak 3D Physics Engine:
http://www.tokamakphysics.com/
http://forums.gamema...howtopic=117085

RTsa's Demo Game (using GM_ODE dll): Ragdoll Matrix: Reloaded
http://www.freewebs.com/rtsa/
http://forums.gamema...howtopic=115976

Bathy's Verlet Physics Engine based upon EricDB's scripts
http://forums.gamema...howtopic=142476

Edited by xot, 13 April 2008 - 06:19 AM.
** Old Experts Topic **

  • 0

#2 Guest_M2k3_*

Guest_M2k3_*
  • Guests

Posted 13 February 2004 - 05:16 PM

No, even with a DLL it is impossible to make ragdoll effects with GM.

#3 Kornbizkit1718

Kornbizkit1718

    Wanderlust

  • New Member
  • 275 posts

Posted 13 February 2004 - 05:50 PM

Yeah it is. you would just need a wicked (wicked wicked wicked wicked) Equastion, and for each limb (arms legs head feet etc) have them seperate and rotate them 360 degrees (well, 36 diffrent sprites).
  • 0

#4 (-[TJ]-)

(-[TJ]-)

    2D Artist

  • New Member
  • 61 posts

Posted 13 February 2004 - 06:27 PM

True ragdoll physics aren't possible but that doesn't stop you using natural-looking ragdoll STYLE animations (like I did in my game INVADED).
  • 0

#5 SSNautilus

SSNautilus

    S.S.Nautilus

  • New Member
  • 137 posts

Posted 14 February 2004 - 10:23 AM

Hmm... I don't know about it being impossible.

Already I can see that the next version of GM deals better with contact/collisions with points/lines/etc. All that would be needed could be some IK calculations, and some nice collision code.

IK in bodyparts could be a nice -stitched- system of bodyparts (like in Poser) which looks something like:

hand-(joint)-forearm-(joint)-elbow-(joint)-biceps-(joint)-shoulder-(joint)-chest-(joint)-etc etc.

A lot of work perhaps - but regardless of Direct3D or not - the above method WILL probably be needed in one form or another to emulate realistic IK physics as a starting point. ie someone's gotta take the first step!

3D directions have already been simulated via perspective x,y,z scaling. I know it would be better in true 3D, but hey - I feel this is a doable idea.

Any takers? :angry:
  • 0

#6 deadimp

deadimp

    GMC Member

  • Validating
  • 64 posts

Posted 15 February 2004 - 12:15 AM

Well, you could use polygons that rotate on an axis, which is a joint. That joint's direction would be dependent on the joint' direction before it.
Ex: hand=hand_dir+elbow+shoulder+chest;

#7 videogamerx2

videogamerx2

    GMC Member

  • New Member
  • 31 posts

Posted 15 February 2004 - 02:51 AM

GM is capable of calculating most of the mathmatics equally to most comercial languages, so I don't see any reason for it to not work. Though it could be unbearably slow.
  • 0

#8 random

random

    completely random

  • New Member
  • 798 posts

Posted 15 February 2004 - 02:58 AM

True ragdoll physics aren't possible but that doesn't stop you using natural-looking ragdoll STYLE animations (like I did in my game INVADED).

Yes, animations can work well in some cases.

And it probably is possible, the question is whether it would run fast enough to make it any worth.
  • 0

#9 Lyndon

Lyndon

    GMC Member

  • New Member
  • 78 posts

Posted 15 February 2004 - 03:32 AM

Ever play Lemmings 2? That had Ragdoll physics, it was also 2d. Sure it was not a pure form of ragdoll physics but it did the trick and looked funny as hell. Download it here http://www.qytis.com/lemmings2.zip and see what i mean, it will make you laugh.


---Guess this was something to with the moderation queue on this forum... Richard ^_^

I know that is already been written, but for some reason i couldnt reply to it, so here is my reply to it here. 2d games can have ragdoll effects sorta. In Lemmings 2, they have a sorta ragdoll effect, its very vyer funny check out at http://www.qytis.com/lemmings2.zip so Its possible just wont be as cool as 3d games. Just envolves sprites and some collision points.


Edited by Richard, 16 February 2004 - 01:54 PM.

  • 0

#10 bearSoft

bearSoft

    GMC Member

  • New Member
  • 1002 posts

Posted 16 February 2004 - 12:13 PM

Ragdoll physics is advanced even for the best engines today
the math behind it is descibed in this paper from io-interactive
ragdoll in hitman
I do not believe it could be even faked with gm
  • 0

#11 Mastiff Odit

Mastiff Odit

    Geek of the week

  • New Member
  • 17 posts

Posted 17 February 2004 - 12:02 AM

The reason the Physics are so hard is because you have to emulate Enersha and Mass.(I hope I spelled that right)

You have to emulate the amount of Mass a character would have and then you would have to emulate the strength of the material that the doll is made of and how much Enersha (mometum) that each part of the doll has and in what direction at what speed.


Basicly you need a "true" Physics emulator in order to do it.
And that's REALLY hard to make and it would not be at all posible in GM because of how slow GML is, and the speed of our computers.


So, yes it is posible, but no, your not really going to do it with GM.
You could fake it but then it wouldn't look exactly right.
  • 0

#12 SSNautilus

SSNautilus

    S.S.Nautilus

  • New Member
  • 137 posts

Posted 17 February 2004 - 11:11 AM

Nice link BearSoft. :D

Aww.. come on guys. It's very easy to say it cannot be done. But has anyone really sat back and thought about it for a minute?

Here's what I think is possible as a very crude start:

We have 2 rope examples in the GM community. One is the Grappling hook. And another is the pacman-monster swinging from platforms like the "Bionic Commando" game.

Thus, the rope physics has already been done for varying elasticity and speed, based upon distance from sourcepoint.

How about using this 'rope' as the 'joint' described above? Naturally, when a collision occurs on one of the objects, it will move as collisions do, but the 'rope' will hold it in place thus limiting its motion, and so - hopefully - you'll see a ragdoll motion. :)

Not 100%, but its a start! :)

Now realistic physics does require things like density/directional acceleration/velocity/etc. They are simply variables on a nifty (or wicked as defined above) algorithm. :)

We already have gravity, speed, and a rope. The differring density between many bodyparts could be achieved via friction + directional gravity formula. Give heavier objects a higher downwards gravity, and tweak possibly more(?) friction (so they dont go flying about when hit?).

Hmm... come one people! We can do this. :) Let's skip 3D directions for now, and concentrate on just a 2D illusion - like a side scroller platform game (remember Flashback!??)

Can anyone make this joint 'rope' system come to life. I'm mathmatically challenged - else I'd do it myself.

Edited by SSNautilus, 17 February 2004 - 06:11 PM.

  • 0

#13 viestituote

viestituote

    The Moinen

  • New Member
  • 84 posts

Posted 17 February 2004 - 06:23 PM

I told this theory to some one in Q&A.. I didn't test it though backthen.

But now I decided to try...

I made this little hanging rope example in about 15 minutes.. try it out.. it's rather fancy.. viestituote.tripod.com/gm/ragdoll_rope.gmd or http://kotisivu.mtv3...agdoll_rope.gmd

I just played around with it and fixed there and there... it came up like this... I have never read any tutorial...

EDIT: Added another, better link.

Edited by viestituote, 18 February 2004 - 06:19 PM.

  • 0

#14 L33TNerd

L33TNerd

    King of Geeks

  • Banned Users
  • 114 posts

Posted 17 February 2004 - 07:25 PM

the link came up as that comp language for me

Edited by L33TNerd, 17 February 2004 - 09:48 PM.


#15 Guest_Hesla3_*

Guest_Hesla3_*
  • Guests

Posted 17 February 2004 - 08:54 PM

do you mean like... umm... yeah, i have a link where there are 2 games made by "taat", its like a human that gets damage from: falling from stairs, hit by truck... and here the "doll" is very realistik...

if ragdoll is this then it is possible....

www.taat.fi

hesla

#16 SSNautilus

SSNautilus

    S.S.Nautilus

  • New Member
  • 137 posts

Posted 18 February 2004 - 12:25 AM

Yes Hesla3, thats ragdoll effects. But could you make it with GM?

viestituote, your example is very nice. :lol: I have tweaked it a bit - but it doesn't seem to work correctly - as we need some sort of 'rigidity' between the ropes - or limitation of motion - else it becomes a snake-like motion (which you can see in my version of your example):

http://www.angeltown...sc/examples.htm

Both examples are included in the Ragdoll.zip file.

I have added various bodyparts made with Poser. I hope that helps. :D
  • 0

#17 King Stephan

King Stephan

    www.gameboxsoftware.com

  • New Member
  • 734 posts

Posted 18 February 2004 - 05:55 AM

Here's a pretty neat demo with incredible physics: go to http://www.miniclip.com/ and find the game "Trial Bike Pro."
  • 0

#18 1800askgeek

1800askgeek

    GMC Member

  • New Member
  • 350 posts

Posted 18 February 2004 - 07:29 AM

Maybe this'll sound silly, but... what on earth is a "ragdoll effect"??? :huh:
  • 0

#19 bearSoft

bearSoft

    GMC Member

  • New Member
  • 1002 posts

Posted 18 February 2004 - 12:22 PM

>>viestituote the link opens the file as a html file
'save target as' alse refere to the html tag (anchor)
can u fix that?

>>nautilus. That is interesting thoughts -the thing we need to remember is that only sprite based graphics is reasonably fast on gm
if the graphics is drawn as pixels or solid figures gm gets sloggy and the fluidity is gone

the problem could very well be that it 'works' but it is useless in gamedesign due to the fps drop, (just like my old colorize.gmd btw.)

therefore succes should be jugded on whether fps can be kept unchanged high. If not the project is pure experimental and with no real 'value' in gamedesign
(amusing as it may be :)

>>hesla, the 'taat' project would be interesting to see -can u upload?
  • 0

#20 gringo

gringo

    GMC Member

  • New Member
  • 49 posts

Posted 18 February 2004 - 01:42 PM

You could fake some form of ragdoll effect for the 2d world, which woul work well in a platformer.

example

you have a torso sprite, two upper arm sprites, two lower arm sprites, ect ect.

you will need some gravity and a var assined to each limb for force and direction. So it the force from the legs as a whole is > gravity and the direction is oppersit to the gravity the object (legs) are supporting the rest of the body up right.

if the torso has a large exerting pushing it in a direction the legs force can drop and the body will fall down and in the direction of the gravity.

Im sure I could come up with an example, though if I do the sprites will be poor(black rectangles).

Gringo
  • 0

#21 Hitman

Hitman

    Shadowfied

  • New Member
  • 92 posts
  • Version:Unknown

Posted 19 February 2004 - 05:11 PM

Ok. first i propose a scientific outlook based on reason with this problem.

in other words, lets first ask (state) the problem.

-we need a realistic movement that creates an illusion of force against an object with (reliatively) some mass and densisty that it actually dosen't have.


then we need to hypothosize (brain storm) an outcome and try to visualize a ragdoll effect in real life (easily done with k-nex dudes :unsure: )

-in the world of 'the real' velocity plays a key role on inertia and rotation. IE. if a person is hit in the chest with a 50 pound wieght flying at a velocity of 30kph (excluding pain and body damage) his body will do the following. first the torso will arc away from the projectile, wthe arms will bed at the elbows and move up towards the chest(already 7 joints have been mentioned. elbows {2} shoulder{2}
torso {3})  . then the current position of the legs will manuvere in the same way of the arms but towards the the direction of the projectiles pervious velocity. that is the legs will ben at the knees {2}. then the head will arc towards the chest {1}. after that its time for momentium to kick in along with rotation and inertia. the entire body will rotate away from the projectile (clockwise if coming from the left and vise versa) with equal velocity but descreasing momentum, after that inertia will spread the limbs apart (like gravity versus friction does to sky divers) and out wards.


thus will be the outcome of a projectile hiting a human chest at 30kph . now that the 'rag doll' effect has been explained we just need to hypothosize a solution to the problem. how would we do it?

-joints are the main issue, thankfully if one is to think, three-dimensional engines are not needed for this. imaging an arm cut off at the elbow and the shoulder.
if this limb is rotated  (shoulder in the center) a radius is created (the length of the arm) . therefor two joints are seen, the elbow at

dx = x + (radius * cos(image_single*30 * 3.14 / 180));
dy = y - (radius * sin(image_single*30 * 3.14 / 180));
instance_create(dx,dy,elbowjoint)

and the shoulder at 0 (bounding x sign in sprite editor menu)

thats pretty baisic limb function (radius = the length of the are from shoulder to elbow)

the lower arm can be placed at the elbow joint (in step event jump to elbowjoint.x,.y)


so there ya have it, the same function can be done for the rest of the joints.
all that we need now is to figure out how to make thus function work for MULTIPLE objects. and of course the code that states the ragdoll effect for each limb as stated above.


we can do this if we work as a team :angry:

  • 0

#22 viestituote

viestituote

    The Moinen

  • New Member
  • 84 posts

Posted 19 February 2004 - 05:49 PM

>>viestituote the link opens the file as a html file
'save target as' alse refere to the html tag (anchor)
can u fix that?

I added the other link.. it should work correctly.

>>SSNautilus
um... you could try to move the origin of the sprites to get the limps actually seperate from the torso... It's not very realistic but it looks somewhat like it.

We can problaly never (never say never) achieve "real" ragdoll physics with GM, but we could use something like this, just a bit modified...

The next thing we could try to add is, like SSN problaly tried to say, is to get the previous part of the rope also affect to the motion.

Currently it just keeps to part in the range of 100 from the next part of the rope, I originally had some sort of code in it that would do this, but the effect wasn't very good... I'll try again today...

What I can now think of, is something like gringo said, to have a direction and force variables. In each step, the gravity is added to the force, to direction 270. Then we calculate how much we must add force from adjected parts... hmmm... We need the same algoryth as the motion_add(dir,spd)...
Anyone got it?
  • 0

#23 viestituote

viestituote

    The Moinen

  • New Member
  • 84 posts

Posted 22 February 2004 - 06:02 PM

:rolleyes: Jay! I've made an example! This time it's very life-like rubber-rope with a giant iron ball at the end! You can swing it! whoa!

Anyhow... I made my engine again completely, it's not optimized nor commented but at least it proves that natural-looking IK joints are possible with GM... I used about 10 lines of code in the step event... so it's not very heavy either...

This example doesn't include collision, that's my next project... You may play with it... Maybe you can get the idea of the engine.

Download here http://kotisivu.mtv3...gdoll_rope2.gmd

So, now it's proven that some kind of fake ragdoll physics are possible with GM. I'll still have to improve it, though...
  • 0

#24 King Stephan

King Stephan

    www.gameboxsoftware.com

  • New Member
  • 734 posts

Posted 22 February 2004 - 09:41 PM

That's funny, I made practically the same thing only mine's a bit smoother.
http://www.geocities...yer/ragdoll.zip
  • 0

#25 torrobinson

torrobinson

    GMC Member

  • New Member
  • 13 posts

Posted 23 February 2004 - 01:53 AM

Theres nothing in the zipped file ^_^ :rolleyes: :lol:
  • 0

#26 Kornbizkit1718

Kornbizkit1718

    Wanderlust

  • New Member
  • 275 posts

Posted 23 February 2004 - 04:35 AM

Dude, stephen, the link works n all, but its like 0kb big...
  • 0

#27 viestituote

viestituote

    The Moinen

  • New Member
  • 84 posts

Posted 23 February 2004 - 08:18 AM

Whoa it is the same! The code princible is just the same! Only difference is that in my example there's more parts to the rope and the attributes are a bit different (gravity, stffines, lenght, friction etc.)...
  • 0

#28 viestituote

viestituote

    The Moinen

  • New Member
  • 84 posts

Posted 23 February 2004 - 03:55 PM

Hmm... I can't figure this out... How can you make 2 objects bounce off each other realisticly depending on objects' mass, elastisicy, speed, direction and maybe rotation.

Anyone got any example of this? I think you could find some papers about this from Google, but as my school is finnish, I can't really understand sience-english so easily (if someone finds something, post the link, I'll use dictionary) as you might.
  • 0

#29 Zero_Point

Zero_Point

    GMC Member

  • New Member
  • 34 posts

Posted 24 February 2004 - 04:24 PM

Hmm... It'll probably require a special script with various algorithms to process how the certain variables play a part. For example, it you entered 10 as a variable for speed and 15 as a variable for mass, and then entered 4 as a variable for elasticity, you can set various motion actions to move the objects based on what the scripts' alogorithms produce.
  • 0

#30 Lyndon

Lyndon

    GMC Member

  • New Member
  • 78 posts

Posted 24 February 2004 - 07:53 PM

Maybe this will help you guys

http://www.dynamicdr...ndex13/band.htm
http://www.dynamicdr...13/trailer2.htm

Indeed
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users