Jump to content
The Dark Mod Forums
Sign in to follow this  
Bikerdude

Hanging ragdolls: world of pain.

Recommended Posts

Tring to get a ragdoll to stay attached to a hangmans rope, bothing Ive tried works. so started having a look on the forum -

 

- http://forums.thedarkmod.com/topic/7586-attach-entities-to-tdm-ropes-how/

- http://forums.thedarkmod.com/topic/7637-hanging-ragdolls-worth-it/

 

but not found much help there or even an example prefab...

Share this post


Link to post
Share on other sites

LOL. I almost got a hanging ragdoll to work once...almost. Several hours were spent experimenting with which entity was bound to which, and encapsulating the ragdoll with thin nodraw_solid brushes until it didn't fall out of place (including thin shims under the armpits and crotch). The ragdoll eventually ended up twitching enough to throw the rope off angle, making it disconnect from the gallows. Lots of similar problems.

Edited by PranQster

Linux pranqster 5.5.13-desktop-1.mga8 #1 SMP Wed Mar 25 16:52:32 UTC 2020 x86_64 x86_64 x86_64 GN
U/Linux

Share this post


Link to post
Share on other sites

Necro'ing because I think I've got somewhere with this:

hanged_ragdoll.jpg.395f68c9376a9a9731d9d63aea118a21.jpg

The way the noose looks isn't ideal: I had to scale it in DR in the first place, since the original obviously wasn't designed to go with the AI necks, and before I set the noose nonsolid the ragdoll would twitch around for a bit and then settle without a nicely drooping look. So you might want to continue using Sotha's anim (especially if you want a swinging-in-wind effect like in PD2, which this method won't allow). If you'd like a hanged ragdoll, though, this seems viable. Basically you take the modified AF below, save it as af/guard_base_newskel_hanged.af, and give the ragdoll an "articulatedFigure" "guard_base_newskel_hanged" spawnarg. This causes the head to be bound to the world, so it stays in position, but the rest of the body still has ragdoll physics (I also made it solid to the player).



/*
	Generated by the Articulated Figure Editor.
	Do not edit directly but launch the game and type 'editAFs' on the console.
*/

