Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Ragdolls A8 PhysX #449235
03/09/15 17:14
03/09/15 17:14
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
UPDATE!

I've recreated the ragdoll template to fix some bugs and make it overall better.
[Linked Image]

Simple human ragdoll that includes
- (more or less) proper animation blending
- 15 physical body parts
- 6D joints for head and upper arms
- Revolute (hinge) joints for the rest
- Slow motion effect (can be activated with SPACE key)

Youtube link:
https://youtu.be/Qo4QXmsd1c8

Download link:
https://github.com/3RUN/Acknex-Ragdolls

CREDITS:
- based on original ragdoll demo for ODE (back in a7) by Dennis van den Broek aka Helghast
- human model by Kenny (https://www.kenney.nl/)
- animations by Mixamo (https://www.mixamo.com/)

SOME SCREENSHOTS:
[Linked Image]
[Linked Image]


Greets!

Last edited by 3run; 05/19/20 14:22.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Ragdolls A8 PhysX [Re: 3run] #449237
03/09/15 17:43
03/09/15 17:43
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Neat, seems to work nicely. I've tried to do some simple ragdolls in the past but always found them a pain to deal with. This may come in useful for my next project.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Ragdolls A8 PhysX [Re: Superku] #449238
03/09/15 19:44
03/09/15 19:44
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I really hope that it might come in handy laugh

best regards


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Ragdolls A8 PhysX [Re: 3run] #449239
03/09/15 20:00
03/09/15 20:00
Joined: Oct 2010
Posts: 73
0110111
C
CodeMaster Offline
Junior Member
CodeMaster  Offline
Junior Member
C

Joined: Oct 2010
Posts: 73
0110111
thanks man just what i needed
i tested it and it works very well

greets!

Re: Ragdolls A8 PhysX [Re: CodeMaster] #449240
03/09/15 20:25
03/09/15 20:25
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Works good, cool stuff

also ironic that he (3)runs laugh

Re: Ragdolls A8 PhysX [Re: Reconnoiter] #449296
03/12/15 16:22
03/12/15 16:22
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I'm glad that you've found it useful guys laugh
Originally Posted By: Reconnoiter
also ironic that he (3)runs laugh
haha tongue


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Ragdolls A8 PhysX [Re: 3run] #449297
03/12/15 16:28
03/12/15 16:28
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Works great, thanks for sharing!


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Ragdolls A8 PhysX [Re: alibaba] #449397
03/18/15 14:14
03/18/15 14:14
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Nice work!

I had hoped by now someone would have made a better ragdoll model though tongue
I slightly revised the create ragdoll function, not the prettiest (argument wise), but smaller code wise (less buggy to debug as well)!

Hope someone has use of it, and I'm glad to see after all these years my little contribution is still being used laugh


Code:
ENTITY* RD_SELF = ent_create(NULL, nullvector, NULL);
ENTITY* RD_createBodyPart(STRING* fileName, STRING* boneName, VECTOR* pos, VECTOR* limits, ENTITY* attachBone, ENTITY* ent, VECTOR* attachVec, ENTITY* getPart, var numPart) {
	ENTITY* hingeEnt = ent_create(fileName, pos, RD_setPart);
	// blend angle and position for pelvis:
	RD_blendPose(hingeEnt, ent, boneName);
	// register as a physical object:
	RD_BodyPartInit(hingeEnt);
	// set rotational boundaries:
	if(limits != nullvector) { RD_setHinge(hingeEnt, attachBone, vector(0, 1, 0), limits); }
	
	ENTITY* RD_part = getPart;
	if(getPart != NULL) { if(getPart == RD_SELF) { RD_part = hingeEnt; } vec_for_vertex(attachVec, RD_part, numPart); } // get vertex to attach limb to: 
	
	return hingeEnt;
}

// create ragdoll:
void createRagdoll(ENTITY* ent){
	// vectors:
	VECTOR tempVertex;
	// go on creating the ragdoll PE objects:
	ENTITY* Pelvis = RD_createBodyPart("RD_pelvis.mdl", "pelvis", ent.x, nullvector, NULL, ent, tempVertex, RD_SELF, 14);
	// create bodypart:
	ENTITY* L_leg_up = RD_createBodyPart("RD_leg_up_left.mdl", "left_up_leg", tempVertex, vector(-50, 50, 0), Pelvis, ent, tempVertex, RD_SELF, 9);
	// create lower left part of the leg:
	ENTITY* L_leg_down = RD_createBodyPart("RD_leg_down_left.mdl", "left_low_leg", tempVertex, vector(-10, 90, 0), L_leg_up, ent, tempVertex, Pelvis, 13);
	// create right upper leg:
	ENTITY* R_leg_up = RD_createBodyPart("RD_leg_up_right.mdl", "right_up_leg", tempVertex, vector(-50, 50, 0), Pelvis, ent, tempVertex, RD_SELF, 9);
	// create right lower leg:
	ENTITY* R_leg_down = RD_createBodyPart("RD_leg_down_right.mdl", "right_low_leg", tempVertex, vector(-10, 90, 0), R_leg_up, ent, tempVertex, Pelvis, 15);
	// create stomach:
	ENTITY* Stomach = RD_createBodyPart("RD_abs.mdl", "stomach", tempVertex, vector(-15, 15, 0), Pelvis, ent, tempVertex, RD_SELF, 9);
	// create torso:
	ENTITY* Torso = RD_createBodyPart("RD_torso.mdl", "chest", tempVertex, vector(-20, 20, 0), Stomach, ent, tempVertex, RD_SELF, 9);
	// create head:
	ENTITY* Head = RD_createBodyPart("RD_head.mdl", "neck", tempVertex, nullvector, Torso, ent, tempVertex, Torso, 10);
	RD_set6DJoint(Head, Torso, vector(45, 45, 0), vector(-45, 45, 0), vector(0, -1, 0));
	// createa left upper arm:
	ENTITY* L_arm_up = RD_createBodyPart("RD_arm_up_left.mdl", "left_up_arm", tempVertex, vector(-90, 90, 0), Torso, ent, tempVertex, RD_SELF, 9);
	// createa left lower arm:
	ENTITY* L_arm_down = RD_createBodyPart("RD_arm_down_left.mdl", "left_low_arm", tempVertex, vector(-100, 35, 0), L_arm_up, ent, tempVertex, Torso, 13);
	// createa right upper arm:
	ENTITY* R_arm_up = RD_createBodyPart("RD_arm_up_right.mdl", "right_up_arm", tempVertex, vector(-90, 90, 0), Torso, ent, tempVertex, RD_SELF, 9);	
	// createa right lower arm:
	ENTITY* R_arm_down = RD_createBodyPart("RD_arm_down_right.mdl", "right_low_arm", tempVertex, vector(-100, 35, 0), R_arm_up, ent, nullvector, NULL, 0);
	
	// loop:
	while(ent){		
		// set pelvis to right position
		vec_set(ent.x, Pelvis.x);
		vec_set(ent.pan, Pelvis.pan);
		// update all physics (limb) parts
		RD_updateBoneHinge(L_leg_up, "left_up_leg", ent);
		RD_updateBoneHinge(L_leg_down, "left_low_leg", ent);
		RD_updateBoneHinge(R_leg_up, "right_up_leg", ent);
		RD_updateBoneHinge(R_leg_down, "right_low_leg", ent);
		RD_updateBoneHinge(Stomach, "stomach", ent);
		RD_updateBoneHinge(Torso, "chest", ent);
		RD_updateBoneHinge(Head, "neck", ent);
		RD_updateBoneHinge(L_arm_up, "left_up_arm", ent);
		RD_updateBoneHinge(L_arm_down, "left_low_arm", ent);
		RD_updateBoneHinge(R_arm_up, "right_up_arm", ent);	
		RD_updateBoneHinge(R_arm_down, "right_low_arm", ent);
		// wait one frame:
		wait(1);
	}
}


(just overwrite the above with the current create_ragdoll function)

regards, D.


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Ragdolls A8 PhysX [Re: Helghast] #449417
03/19/15 17:07
03/19/15 17:07
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Helghast@ thank you very much! laugh your contributions are always awesome!

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Ragdolls A8 PhysX [Re: 3run] #452687
06/22/15 12:41
06/22/15 12:41
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
WOW! Great! Thanks for sharing this one.

Ill try asap to integrate this in my project. In a7 times, i failed (never got it working as i wanted...maybe i was too stupid^^)

Thanks again guys!

edit: You guys rock! working perfect. now its only adjustment! Thank you!

Last edited by rayp; 06/23/15 15:20.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Ragdolls A8 PhysX [Re: rayp] #452759
06/24/15 14:20
06/24/15 14:20
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Ok script works with my Zombies now. But i just cant get the RD - ragdoll - models to fit my Zombie model 100%.

Any tips for this ?

Most time it looks good, then randomly like this ( spinned limbs 4ex ):

I just cant get this fixed proberly. Every help / tips is/are welcome. Im trying for hours now... frown

Short words:
Script works perfect. Ragdoll works perfect. But ragdoll mesh parts and Zombie mesh are not combined perfect, thats why randomly that strange poses appears. Dont know how2 solve, iam stuck.

Edit:
Should i blend into a dying pose before activating the ragdoll? Hows that done in Commercial games ?

Thanks

Last edited by rayp; 06/24/15 14:44.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Ragdolls A8 PhysX [Re: rayp] #452760
06/24/15 14:44
06/24/15 14:44
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Im just creating my boxes according to the current bone angles / positions.
You need alot of tweaking in sizes / scale, the rest shouldn't be too hard then.
Heres a screenshot on how they look like:

Re: Ragdolls A8 PhysX [Re: Ch40zzC0d3r] #452761
06/24/15 14:46
06/24/15 14:46
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
So theres no master blaster easy lazy way? ^^

edit: Thanks4 your answer / help! Will try your suggestions.

edit1001: I think ill found it...
edit1002: Stupid me! Bones switched and wrong script modifiction. Ahhhhh!
Thanks again the small talk helped to find that nasty one!

GREAT! love u all grin
edit1003: man still playing around ... this is hell...

Last edited by rayp; 06/24/15 16:45.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Ragdolls A8 PhysX [Re: rayp] #452764
06/24/15 17:47
06/24/15 17:47
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
This was hell grin ...but now it rocks! Enough for today. Fine tuning tomorrow.


Thanks again that u guys shared this nice script!
Greets


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Ragdolls A8 PhysX [Re: rayp] #452765
06/24/15 18:07
06/24/15 18:07
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: rayp
Edit:
Should i blend into a dying pose before activating the ragdoll? Hows that done in Commercial games ?
I've noticed in some games that they use to blend/play like half of death animation, and then body falls on ground with physics. F.e. take a look at STALKER Clear Sky.

Originally Posted By: rayp
This was hell grin ...but now it rocks! Enough for today. Fine tuning tomorrow.
I hope you've downloaded PVD and doing everything as I've adviced, other ways it's really going to be a 'guess it's working' result. BTW, you can replace original body parts with your own ones (more low poly, simply scaled boxes f.e.), cause original ones may look weird with the models you are using.

Originally Posted By: rayp
Thanks again that u guys shared this nice script!
Greets
All thanks to Helghast! For his wonderful contribution!

Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Ragdolls A8 PhysX [Re: 3run] #452766
06/24/15 18:22
06/24/15 18:22
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
I will download. First iam playing around with R A G D O L L Zombies...sick! grin

About anm - blending, ill see what looks better, thank you 3run for your quick support btw grin

edit:
playing around with some function to move ragdoll bodys with c_move / c_trace ( just a quick and dirty try ... but it works ^^ )
Code:
var trigger_running = 0;
var player_moving   = 0;
void trigger_physic (ENTITY* ent){
   if (trigger_running || !player_moving) return;
   if (!ent) return;
   trigger_running = 1;
   var _dist  = 35;
   var _ndist = 0;
   for (you = ent_next (NULL); you; you = ent_next (you)){
    	_ndist = vec_dist (ent.x, you.x);
    	if (_ndist < _dist){   	   
    	   _dist = _ndist; 
           VECTOR xspeed; // main stuff
           vec_set    (xspeed, vector(200 * time_step, 0, 100 * time_step));
           vec_rotate (xspeed, ent.pan);
           pXent_setvelocity (you, xspeed);     	   
    	}
   }
   trigger_running = 0;
 }


example call
Code:
...
while (...){
   if (key_w || key_a || key_s || key_d) player_moving = 1;
   else                                  player_moving = 0;
   c_move ( player ... );
   trigger_physic (player);
   wait (1);
}
...

remove trigger_running to use more than one trigger - physics at once.

Last edited by rayp; 06/29/15 17:37. Reason: camera.pan -> ent.pan

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Ragdolls A8 PhysX [Re: 3run] #480082
05/19/20 14:23
05/19/20 14:23
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
BUMP! UPDATE (see the first post)!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Ragdolls A8 PhysX [Re: 3run] #480088
05/19/20 19:34
05/19/20 19:34
Joined: Oct 2010
Posts: 73
0110111
C
CodeMaster Offline
Junior Member
CodeMaster  Offline
Junior Member
C

Joined: Oct 2010
Posts: 73
0110111
Thank you 3run! All your examples are very useful, and a lot things can be learned from them.

Re: Ragdolls A8 PhysX [Re: 3run] #480089
05/19/20 19:43
05/19/20 19:43
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you, I'm glad that it's useful smile

Edit: now it works with modified cct physx plugin (so you can use cct and ragdolls in one project)!

Last edited by 3run; 05/25/20 14:11.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1