Jump to content
The Dark Mod Forums

Programming Or Sfx Question...a Little Of Both?


Recommended Posts

Hey guys.

 

I'm tweaking the T2X footstep values and have a bit of a problem. Everything sounds great while walking, but when I run...the sounds get played at full volume....quite jarring. :) I'm just curious if there support has been added yet to allow us to set a universal modifier that will increase/decrease the volume by a specific number, based upon the original volume of the sound? 0 is the files original volume, so we can deal with positive and negative numbers while tweaking.

 

For example, I have grass set to -15 for walking...which is a realistic level ingame...I would like to try increasing the running volume by +5, making the volume while running on grass -10.

 

If something like this already exists, just point me in the right direction. :) If not, would it be a lot of work to set it up?

 

The example was just speculation, as I haven't been able to test if increasing by +5 is enough. This would be a flat increase, a single setting that all the sounds would increase or decrease by.

Link to post
Share on other sites

Nevermind. :) I found it.

 

Hmmm, or did I. The current implementation looks like the settings need to be setup for every sound type. I'll wait until Ishtvan chimes in on this one, as he setup the sounds in the player.def

 

Am I misunderstanding what this section does?

 

// propagated sounds

"sprS_footstep" "footstep_default"

"sprS_footstep_walk" "footstep_default"

"sprS_footstep_run" "footstep_default:5.4"

"sprS_footstep_creep" "footstep_default:-7.7"

"sprS_footstep_crouch_walk" "footstep_default:-4"

"sprS_footstep_crouch_run" "footstep_default:5"

"sprS_footstep_crouch_creep" "footstep_default:-7.9"

 

// stone surface - default was calibrated for stone, so it's the same

"sprS_footstep_stone" "footstep_default"

"sprS_footstep_stone_walk" "footstep_default"

"sprS_footstep_stone_run" "footstep_default:5.4"

"sprS_footstep_stone_creep" "footstep_default:-7.7"

"sprS_footstep_stone_crouch_walk" "footstep_default:-4"

"sprS_footstep_stone_crouch_run" "footstep_default:5"

"sprS_footstep_stone_crouch_creep" "footstep_default:-7.9"

Link to post
Share on other sites

Aren't those just the values for soundprop (hence "sprS", for "soundprop system")? I would hazard a guess that soundprop volumes are separate from actual sound volumes. I could easily be wrong though.

 

I have no idea how to make running footstep sounds louder than walking ones I'm afraid.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to post
Share on other sites
Aren't those just the values for soundprop (hence "sprS", for "soundprop system")? I would hazard a guess that soundprop volumes are separate from actual sound volumes.

 

Yup, after I thought about it...that's what I thought too.

 

I have no idea how to make running footstep sounds louder than walking ones I'm afraid.

 

The ability to do so might not be available yet, but hopefully it won't be too much work to get it in there. If I had some modifiers to work with, that would be great.

 

To further clarify...I'm always paranoid that what I'm saying makes no sense...this is what I have done for each footstep sound in tdm_sfx_movement.sndshd.

 

// ================

// SFX - Movement

// ================

 

human_carpet

{

description "Made by T2X Team"

no_dups

volume -15

 

sound/sfx/movement/human_carpet_jump.wav

sound/sfx/movement/human_carpet01.wav

sound/sfx/movement/human_carpet02.wav

sound/sfx/movement/human_carpet03.wav

sound/sfx/movement/human_carpet04.wav

}

 

human_grass

{

description "Made by T2X Team"

no_dups

volume -15

 

sound/sfx/movement/human_grass_jump.wav

sound/sfx/movement/human_grass01.wav

sound/sfx/movement/human_grass02.wav

sound/sfx/movement/human_grass03.wav

sound/sfx/movement/human_grass04.wav

}

 

human_glass

{

description "Made by T2X Team"

no_dups

volume -10

 

sound/sfx/movement/human_glass_jump.wav

sound/sfx/movement/human_glass01.wav

sound/sfx/movement/human_glass02.wav

sound/sfx/movement/human_glass03.wav

sound/sfx/movement/human_glass04.wav

}

 

Each footstep sound is adjusted for what the 'player' should hear. I think what I'm looking for is a global modifier for each individual state...run, creep, crouch-creep, crouch-run. Each state will add or subtract a set volume from the one specified for that particular material.

Link to post
Share on other sites

If I understand what you're asking right, you want to take the file and decrease its volume by a constant amount, before applying any walk/run/sneak modifiers, right?

 

If that's the case, the place you want to do that is in the soundshader def for that sound. Those are the .sndshd files, and they are fairly easy to understand text files with a "vol" setting. You can see examples of existing ones in /sounds/*.sndshd. Be careful when increasing the volume tough, as you really can blow out your speakers with the wrong values. A rule of thumb is ~8 dB SWL increase => twice as loud to your ear.

 