articulatedFigure guard_base_newskel_hanged {

settings {
	model "tdm_ai_citywatch"
	skin ""
	friction 0.09, 0.09, 0.45  //friction 0.01, 0.01, 0.15   // old values made AI slide down stairs or ramps
	suspendSpeed 20, 30, 40, 60
	noMoveTime 1
	noMoveTranslation 1
	noMoveRotation 1
	minMoveTime -1
	maxMoveTime 15
	totalMass 100
	//contents corpse
	//clipMask solid, corpse
	contents corpse, playerclip
	clipMask solid, body, corpse
	selfCollision 1
}

body "waist" 
{
	joint "origin"
	mod orientation
	model box( ( -5.5, -6.5, -8 ), ( 5.5, 6.5, 3 ) )
	origin bonecenter( "Hips", "Spine1" )
	density 0.2
	friction 0.01, 0.01, 0.25
	selfCollision 1
	containedJoints "*origin  -*spine1 -*leftupleg  -*rightupleg"
}

body "chest" 
{
	joint "Spine1"
	mod orientation
	model box( ( -5.5, -7, -9.5 ), ( 5.5, 7, 6 ) )
	origin bonecenter( "Spine", "Head" )
	density 0.2
	friction 0.01, 0.01, 0.25
	selfCollision 1
	containedJoints "*spine1 -*neck -*leftarm -*rightarm"
}

body "head" 
{
	// joint "Head"
	joint "Spine2"
	mod orientation
	model box( ( -4, -3, -6 ), ( 4, 3, 3.5 ) )
	origin ( -2, 0, 75 )
	density 0.4
	selfCollision 1
	containedJoints "*neck"
}

body "rupleg" {
	joint "RightUpLeg"
	mod orientation
	model bone( joint( "RightUpLeg" ), joint( "RightLeg" ), 6 )
	origin bonecenter( "RightUpLeg", "RightLeg" )
	density 1
	selfCollision 1
	containedJoints "*rightupleg -*rightleg"
}

body "rloleg" {
	joint "RightLeg"
	mod orientation
	model cone( ( -6.5, -4, -9 ), ( 6.5, 4, 12.5 ), 3 )
	origin joint( "RightLeg" )
	density 1
	friction 0.05, 0.05, 0.17
	selfCollision 1
	containedJoints "*rightleg"
}

body "ruparm" {
	joint "RightArm"
	mod orientation
	model bone( joint( "RightArm" ), joint( "RightForeArm" ), 10 )
	origin bonecenter( "RightArm", "RightForeArm" )
	density 1
	selfCollision 1
	containedJoints "*rightarm -*rightforearm"
}

body "rlowarm" {
	joint "RightForeArm"
	mod orientation
	model bone( joint( "RightForeArm" ), joint( "RightHandRing3" ), 8 )
	origin bonecenter( "RightForeArm", "RightHandRing3" )
	density 1
	selfCollision 1
	containedJoints "*rightforearm"
}

body "Lupleg" {
	joint "LeftUpLeg"
	mod orientation
	model bone( joint( "LeftUpLeg" ), joint( "LeftLeg" ), 6 )
	origin bonecenter( "LeftUpLeg", "LeftLeg" )
	density 1
	selfCollision 1
	containedJoints "*leftupleg  -*leftleg"
}

body "Llowleg" {
	joint "LeftLeg"
	mod orientation
	model cone( ( -6.5, -4, -9), ( 6.5, 4, 12.5 ), 3 )
	origin joint( "LeftLeg" )
	density 1
	friction 0.05, 0.05, 0.17
	selfCollision 1
	containedJoints "*leftleg"
}

body "Luparm" {
	joint "LeftArm"
	mod orientation
	model bone( joint( "LeftArm" ), joint( "LeftForeArm" ), 10 )
	origin bonecenter( "LeftArm", "LeftForeArm" )
	density 1
	selfCollision 1
	containedJoints "*leftarm -*leftforearm"
}

body "Llowarm" {
	joint "LeftForeArm"
	mod orientation
	model bone( joint( "LeftForeArm" ), joint( "LeftHandRing3" ), 8 )
	origin bonecenter( "LeftForeArm", "LeftHandRing3" )
	density 1
	selfCollision 1
	containedJoints "*leftforearm"
}

/*
fixed "waist" {
	body1 "waist"
	body2 "chest"
}
*/

universalJoint "head" {
	body1 "head"
	body2 "chest"
	// anchor joint( "Neck" )
	anchor joint( "Spine2" )	
	shafts ( 0.0000001629, 0, 1 ), ( 0.0000004888, 0, -1 )
	friction 0.5
	coneLimit ( -0.0000001629, 0, 1 ), 60
}

universalJoint "rupleg" {
	body1 "rupleg"
	body2 "waist"
	anchor joint( "RightUpLeg" )
	shafts ( 0.0000004888, 0, -1 ), ( 0.0000001629, 0, 1 )
	friction 0.3
	coneLimit ( 0.3535537422, -0.3535535038, -0.8660252094 ), 40
}

hinge "rloleg" {
	body1 "rloleg"
	body2 "rupleg"
	anchor joint( "RightLeg" )
	axis ( 0.0000004888, -1, 0 )
	friction 0.15
	limit 130, 70, 90
}

universalJoint "ruparm" {
	body1 "ruparm"
	body2 "chest"
	anchor joint( "RightArm" )
	shafts ( 0.0000004888, -1, 0 ), ( -0.0000001629, 1, 0 )
	friction 0.35
	coneLimit ( 0.0000004813, -0.9848078489, -0.173647508 ), 140
}

universalJoint "rlowarm" {
	body1 "rlowarm"
	body2 "ruparm"
	anchor joint( "RightForeArm" )
	shafts bonedir( "RightForeArm", "RightHand" ), bonedir( "RightHand", "RightForeArm" )
	friction 0.25
	coneLimit ( 0.6427878737, -0.7660441995, 0 ), 80
}

universalJoint "Lupleg" {
	body1 "Lupleg"
	body2 "waist"
	anchor joint( "LeftUpLeg" )
	shafts ( 0.0000004888, 0, -1 ), ( 0.0000001629, 0, 1 )
	friction 0.3
	coneLimit ( 0.3535535932, 0.3535536528, -0.8660252094 ), 40
}

hinge "Llowleg" {
	body1 "Llowleg"
	body2 "Lupleg"
	anchor joint( "LeftLeg" )
	axis ( 0.0000004888, -1, 0 )
	friction 0.15
	limit 130, 70, 90
}

universalJoint "Luparm" {
	body1 "Luparm"
	body2 "chest"
	anchor joint( "LeftArm" )
	shafts ( -0.0000001629, 1, 0 ), ( 0.0000004888, -1, 0 )
	friction 0.35
	coneLimit ( -0.0000001604, 0.9848078489, -0.173647508 ), 140
}

universalJoint "Llowarm" {
	body1 "Llowarm"
	body2 "Luparm"
	anchor joint( "LeftForeArm" )
	shafts bonedir( "LeftForeArm", "LeftHand" ), bonedir( "LeftHand", "LeftForeArm" )
	friction 0.25
	coneLimit ( 0.6427875757, 0.7660444975, 0 ), 90
}

universalJoint "chest" {
	body1 "chest"
//	body2 "head"
	body2 "waist"
	anchor joint( "Spine1" )
	shafts bonedir( "Hips", "Head" ), bonedir( "Head", "Hips" )
	friction 0.5
	coneLimit bonedir( "Spine1", "Head" ), 30
}

fixed "headnoose" {
	body1 "head"
	body2 "world"
}

}

  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

