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 (1 invisible), 672 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
A8 Ragdoll conversion from A7 - case study #336821
08/06/10 14:10
08/06/10 14:10
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
We were asked to help fixing the A8 version of the A7 Ragdoll demo by Helghast. As this is a good example of the problems you can encounter when converting an A7 ODE project to A8 PhysX, I'm posting here our experiences as case study.

1. Continous collision detection

For speed reasons, PhysX does not use CCD by default. This causes very small objects, such as the tiny bones of the demo, to fall through the floor. So you need to activate CCD when tiny things move fast and collide with something.

Code:
// A7 physics initialization
	fps_max = 60;
	fps_min = 30;
	
	ph_iterations = 20; // set itterating physics to smooth out.
	ph_setgravity(vector(0, 0, -668)); // set gravity
	ph_setcorrections(9000, 0); // set physics corrections
	ph_setcollisions(1000, 20);


Code:
// A8 physics initialization for CCD
	physX_open();
	pX_setgravity(vector(0, 0, -9.81)); // set gravity
	pX_setccd(1);



2. Initialize physics objects

Begin with the default settings. They will suffice in most cases. Adjust them later if necessary. The mass is calculated automatically in A8.

Code:
// A7 physics object initialization
	set(entityMe, PASSABLE);
	phent_settype(entityMe, PH_RIGID, PH_BOX);
	phent_setmass(entityMe, mass, PH_BOX);
	phent_setfriction(entityMe, 15);
	phent_setdamping(entityMe, 35, 35);
	phent_setelasticity(entityMe, 35, 30); // bounciness
	reset(entityMe, PASSABLE);


Code:
// A8 physics object initialization with CCD
	pXent_settype(entityMe, PH_RIGID, PH_BOX);
	pXent_setccdskeleton(entityMe, nullvector, 1);



3. Initialize joints

In A8, joints are addressed through the entity pointer, not through a hinge handle, and have more parameters (for instance restitution, and break limits). When you don't need a break limit, pass NULL for the vector parameter. Passing nullvector would set the break limits to 0. And don't join an object with itself! This will cause a crash, just as in real life.

Code:
// A7 hinge initialization
	var tempHinge;
	// make constraint
	tempHinge = phcon_add(PH_HINGE, constr_1, constr_2); // attach to bodypart
	phcon_setparams1(tempHinge, constr_1.x, RD_Hinge1, nullvector); // set hinge limits
	phcon_setparams2(tempHinge, RD_Hinge2, nullvector, nullvector);



Code:
// A8 hinge initialization
	// make constraint
	pXcon_add(PH_HINGE, constr_1, constr_2, 0); // attach to bodypart
	pXcon_setparams1(constr_1, constr_1.x, RD_Hinge1, NULL); // set hinge limits
	pXcon_setparams2(constr_1, RD_Hinge2, NULL, NULL); // same



4. Reading object positions

Don't disable or enable objects for reading their positions in A8. First, it is not necessary. Second, you can't displace objects that are attached to joints, so disabling an object requires removing its joints first. You don't want to do that for a ragdoll.

Code:
// A7
	pXent_enable(limb, 0);
	vec_for_bone(limb.x, actor, boneBlend); // place at right position
	ang_for_bone(limb.pan, actor, boneBlend); // rotate by right angle
	pXent_enable(limb, 1);



Code:
// A8
	vec_for_bone(limb.x, actor, boneBlend); // place at right position
	ang_for_bone(limb.pan, actor, boneBlend); // rotate by right angle





Re: A8 Ragdoll conversion from A7 - case study [Re: jcl] #336833
08/06/10 14:44
08/06/10 14:44
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Thanks alot for this!
I'm going to update my header, and create a ragdoll Demo out of it (one that actually looks good hopefully :P).

most of this I had converted already, except for the CCD stuff, and the pelvis hinge.
Would you say though creating a PH_6DJOINT is better/more effective for ragdolls?

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: A8 Ragdoll conversion from A7 - case study [Re: Helghast] #336835
08/06/10 14:50
08/06/10 14:50
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Yes, 6DJOINT has the advantage that you can add spring elements, simulating the resistance of muscles and tendons. But you need to read the nVidia documentation for learning all possibilities of 6D joints. It's a lot of pages and didn't fit into our manual.

Re: A8 Ragdoll conversion from A7 - case study [Re: jcl] #336836
08/06/10 14:54
08/06/10 14:54
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Originally Posted By: jcl
Yes, 6DJOINT has the advantage that you can add spring elements, simulating the resistance of muscles and tendons. But you need to read the nVidia documentation for learning all possibilities of 6D joints. It's a lot of pages and didn't fit into our manual.


That's no problem, im used to reading alot of documentation, I will go ahead and take a look at this, and possibly convert it at a later point. For now I think the Demo would be a bigger use to the community.

Another question, how does the speed of a collision type of PH_BOX vs PH_CAPSULE hold up against each other? I feel humanoid ragdolls would benefit from using capsules rather then using boxes, am I right in this case?


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: A8 Ragdoll conversion from A7 - case study [Re: Helghast] #336871
08/06/10 18:12
08/06/10 18:12
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
there are some really good pieces of small tips on that post, i suggest this to be either sticky or go in to the a7->a8 part of manual/aum.