Aren't those just the values for soundprop (hence "sprS", for "soundprop system")? I would hazard a guess that soundprop volumes are separate from actual sound volumes. I could easily be wrong though.

Correct, those are separate values and don't effect the audible volume.

 

For walking/running, those are also controlled by spawnArgs in the def file. I think walking is the standard, and sneaking and running things adjust +/- dB from that. I'm at work though, so dont' know exactly what the spawnArgs are, but I think they're in player.def.

Link to post
Share on other sites
If I understand what you're asking right, you want to take the file and decrease its volume by a constant amount, before applying any walk/run/sneak modifiers, right?

 

Yup, I've already done that in tdm_sfx_movement.sndshd

 

This is a small part of the example I posted above.

 

human_carpet

{

description "Made by T2X Team"

no_dups

volume -15

 

//sound/sfx/movement/human_carpet_jump.wav

sound/sfx/movement/human_carpet01.wav

sound/sfx/movement/human_carpet02.wav

sound/sfx/movement/human_carpet03.wav

sound/sfx/movement/human_carpet04.wav

}

 

I've tweaked the base walking volume for all footsteps. Now what I need control over is how much the run modifier increases the volume based on my settings in the sound shader. :) Right now it just seems to jump up to the full footstep volume, we don't want that.

 

I'll check the modwiki, perhaps they'll have some various settings listed there.

Link to post
Share on other sites
If I understand what you're asking right, you want to take the file and decrease its volume by a constant amount, before applying any walk/run/sneak modifiers, right?

Not quite... he's already decreasing the sounds by a constant amount. He now wants to make them louder/softer depending on walk/run/sneak modifiers, which he says isn't happening already.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to post
Share on other sites
Not quite... he's already decreasing the sounds by a constant amount. He now wants to make them louder/softer depending on walk/run/sneak modifiers, which he says isn't happening already.

 

No no, he's right. I think he just missed the part where I had already decreased the sound. :)

Link to post
Share on other sites
I've tweaked the base walking volume for all footsteps. Now what I need control over is how much the run modifier increases the volume based on my settings in the sound shader. :) Right now it just seems to jump up to the full footstep volume, we don't want that.

Hmm, that could be a bug with how I've applied the volume modifiers. Maybe I forgot to add in the soundshader volume offset, or thought it was already included at that point when in fact it wasn't. If you set the creep modifier to 0 dB does it do the same thing, play at full, raw sound file volume instead of the -15 dB in the sound shader?

Link to post
Share on other sites
Hmm, that could be a bug with how I've applied the volume modifiers. Maybe I forgot to add in the soundshader volume offset, or thought it was already included at that point when in fact it wasn't. If you set the creep modifier to 0 dB does it do the same thing, play at full, raw sound file volume instead of the -15 dB in the sound shader?

 

Where is the creep modifier located, in the player def? I'm not sure where to change the creep modifier to zero db.

Link to post
Share on other sites

Found the 'volume' modifiers in the Doomconfig file.

I see what's happening here.

 

The current setup 'replaces' the sound volume that is indicated in the sound shader, but what I need to happen...is for the modifier to add or subtract from the established volume. :)

 

For example. I have the default volume of carpet set to -15. If I want to make the sound softer by -2, I would put seta pm_stepvol_creep "-2" and this would get added to the default value and give us -17. If I want to make it louder...seta pm_stepvol_run "5", and this would modify the default to -10.

 

While the same modifiers will be used on the various step sounds, they will still all sound different since the default levels are not the same for carpet as they are for metal.

 

I'm hoping that this wouldn't be a difficult change since the system is already in place. It's really needed since the different footstep sounds vary in Thief, and modifying the levels of the original files is far more time consuming and restrictive than being able to adjust them in the files. :)

Link to post
Share on other sites
No no, he's right. I think he just missed the part where I had already decreased the sound. :)

I'm confused... nevermind, you two seem to know what you're doing, so I'll just shut up now. :D

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to post
Share on other sites
Found the 'volume' modifiers in the Doomconfig file.

I see what's happening here.

 

The current setup 'replaces' the sound volume that is indicated in the sound shader, but what I need to happen...is for the modifier to add or subtract from the established volume. :)

I intended it to add rather than replace. I must've screwed it up somehow. I don't have time to fix it tonight, but maybe in a few days.

 

Actually I lied, here is the code that's currently called...

// apply the movement type modifier to the volume
SetSoundVolume( GetMovementVolMod() );
StartSoundShader( declManager->FindSound( sound.c_str() ), SND_CHANNEL_BODY, 0, false, NULL );

 

