Advice about swordfighting game and ragdoll

jettero heller

03-09-2008 15:57:30

Hello everyone

I'm new to NxOgre Forum, this is my first post so I greet the entire community :)

I'm designing a 3D swordfighting game
The damage system is based on the hit point (head, chest, legs) and the player can parry the blows
I've the blows animations within a .skeleton
I thought about using ragdoll like this but when the shapes follow the bones, collision detection is disabled

itBone->pPhysxBone->raiseActorFlag(NX_AF_DISABLE_COLLISION);
itBone->pPhysxBone->raiseBodyFlag(NX_BF_KINEMATIC);
itBone->pPhysxBone->putToSleep();


if I understood correctly while I need collision detection active

Can I do this or do you advise me another metod?

betajaen

03-09-2008 16:08:16

Sup.

What about making them not kinematic to enable collision, turn off gravity so they the arms won't fall down, and very high angular/linear damping so they won't float way.

jettero heller

04-09-2008 15:15:55

uhm...

...so should I:
1) make them kinematic
2) move them with setGlobalPose()
3) disable kinematic

for each frame?

Thanks for the help! :)

betajaen

04-09-2008 16:11:13

I wouldn't; it may upset PhysX.

I would try and work out the required force and torque to move each limb into the correct position.

reptor

04-09-2008 16:26:04

I think it would be better to control the character normally with animations and only enable the ragdoll mode when the character needs to fall down, like when it is dying or almost dying. Or just thrown back or something.

Then when the player gets the control of the character back, the ragdoll mode is disabled.

I think that is what commercial games which have ragdolls do.

jettero heller

04-09-2008 20:52:52

I wouldn't; it may upset PhysX.

I would try and work out the required force and torque to move each limb into the correct position.


:shock:

uhm.. I coud use bones' start and end poses at each frame to compute forces and torques but this seems me too complicated...
My goal is to make sure that physic model follows animations with collision detection active.
Swords and fighters are different actors.
When sword collides sword I've to stop animation and play a sound and when sword collides fighter I've to decrease life.

If you can not I have to use a simpler method...


According to you, how collision detection is made in a game like this?

Tnx in advance.

reptor

04-09-2008 21:57:07

You can use physics without ragdoll, or can you not. This would be when you are playing animations.

This way you wouldn't have to "work out the required force and torque to move each limb into the correct position" which in my opinion would be ridiculously difficult to do, if the aim would be to substitute the animations with that method (I'm not sure if that's what betajaen meant).

When a character's throat has been sliced, and it can't stand up anymore, you would stop animations and change the physics to have the ragdoll. So it would fall to the ground like a ragdoll.

Notice, a ragdoll by itself doesn't look natural so I think a lot of tuning needs to be made to have a realistic-looking behaviour.

betajaen

04-09-2008 22:26:39

This way you wouldn't have to "work out the required force and torque to move each limb into the correct position" which in my opinion would be ridiculously difficult to do, if the aim would be to substitute the animations with that method (I'm not sure if that's what betajaen meant).

I have seen videos and tech demos doing something like this, and the new Character System will probably have something similar to that anyway. Of course calculating of the required torque and force is going to be difficult, but not ridiculously difficult.

jettero heller

04-09-2008 23:12:19

Ragdoll effect isn't my goal. I thougth using ragdoll to fit shapes to animations for a better collision detection.
So could I use kinematic actors with collision detection flag active clearActorFlag(NX_AF_DISABLE_COLLISION) and move them with setGlobalPose() instead of keep them dynamic and move them with forces and torques :?:

If yes...

for the Ageia Docs:

"Kinematic actors will collide with true dynamic actors but not with static actors. This may also change in the future"
Means this that my player will cross houses and walls? :shock:

"Kinematics that move into contact with statics or with other kinematics will not generate contact reports."
Means this that no collision callback will be generated? :evil:

"Kinematic objects are never halted by CCD and so using CCD for fast-moving kinematic bodies has no effect"
If CCD has no effect, may collisions between thin shapes like swords be missed? :cry:

thanks for your patience :D