Last edited by Quadraxas; 08/06/10 18:12.

3333333333
Re: A8 Ragdoll conversion from A7 - case study [Re: Quad] #336877
08/06/10 18:26
08/06/10 18:26
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
I'll make it sticky. - PH_BOX is faster than PH_CAPSULE, and is normally sufficient for a ragdoll bone. PH_CAPSULE is mostly used for character controllers.

Re: A8 Ragdoll conversion from A7 - case study [Re: jcl] #337810
08/13/10 15:38
08/13/10 15:38
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline
Member
yorisimo  Offline
Member
Y

Joined: Mar 2007
Posts: 197
How do we make a motorized hinge joint in A8? (In A7 we could just use phcon_setmotor, but a similar function does not exist in A8) I would be OK using the more complicated 6D joint if that is the solution. Are joint motors/springs/dampers implemented yet in A8: in the manual under pXcon_set6djoint it says that JointDrive[6] is unused.

I am having trouble finding the PhysX SDK Manual. Does anyone have a copy they can send me? It seems NVIDIA is delayed in giving developers access to the PhysX SDK. I don't necessarily want the source code, just the manual.

How are swing1Motion, swing2Motion and twistMotion defined (about local/global x, y, an z axes?)

EDIT: testing it out... looks like swing1Motion is pan (z), swing2Motion is tilt (-y) and twistMotion is roll (x) relative to bodies starting orientations. I think the documentation would be a lot more clear if it used the standard Gamestudio descriptions pan/tilt/roll than the non descriptive swing1/swing2/twist

What I don't understand is why the 6D Joint needs a Rotation Axis parameter defined by pX_setparams1 (Parameter 2), since the axes are defined using pXcon_set6djoint. I also don't understand why Parameter 4 sets both swing1 and swing2 limit in the x and y parameters, whereas Parameter 5 sets the lower and upper limit of twist in the x and y parameters. How do you set the lower and upper limits independently for swing1/swing2? For Parameter 6, shouldn't you be able to set the x,y,and z linear limits independently?

Also, will pXcon_getposition support the 6D Joint as well? There would be up to 6 values (x,y,z,pan,tilt,roll) that it would need to return

Thanks

Last edited by yorisimo; 08/13/10 19:16.
Re: A8 Ragdoll conversion from A7 - case study [Re: yorisimo] #343020
10/03/10 08:36
10/03/10 08:36
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
So, did somebody made it???



Re: A8 Ragdoll conversion from A7 - case study [Re: Random] #344519
10/17/10 21:35
10/17/10 21:35
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
I'm also interested in this... Helgast? Anyone??

Re: A8 Ragdoll conversion from A7 - case study [Re: HeelX] #344541
10/18/10 09:34
10/18/10 09:34
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Originally Posted By: HeelX
I'm also interested in this... Helgast? Anyone??


Due to deadlines at work, and freelance contracts which have my priority, I have been unable as of yet to convert this properly.
I cant tell yet either when exactly I will have it done... as the coming 6 weeks I'm gonna be crunching at the project at work.

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: A8 Ragdoll conversion from A7 - case study [Re: Helghast] #348851
12/01/10 08:13
12/01/10 08:13
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Im done converting.
Works good, should I make a demo?



Re: A8 Ragdoll conversion from A7 - case study [Re: Random] #348859
12/01/10 08:44
12/01/10 08:44
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany

hi,

yeah I want to see the action.


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: A8 Ragdoll conversion from A7 - case study [Re: gri] #348861
12/01/10 09:05
12/01/10 09:05
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Yeah would be cool!


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: A8 Ragdoll conversion from A7 - case study [Re: Dark_samurai] #348866
12/01/10 10:08
12/01/10 10:08
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Sure!
Including converted source code! laugh

Re: A8 Ragdoll conversion from A7 - case study [Re: Pappenheimer] #348876
12/01/10 13:17
12/01/10 13:17
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Ok, just a second grin



Re: A8 Ragdoll conversion from A7 - case study [Re: Random] #348877
12/01/10 13:21
12/01/10 13:21
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Ok, the code itself is fine, but how I set the bones in the model is very crapy...
So please don`t reminde grin



Re: A8 Ragdoll conversion from A7 - case study [Re: Random] #348884
12/01/10 15:07
12/01/10 15:07
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Ok here is it;
download link

Please don`t tell me that the ragdolls are ugly!
Setting bones in the right place is not my strenght grin