I didn't know this was something you guys add problems with!  The Doom 3 game and Grimm (also using idtech 4) have hanged ragdolls, Grimm even use them to good effect to make simple dynamic cloth. The Doom 3 one (hanged by one feet) can even move about like a pendulum.   The trick like you found out is to bind the bone you want stuck to the world (with the AF editor).  But your method VanishedOne, even tho works, unfortunately makes the character unrealistically stuck in the world by the head.

Like you guys also found out, binding a ragdoll to another, doesn't not work (afaik) in idtech 4, it will just cause collision problems.

If you guys want to have realistic hanged ragdolls , that can be moved about realistically, than the only way I know (apart from animation...), is to make the rope part of the character rig (in Blender), in that way the body and rope will just be one single skeleton/ragdoll. 

Btw when you drag a dead AI character around you are essentially making a "hanged" ragdoll. ?

Edited by HMart
  • Like 1

Share this post


Link to post
Share on other sites

Quake 4 assets reference 'meat hooks' that appear to involve binding a ragdoll to an animated entity, but I'm not certain of the workings, especially a line in the ragdoll's script that uses bindConstraint.


Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Share this post


Link to post
Share on other sites

Oh yes i know that scene in Quake 4, is where they have the marine corpses going around on conveyor belts in meat hooks for stroggification!

I was mistaken, is possible to attach a af to a animated object, In the script and specially in the c++ code you can bind a bone to anything (you can even animate bones with code). 

Btw the crane script in Doom 3 can give some clues on how to attach af objects to animated objects.

This particular piece of the script code, does the binding, you can see bindConstraint mentioned there and also the keyword "fixed" this last one says that is a fixed bind, instead of "fixed" you also have "ballAndSocket" that is what the dragentity tool uses (permits the af to move around) and imo should be used for a hanged ragdoll.

/*
============
crane_pickup

close the claw and bind
============
*/
void crane_cmd_pickup() {
	vector begin, end;
	string bindJoint, bindBody;

	if ( !( !bindEntity ) ) {
		return;
	}

	crane_have_object = false;
	bindJoint = bindBody = "";

	sound_crane_fingers_close();
	
	$crane.setFingerAngle( 20 );
	sys.wait( 2.0f );
	$crane.stopFingers();

	begin = $crane_trace_start.getWorldOrigin();
	end = $crane_trace_end.getWorldOrigin();

	sys.trace( begin, end, '0 0 0', '0 0 0', MASK_SOLID|CONTENTS_RENDERMODEL, $crane_hang );
	bindEntity = sys.getTraceEntity();
	if ( !( !bindEntity ) && ( bindEntity != $world ) ) {
		bindJoint = sys.getTraceJoint();

		if ( bindJoint ) {
			bindBody = sys.getTraceBody();
			if ( bindBody ) {
				bindEntity.setKey( "bindConstraint bind1", "fixed " + bindBody + " " + bindJoint );
				bindEntity.bindToJoint( $crane, "crane", 1 );
				crane_have_object = true;
			}
		} else {
			bindEntity.bindToJoint( $crane, "crane", 1 );
			crane_have_object = true;
		}
	}

	// automatically move up
	crane_move( $crane_hang, UP, crane_maxs_z - crane_pos_z, false );

	if ( !crane_have_object ) {
		sound_crane_fingers_open();
		$crane.setFingerAngle( -60 );
		bindEntity = $null_entity;
	} else {
		$main_control_gui.setGuiParm ( "gui_parm1" , 1);
	}
}

 

Btw looking at the c++ code that manages this in the dragEntity tool, it seems "bindConstrain bind" are both required, only the number changes in the c++ code.  so you need to say bind1, bind2, etc.

key.Strip( "bindConstraint " );
		if ( sscanf( key, "bind%d", &num ) ) {
			if ( num >= largestNum ) {
				largestNum = num + 1;
			}
		}

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...