Prop ragdoll: Difference between revisions
No edit summary |
MyGamepedia (talk | contribs) No edit summary |
||
(78 intermediate revisions by 29 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LanguageBar}} | ||
{{ | {{seealso|For details on creating a ragdoll, see {{ent|mode=name|$collisionjoints}}.}} | ||
{{Split|Split Black Mesa and Valve games to separate pages}} | |||
{{CD|CRagdollProp|file1=1}} | |||
[[File:prop_ragdoll.jpg|thumb|prop_ragdoll can interact with dynamic objects, unlike death ragdolls.]] | |||
= | {{this is a|model entity|name=prop_ragdoll}} It is a [[VPhysics]] [[Wikipedia:Ragdoll physics|ragdoll]]. Ragdolls are collections of physics objects constrained together to simulate a jointed object like a dead body. They are very [[expensive]] to simulate. | ||
* | {{warning|This entity generates server-side ragdolls, which collide with everything but produce very large amounts of network traffic. Network traffic can be significantly reduced by making the ragdoll start asleep, disabling motion and disabling collisions with dynamic objects ({{not in FGD}} add "solid" keyvalue with value of 0) and only enabling motion when necessary.}} | ||
{{bug|Setting a custom pose via Hammer and making the ragdoll start asleep will make the rendering box fail to update. Making the ragdoll wake for a single frame when spawned and then sleeping it will fix this issue.|tested={{portal}},{{p2ce}}}} | |||
{{bug|{{Portal2|4}} ragdolls cannot pass through portals. This often occurs in {{Portal|4}} as well.|hidetested=1}} | |||
{{bug|Ragdolls are ignored in prediction, this causes lots of prediction errors when touching a ragdoll.|tested={{bms}},{{hl2dm}}}} | |||
{{altnames|name1=physics_prop_ragdoll}} | |||
{{Expand|title={{bms|4}} specific notices and bugs.| | |||
{{note|Original entity version is available as <code>prop_ragdoll_original</code>. The difference is: <code>prop_ragdoll_original</code> can't be gibbed with explosions, crowbar can hit <code>prop_ragdoll_original</code> if <code>[4] Debris</code> spawnflag is unchecked (crowbar's raycast skips <code>prop_ragdoll</code> for some reason), <code>prop_ragdoll_original</code> doesn't bleed or have decals on it, <code>prop_ragdoll_original</code> can't be picked up, <code>prop_ragdoll_original</code> have realistic bullet push.}} | |||
{{bug| | |||
* server side ragdolls created by NPCs never gib before loading save since the first Steam version, the same for gibs created by gibbed ragdolls. Use [https://community.lambdageneration.com/black-mesa/post/efesc2f8cyf the workshop addon] if you want to use server side ragdolls in your mod. | |||
* crowbar's raycast skips/ignores server side ragdolls since the first [[Steam]] version. | |||
* Tripmines do not gib ragdolls | |||
* In multiplayer ragdolls do not create hole decals and blood from bullets if <code>[4] Debris</code> spawnflag is enabled. If this flag is disabled - ragdolls still will not create blood effects and hand blood overlays.|hidetested=1}} | |||
}} | |||
==Death Ragdolls/Ragdoll Transformation== | |||
When a NPC/player dies or an entity receives the <code>BecomeRagdoll</code> input, it normally creates a [[client_ragdoll|'''client-side''' ragdoll]] and copies most of its animation and visual data to it. Unlike server-side <tt>prop_ragdoll</tt>s, these client-side ragdolls are handled completely on a per-client basis and are ''much'' cheaper and simpler than their server-side counterparts, at the expense of being virtually nonexistent on the server, being inconsistent across client perspectives, and only colliding with entities that have physics objects on the client (e.g. {{ent|mode=name|worldspawn}}). | |||
However, a NPC will become a server-side ragdoll while it's under any of the following conditions: | |||
* The NPC is inside the volume of a {{ent|mode=name|trigger_serverragdoll}} | |||
* The NPC is killed by a vehicle in singleplayer | |||
* The [[weapon_physcannon|gravity gun]] is supercharged | |||
* The NPC dies on fire while in [[env_global|Alyx darkness mode]] | |||
* The NPC is a vital ally (e.g., {{ent|mode=name|npc_alyx}}) | |||
These server-side death ragdolls will collide with physics objects and beyond, like any <tt>prop_ragdoll</tt>, but they are marked as debris and do not collide with each other. They do not collide with ''themselves'' either, unlike client-side ragdolls (fixed in {{ez2|4}} and {{bms|4}}). This is believed to be intentional behavior to reduce performance/networking costs. | |||
{{bug|Server side ragdolls don't save blood decals. Fixed in {{mapbase|4}} and {{bms|4}}.|tested={{hl2}},{{p2ce}}}} | |||
{{note|Most of this list ''theoretically'' applies to players as well, although that hasn't been tested.}} | |||
{{warning|While most of the relevant animation/visual data is copied to ragdolls, some fields, like fade distances, are not transferred.}} | |||
: {{codenote|This can be modified at <code>CBaseAnimating::CopyAnimationDataFrom()</code> in <code>baseanimating.cpp</code> for server-side ragdolls and <code>C_BaseAnimating::CreateRagdollCopy()</code> in <code>c_baseanimating.cpp</code> for client-side ragdolls.}} | |||
==Keyvalues== | ==Keyvalues== | ||
{{KV Targetname}} | |||
{{KV|Override Animation|intn=angleOverride|string|List of joint rotations in the format <code>index,x y z,...</code>. Filled in by the engine via [[hammer_update_entity]] or after simulating ragdolls in {{hammerpp|2}} physics simulation.}} | |||
{{Expand|title=Non-Valve games {{gmod}}{{bms}}| | |||
{{KV|Health|intn=health|integer|The amount of damage the ragdoll takes before gibbing.|only=BMS}} | |||
{{KV|Character Manifest Mimic Name|intn=MimicName|string|Choose a name or a classname from the character manifest to dress the ragdoll.|only=BMS}} | |||
{{KV GMOD}} | |||
}} | |||
{{expand|title=CBaseAnimating|{{KV CBaseAnimating|no sequence=1}}}} | |||
==Flags== | ==Flags== | ||
{{fl|4|Debris|Don't collide with the player or other debris}} | |||
{{fl|4096|Use 'Least Recently Used' Retirement|nofgd=1|LRU in this case it's referring to Source's ragdoll cleanup system, which automatically removes ragdolls which haven't been used. Serverside ragdolls spawned by NPCs are automatically added to this system, while prop_ragdolls spawned by the map are not}} | |||
{{fl|8192|Allow Dissolve|Allow dissolve by [[prop_combine_ball]]|only={{hl2}}{{portal series}}{{confirm}}}} | |||
{{fl|16384|Motion Disabled}} | |||
{{fl|32768|Allow stretch}} | |||
{{fl|65536|Start asleep}} | |||
==Inputs== | ==Inputs== | ||
{{I|StartRagdollBoogie|Begins ragdoll boogie effect for 5 seconds.{{bug|This input is actually supposed to use a parameter for how long the ragdoll should boogie, but it uses the wrong field type in the data description.{{code fix|In <code>CRagdollProp</code>'s data description, find <code>DEFINE_INPUTFUNC( FIELD_VOID, "StartRagdollBoogie", InputStartRadgollBoogie )</code> and replace <code>FIELD_VOID</code> with <code>FIELD_FLOAT</code>.}} | |||
|hidetested=1 | |||
}} | |||
}} | |||
{{I|EnableMotion / DisableMotion|Enable / disable physics simulation.}} | |||
* | {{I|FadeAndRemove|Fade out then remove (kill) self. Parameter override <nowiki>=</nowiki> duration of fade.|since={{hl2ep2}}}} | ||
* | {{I|AllowBloodPool|Сorpse once will create pool of blood (particle effect) if it is placed on brush. {{note|Not available for <code>prop_ragdoll_original</code> and <code>prop_ragdoll_attached</code>.}}|nofgd=1|only={{bms}}}} | ||
== See Also == | |||
* {{ent|env_ragdoll_boogie}} | |||
* [[Prop Types Overview]] | |||
[[Category:Physics]] | |||
[[Category:Prop entities|ragdoll]] |
Latest revision as of 09:48, 28 June 2025
![]() |
---|
CRagdollProp |
![]() |
prop_ragdoll
is a model entity available in all Source games. It is a VPhysics ragdoll. Ragdolls are collections of physics objects constrained together to simulate a jointed object like a dead body. They are very expensive to simulate.


physics_prop_ragdoll
.
![]() prop_ragdoll_original . The difference is: prop_ragdoll_original can't be gibbed with explosions, crowbar can hit prop_ragdoll_original if [4] Debris spawnflag is unchecked (crowbar's raycast skips prop_ragdoll for some reason), prop_ragdoll_original doesn't bleed or have decals on it, prop_ragdoll_original can't be picked up, prop_ragdoll_original have realistic bullet push.![]()
|
Death Ragdolls/Ragdoll Transformation
When a NPC/player dies or an entity receives the BecomeRagdoll
input, it normally creates a client-side ragdoll and copies most of its animation and visual data to it. Unlike server-side prop_ragdolls, these client-side ragdolls are handled completely on a per-client basis and are much cheaper and simpler than their server-side counterparts, at the expense of being virtually nonexistent on the server, being inconsistent across client perspectives, and only colliding with entities that have physics objects on the client (e.g. worldspawn).
However, a NPC will become a server-side ragdoll while it's under any of the following conditions:
- The NPC is inside the volume of a trigger_serverragdoll
- The NPC is killed by a vehicle in singleplayer
- The gravity gun is supercharged
- The NPC dies on fire while in Alyx darkness mode
- The NPC is a vital ally (e.g., npc_alyx)
These server-side death ragdolls will collide with physics objects and beyond, like any prop_ragdoll, but they are marked as debris and do not collide with each other. They do not collide with themselves either, unlike client-side ragdolls (fixed in Entropy : Zero 2 and
Black Mesa). This is believed to be intentional behavior to reduce performance/networking costs.







Code:This can be modified at
CBaseAnimating::CopyAnimationDataFrom()
inbaseanimating.cpp
for server-side ragdolls andC_BaseAnimating::CreateRagdollCopy()
inc_baseanimating.cpp
for client-side ragdolls.
Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Override Animation (angleOverride) <string>
- List of joint rotations in the format
index,x y z,...
. Filled in by the engine via hammer_update_entity or after simulating ragdolls inHammer++ physics simulation.
GMODSandbox:
|
CBaseAnimating:
Shadow:
|
Flags
- Debris : [4]
- Don't collide with the player or other debris
- Use 'Least Recently Used' Retirement : [4096] !FGD
- LRU in this case it's referring to Source's ragdoll cleanup system, which automatically removes ragdolls which haven't been used. Serverside ragdolls spawned by NPCs are automatically added to this system, while prop_ragdolls spawned by the map are not
- Allow Dissolve : [8192] (only in
[confirm])
- Allow dissolve by prop_combine_ball
- Motion Disabled : [16384]
- Allow stretch : [32768]
- Start asleep : [65536]
Inputs
- StartRagdollBoogie
- Begins ragdoll boogie effect for 5 seconds.
Bug:This input is actually supposed to use a parameter for how long the ragdoll should boogie, but it uses the wrong field type in the data description.
Code Fix:In
CRagdollProp
's data description, findDEFINE_INPUTFUNC( FIELD_VOID, "StartRagdollBoogie", InputStartRadgollBoogie )
and replaceFIELD_VOID
withFIELD_FLOAT
.
- EnableMotion / DisableMotion
- Enable / disable physics simulation.
- FadeAndRemove (in all games since
)
- Fade out then remove (kill) self. Parameter override = duration of fade.
- AllowBloodPool (only in
) !FGD
- Сorpse once will create pool of blood (particle effect) if it is placed on brush.
Note:Not available for
prop_ragdoll_original
andprop_ragdoll_attached
.