Re: A8 Ragdoll conversion from A7 - case study [Re: Random] #348886
12/01/10 15:15
12/01/10 15:15
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
mm I hoped at least some credits of my converted code lol


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: A8 Ragdoll conversion from A7 - case study [Re: painkiller] #348888
12/01/10 15:25
12/01/10 15:25
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Oh, thanks painkiller I allmost forgot.
It`s converted by painkiller grin

Sorry wink



Re: A8 Ragdoll conversion from A7 - case study [Re: Random] #348959
12/02/10 08:48
12/02/10 08:48
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany

hey,

thank you for your work.
I will take a look at your template at lunchtime.

regards,
maik


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Re: A8 Ragdoll conversion from A7 - case study [Re: gri] #348983
12/02/10 14:43
12/02/10 14:43
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
No problem grin



Re: A8 Ragdoll conversion from A7 - case study [Re: Random] #375741
06/27/11 17:26
06/27/11 17:26
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Ive downloaded the archive and startet the exe file. I get an error message saying: "Cant initialize PhysX" ...whats that ?

Edit: Maybe i should install PhysX before grin

Last edited by rayp; 06/27/11 17:30.

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: A8 Ragdoll conversion from A7 - case study [Re: rayp] #393232
02/01/12 17:06
02/01/12 17:06
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Are there any good ragdoll examples out there? (made with physX)



Re: A8 Ragdoll conversion from A7 - case study [Re: Random] #393234
02/01/12 17:15
02/01/12 17:15
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
in AUM 100 there is a ragdoll code example made by Rojart


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: A8 Ragdoll conversion from A7 - case study [Re: painkiller] #393297
02/01/12 23:30
02/01/12 23:30
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
but it doesn't blend from animations, right?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: A8 Ragdoll conversion from A7 - case study [Re: 3run] #393305
02/02/12 00:50
02/02/12 00:50
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
Originally Posted By: 3run
but it doesn't blend from animations, right?

didnt helghast add that feature from A7 days ?

Re: A8 Ragdoll conversion from A7 - case study [Re: darkinferno] #393318
02/02/12 08:59
02/02/12 08:59
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I meant example from AUM 100, not the one which was made by Helghast.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: A8 Ragdoll conversion from A7 - case study [Re: 3run] #396338
03/05/12 20:02
03/05/12 20:02
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Nop, it doesn`t...
I would also be interested in a ragdoll code (physX), which blends in from animations.
Were can I find the code from Helghast? Maby we can convert it to physX?



Re: A8 Ragdoll conversion from A7 - case study [Re: Random] #396340
03/05/12 20:37
03/05/12 20:37
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
There are ragdolls for newton too?
Newton is awesome, in my opinion much more reslistic than physx.
But physx is faster!

Re: A8 Ragdoll conversion from A7 - case study [Re: Ch40zzC0d3r] #396430
03/06/12 21:01
03/06/12 21:01
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
There are some weird problems with the converted ragdoll code.
example:
video of the problem

And if you want to test it:
download

Anybody has an idea what is going on?



Re: A8 Ragdoll conversion from A7 - case study [Re: Random] #397104
03/14/12 15:44
03/14/12 15: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
I just use another model with other bone-names and some other placed bones. Now when it comes to ragdolls, its looking, ... SHIT!
The arms are like a bow, the legs are too long. I just changed the enemy.mdl model + the code...
Please help frown

Code:
RD_blendPose(Pelvis, you, "Bip01");
RD_blendPose(L_leg_up, you, "Bip01_L_Thigh");
RD_blendPose(L_leg_down, you, "Bip01_L_Calf");
RD_blendPose(R_leg_up, you, "Bip01_R_Thigh");
RD_blendPose(R_leg_down, you, "Bip01_R_Calf");
RD_blendPose(Stomach, you, "Bip01_Spine2"); //Bip01_Spine1
RD_blendPose(Torso, you, "Bip01_Spine3");
RD_blendPose(L_arm_up, you, "Bip01_L_UpperArm");
RD_blendPose(L_arm_down, you, "Bip01_L_Forearm");
RD_blendPose(R_arm_up, you, "Bip01_R_UpperArm");
RD_blendPose(R_arm_down, you, "Bip01_R_Forearm");
RD_blendPose(Head, you, "Bip01_Head");

while(you) {
// set pelvis to right position
vec_set(you.x, my.x);
vec_set(you.pan, my.pan);

// update all physics (limb) parts
RD_updateBoneHinge(L_leg_up, "Bip01_L_Thigh", you);
RD_updateBoneHinge(L_leg_down, "Bip01_L_Calf", you);
RD_updateBoneHinge(R_leg_up, "Bip01_R_Thigh", you);
RD_updateBoneHinge(R_leg_down, "Bip01_R_Calf", you);
RD_updateBoneHinge(Stomach, "Bip01_Spine2", you);
RD_updateBoneHinge(Torso, "Bip01_Spine3", you);
RD_updateBoneHinge(L_arm_up, "Bip01_L_UpperArm", you);
RD_updateBoneHinge(L_arm_down, "Bip01_L_Forearm", you);
RD_updateBoneHinge(R_arm_up, "Bip01_R_UpperArm", you); 
RD_updateBoneHinge(R_arm_down, "Bip01_R_Forearm", you);
RD_updateBoneHinge(Head, "Bip01_Head", you);

wait(1);
}



Model DL: http://www.mediafire.com/?7fik1mq3btaow3e

Re: A8 Ragdoll conversion from A7 - case study [Re: Ch40zzC0d3r] #397247
03/16/12 21:10
03/16/12 21:10
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Nobody wanna help me?
Really nice from you...

Page 1 of 4 1 2 3 4

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