I assumed this would apply the offset in volume to the volume of the soundshader, rather than the volume in the raw file, but apparently not. Problem is, I have no idea how to get the soundshader volume of a sound. Maybe if we can get to the Decl, we can readout the "vol" key from the dict. There's also some confusion as to whether this should be called before or after starting a new sound:

 

/*
================
idEntity::SetSoundVolume

 Must be called before starting a new sound.
================
*/
void idEntity::SetSoundVolume( float volume ) {
refSound.parms.volume = volume;
}

 

The comment above says you must call it before starting a sound, so I was following that.

 

However, looking at the Id code where they use SetSoundVolume, it gets called after starting the sound. Wtf.

/*
================
idAFEntity_Base::Collide
================
*/
bool idAFEntity_Base::Collide( const trace_t &collision, const idVec3 &velocity ) {
float v, f;

if ( af.IsActive() ) {
	v = -( velocity * collision.c.normal );
	if ( v > BOUNCE_SOUND_MIN_VELOCITY && gameLocal.time > nextSoundTime ) {
		f = v > BOUNCE_SOUND_MAX_VELOCITY ? 1.0f : idMath::Sqrt( v - BOUNCE_SOUND_MIN_VELOCITY ) * ( 1.0f / idMath::Sqrt( BOUNCE_SOUND_MAX_VELOCITY - BOUNCE_SOUND_MIN_VELOCITY ) );
		if ( StartSound( "snd_bounce", SND_CHANNEL_ANY, 0, false, NULL ) ) {
			// don't set the volume unless there is a bounce sound as it overrides the entire channel
			// which causes footsteps on ai's to not honor their shader parms
			SetSoundVolume( f );
		}
		nextSoundTime = gameLocal.time + 500;
	}
}

return false;
}

 

In idProjectile::Collide, they call it in the other order:

if ( len > BOUNCE_SOUND_MIN_VELOCITY ) {
	SetSoundVolume( len > BOUNCE_SOUND_MAX_VELOCITY ? 1.0f : idMath::Sqrt( len - BOUNCE_SOUND_MIN_VELOCITY ) * ( 1.0f / idMath::Sqrt( BOUNCE_SOUND_MAX_VELOCITY - BOUNCE_SOUND_MIN_VELOCITY ) ) );
	StartSound( "snd_bounce", SND_CHANNEL_ANY, 0, true, NULL );
}

So which is right? This is why I hate the SDK sometimes.

 

I could try reversing the order of my calls and seeing if it works... I have to sleep now though, no time to setup a proper test.

Link to post
Share on other sites

No problem Isht, I'm in no hurry. I have a new tile floor to begin installing today anyway. :)

 

Hmmm, if we can't pull the volume from the sound shader, that could be problematic as it would mean manually tweaking every footstep sound to get the walking volume just perfect ingame. BLECH. As you might imagine, this would be a major headache. The thief games handle the footstep tweaking in the files, hopefully we'll be able to do that type of fine tuning as well.

 

I appreciate you looking into it. :)

Link to post
Share on other sites
Problem is, I have no idea how to get the soundshader volume of a sound.
According to the header files, it looks like you can find out the volume of a sound shader with:

shader->GetParms()->volume

If it would save you some time, I can go ahead and change

SetSoundVolume( GetMovementVolMod() );
StartSoundShader( declManager->FindSound( sound.c_str() ), SND_CHANNEL_BODY, 0, false, NULL );

to

idSoundShader* sndshd = declManager->FindSound( sound.c_str() );
SetSoundVolume( sndshd->GetParms()->volume + GetMovementVolMod() );
StartSoundShader( sndshd, SND_CHANNEL_BODY, 0, false, NULL );

Link to post
Share on other sites
It looks like somebody else has uploaded a new version of the DLL... I won't be able to upload the changes until after I finish resynching.

 

No worries, I won't be able to work on it for at least another 5 hours anyway. Putting down new floor in the kitchen. Oy.

Link to post
Share on other sites

Oh, I didn't know declManager->FindSound( sound.c_str() ) returns idSoundShader* . I thought it just returned a char* that was non-helpful.

 

If that's the case, then yeah, Gildoran's change should work. You can test it by setting the volume ridiculously low in the soundshader, like -30, setting the volume mod cvar for that speed to 0, and see if the sound is still soft/silent, or if it pops back up again in volume (which means it didn't work).

 

If that doesn't work, you could also try calling SetVolume after the PlaySoundShader call, since Id seemed to do that sometimes.

 

@Gildoran : I appreciate you fixing this, I'm going out of town this weekend and won't have much time before then either.

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.

×
×
  • Create New...