View Issue Details

IDProjectCategoryView StatusLast Update
0002953The Dark ModCodingpublic06.05.2013 20:47
ReporterSpringheel Assigned ToSpringheel  
Status resolvedResolutionfixed 
Product VersionTDM 1.07 
Target VersionTDM 2.00 
Summary0002953: Add _Propogated_ material-specific bounce sounds to ragdolls
DescriptionRight now regular movables can have different bounce sounds for each material, so a cup falling on carpet doesn't make the same sound as when it falls on stone (snd_bounce_carpet, snd_bounce_snow, etc).

Ragdolls don't have this ability, so they are limited to a single snd_bounce.

It would be great if ragdolls could have material-specific sounds as well, particularly for AI ragdolls. The current collision sounds are great on hard surfaces, but they're overkill when the AI falls on grass or carpet.

It would also be a valuable thing to have if we want AI to hear these collision sounds (which actually works rather can even grab AI and 'catch' them if you're fast enough so they don't make noise, just like we had in the early design docs!)

From Ishtvan: What you want is probably possible, but requires editing the source. A programmer could trace out where snd_bounce is played for AI, and make the same modifications as we did for rigid body physics (can't remember if it was on idMoveable or idPhysics_Rigidbody, think it was idMoveable actually, because entities generally play sounds). Hope that helps.

Reference thread:
TagsNo tags attached.


related to 0003394 resolvedgrayman Ragdoll AI not propagating sounds properly 




30.12.2011 03:07

administrator   ~0004216

Would snd_sliding be included with this? That would be useful for sound while dragging bodies.

"editor_snd snd_sliding" "Sound when this moveable slides on a surface"

Currently, I know of only entityDef atdm:moveable_hammer_stone_large that uses it, but it doesn't appear to work on ragdolls either.


13.01.2012 21:04

reporter   ~0004243

Routine GetSoundPropNameForMaterial() needs to be moved from idMoveable to idEntity so it is available for actors, too. Then AFEntity.cpp needs to have the same code that handles "snd_bounce_MATERIAL" as idMoveable has.


17.01.2012 06:42

reporter   ~0004251

snd_bounce_MATERIAL seems to work, but propagated sounds not. Also look into snd_sliding.


04.05.2013 16:32

administrator   ~0005368

A ragdoll AI falling on the floor can generate these sounds, depending on whether the floor is hard or soft:


If you add more sounds to this list, make sure you include the following spawnarg in their definitions:

"prop_to_friend" "1"

This allows friendly AI to hear the drop and to become alerted if the player was responsible.


05.05.2013 11:58

administrator   ~0005369

Last edited: 05.05.2013 12:51

View 2 revisions

Where are these sounds actually assigned to ragdolls? I can find where the player-heard sound is set, but not the propogated sound.

tdm_ai_base has this line:

"sprS_bounce" "yell"

is that not the one actually used?



05.05.2013 16:24

administrator   ~0005370

Ragdolls don't have these sounds assigned to them.

When a ragdoll hits the floor, the code examines the floor's material and comes up with a sound to play, which is "snd_bounce_<floor material>". So we hear different sounds based on what the floor material is, as long as they're defined on the falling object.

For the propagated sound, the code uses three pieces of information:

1 - "spr_object_size" (defined on the falling object)
2 - "spr_object_hardness" (defined on the falling object)
3 - the floor material's degree of hardness

and it constructs a propagated sound called:

SprGS_bounce_<object size>_<object hardness>_on_<floor hardness>

If the first two items are undefined on the falling object, the defaults are "medium" and "hard".

In my tests, I dropped my ragdolls on stone and carpet, to see the difference, and that's where I saw the two propagated sounds mentioned in my previous note.


05.05.2013 16:33

administrator   ~0005371

For your second question ...

Most audible sounds have propagated sounds related to them.

For example, "snd_foundOpenDoor" has "sprS_foundOpenDoor". When an AI barks the first sound, the second "sound" is propagated through the world to see if there's anyone who can hear it (and who cares).

For the case of ragdolls, this isn't the mechanism that's used. Rather than depending on the code to create "sprS_bounce" from "snd_bounce" and then find it, the code uses the mechanism I described above. I don't know why it's this way.

So my guess is that "sprS_bounce" "yell" isn't used.

When moveables collide, they use the same mechanism that ragdolls use.


05.05.2013 20:58

administrator   ~0005372

Last edited: 05.05.2013 21:01

View 2 revisions

"When a ragdoll hits the floor, the code examines the floor's material and comes up with a sound to play, which is "snd_bounce_<floor material>". So we hear different sounds based on what the floor material is, as long as they're defined on the falling object."

Where should this be set? I added the appropriate spawnargs to atdm:env_ragdoll_base, but they didn't work. Only the default bounce sound was played regardless of which surface the body landed on.

It's strange, because the ragdoll seems to get its player-heard sound from the ai entity, not the ragdoll entity. For example, the atdm:ai_builder_guard has a "sound_bounce" specified, and this is the sound the builder guard ragdoll plays when collapsing. However, the sound_bounce_[material] spawnargs are apparently ignored.



06.05.2013 03:10

administrator   ~0005373

Last edited: 06.05.2013 03:12

View 2 revisions

atdm:env_ragdoll_base is the correct place to define the bounce sounds.

Specifically, which ragdoll are you dropping?

And what surface material are you dropping it on?

And what "snd_bounce_*" material(s) have you added to atdm:env_ragdoll_base, and what is the specific syntax you're using?

And I see you're using "sound_bounce" when you should be using "snd_bounce". Are you really using "sound_bounce" or is that just a typo in your note?



06.05.2013 03:16

administrator   ~0005374

I added the following to atdm:env_ragdoll_base:

"snd_bounce" "body_collapse"

    "snd_bounce_carpet" "body_collapse_soft"
    "snd_bounce_cloth" "body_collapse_soft"
    "snd_bounce_grass" "body_collapse_soft"
    "snd_bounce_snow" "body_collapse_soft"
    "snd_sliding" "tdm_heavy_stone_scratching02_loop"
        "snd_water" "water_hit_by_large_object"

However, when dropping a pagan that I had KO'd onto carpet or other surfaces, he only made the default "body_collapse" sound.


06.05.2013 03:33

administrator   ~0005375

You don't get atdm:env_ragdoll_base sounds when you KO or kill AI. You get the sounds defined in atdm:ai_base.

You only get ragdoll sounds on entities that inherit atdm:env_ragdoll_base.

Since the pagan inherits from atdm:ai_base, and that has the material-specific bounce sounds defined, you should be hearing "body_collapse_soft" when he falls on carpet.

What is the specific pagan entity? I'm not seeing (hearing?) any problems when dropping a city watch guard on soft or hard surfaces. I'm getting "body_collapse_soft" on carpet, and "body_collapse" (default) on wood or stone.


06.05.2013 20:34

administrator   ~0005376

Well, I tried the two regular bugbears, deleting the old .dll and deleting the .cm file and re-dmapping. One of the two was causing the problem, because now I'm getting the correct sounds.

Issue History

Date Modified Username Field Change
29.12.2011 14:35 Springheel New Issue
29.12.2011 21:36 Springheel Description Updated View Revisions
30.12.2011 03:07 Springheel Note Added: 0004216
01.01.2012 17:23 Springheel Assigned To => tels
01.01.2012 17:23 Springheel Status new => assigned
13.01.2012 21:04 tels Note Added: 0004243
13.01.2012 21:04 tels Severity normal => feature
13.01.2012 21:04 tels Target Version => TDM 1.08
17.01.2012 06:42 tels Note Added: 0004251
19.04.2012 13:12 Springheel Summary Add material-specific bounce sounds to ragdolls => Add _Propogated_ material-specific bounce sounds to ragdolls
19.06.2012 21:36 tels Assigned To tels =>
20.06.2012 22:33 Springheel Assigned To => Springheel
20.06.2012 22:33 Springheel Status assigned => new
20.06.2012 22:33 Springheel Assigned To Springheel =>
14.08.2012 00:51 Springheel Target Version TDM 1.08 =>
17.08.2012 19:04 Springheel Target Version => TDM 2.00
04.05.2013 01:30 Springheel Relationship added related to 0003394
04.05.2013 16:32 grayman Note Added: 0005368
05.05.2013 11:58 Springheel Note Added: 0005369
05.05.2013 12:51 Springheel Note Edited: 0005369 View Revisions
05.05.2013 16:24 grayman Note Added: 0005370
05.05.2013 16:33 grayman Note Added: 0005371
05.05.2013 20:58 Springheel Note Added: 0005372
05.05.2013 21:01 Springheel Note Edited: 0005372 View Revisions
06.05.2013 03:10 grayman Note Added: 0005373
06.05.2013 03:12 grayman Note Edited: 0005373 View Revisions
06.05.2013 03:16 Springheel Note Added: 0005374
06.05.2013 03:33 grayman Note Added: 0005375
06.05.2013 20:34 Springheel Note Added: 0005376
06.05.2013 20:47 Springheel Status new => resolved
06.05.2013 20:47 Springheel Resolution open => fixed
06.05.2013 20:47 Springheel Assigned To => Springheel