Torque 3D 1.1 Alpha SFX Workflows
by Rene Damm · in Torque 3D Professional · 12/01/2009 (12:26 am) · 75 replies
In this thread, I will progressively add some quick instructions on how to use several of the new SFX features in 1.1 Alpha.
For suggestions/requests/criticism/thoughts/whatever, feel free to comment.
For suggestions/requests/criticism/thoughts/whatever, feel free to comment.
About the author
#42
I converted the samples to mono, reexported the project and changed the declaration to this:
For some reason this still sounds local and not a 3D sound. I did everything just as I would for a normal networked sound.
I'm at my wits' end and I just can't explain what could be wrong. When I Alt-C out of the vehicle, the sound will follow me. It shouldn't be doing that - not with that datablock. It gets its transform and velocity updated in updateEngineSound regularly.
Should I be defining my fmod events in another way?
10/17/2010 (9:52 pm)
@Rene, I'll need to bug you with yet another question. I've been trying hard to make this event be a networked sound instead of the stereo local sound in the video.I converted the samples to mono, reexported the project and changed the declaration to this:
datablock SFXFMODProject("fmodviper") {
filename = "art/sound/vehicles/viper/viper.fev";
description = "AudioClosest3D";
preload = true;
};For some reason this still sounds local and not a 3D sound. I did everything just as I would for a normal networked sound.
I'm at my wits' end and I just can't explain what could be wrong. When I Alt-C out of the vehicle, the sound will follow me. It shouldn't be doing that - not with that datablock. It gets its transform and velocity updated in updateEngineSound regularly.
Should I be defining my fmod events in another way?
#43
FMOD events in SFX largely follow the settings that have been applied in Designer and only make very limited use of SFXDescription. Whether a given FMOD event plays in 3D, for example, is determined by the "Mode" setting in Designer and not by whether the "is3D" property of the SFXDescription is true.
If you have defined your sound as a 3D sound on the vehicle and it follows you when you switch control to the freefly camera, then that's a bug.
They must have "Mode" == 3D in order for position and velocity settings to take effect.
BTW, "networked sound" has no relation to 3D sound. Networking only comes into play with the datablocks which can be either networked ("datablock") or client-side ("singleton" or "new").
PS: Cool video there. I like the sound.
10/17/2010 (10:24 pm)
FMOD events in SFX largely follow the settings that have been applied in Designer and only make very limited use of SFXDescription. Whether a given FMOD event plays in 3D, for example, is determined by the "Mode" setting in Designer and not by whether the "is3D" property of the SFXDescription is true.
Quote:When I Alt-C out of the vehicle, the sound will follow me.
If you have defined your sound as a 3D sound on the vehicle and it follows you when you switch control to the freefly camera, then that's a bug.
Quote:Should I be defining my fmod events in another way?
They must have "Mode" == 3D in order for position and velocity settings to take effect.
Quote: networked sound instead of the stereo local sound in the video.
BTW, "networked sound" has no relation to 3D sound. Networking only comes into play with the datablocks which can be either networked ("datablock") or client-side ("singleton" or "new").
PS: Cool video there. I like the sound.
#44
Yeah, I should have said server side 3D sounds perhaps. That is what I meant. :)
I'll go and find the Mode setting in Director and give this another try and see whether sound is still following me. I'll let you know how it goes so I can either confirm or deny if this is a bug or not.
I'll check whether there's an easy way to set Mode without having to re-export the project, because linking that to is3D would be pretty nice.
10/17/2010 (11:59 pm)
Thank you, Rene, this will help immensely.Yeah, I should have said server side 3D sounds perhaps. That is what I meant. :)
I'll go and find the Mode setting in Director and give this another try and see whether sound is still following me. I'll let you know how it goes so I can either confirm or deny if this is a bug or not.
I'll check whether there's an easy way to set Mode without having to re-export the project, because linking that to is3D would be pretty nice.
#45
Actually, I see it's already done the other way around.
10/18/2010 (12:03 am)
Quote:
I'll check whether there's an easy way to set Mode without having to re-export the project, because linking that to is3D would be pretty nice.
Actually, I see it's already done the other way around.
#46
Screenr downmixed the audio to mono, so the 3D position won't be recognizable, but that works.
Here is the screenr cast.
Let me know if I should open a bug report about this. I know how busy you are, so don't waste more of your time on this, its more FYI.
10/18/2010 (12:43 am)
Setting Mode to 3D solved the positioning problem and the sound source now behaves as it should in 3d. Unfortunately the sound itself became totally borked. I made a screenr cast - the quality is not the greatest, but the sound in the recording is what I hear, so it's good enough to show what the problem is.Screenr downmixed the audio to mono, so the 3D position won't be recognizable, but that works.
Here is the screenr cast.
Let me know if I should open a bug report about this. I know how busy you are, so don't waste more of your time on this, its more FYI.
#47
10/18/2010 (1:07 am)
And as it usually happens, I screwed up. I passed an ordinary SFXDescription and not the one that was in the fev.cs file. Fixing that solved the problem. Sorry Rene. :)
#48
@Konrad
Hehe, no problem. Nothing better than to get up and find there was a problem that by now has been solved already :)
10/18/2010 (8:44 am)
@Konrad
Hehe, no problem. Nothing better than to get up and find there was a problem that by now has been solved already :)
#49
@Konrad
Hehe, no problem. Nothing better than to get up and find there was a problem that by now has been solved already :)
10/18/2010 (8:44 am)
@Konrad
Hehe, no problem. Nothing better than to get up and find there was a problem that by now has been solved already :)
#50
Thank you Rene for the excellent resource.
I went through the first part, but having T3d (beta 3) crash everytime I press "ok" on :
File -> Add FMOD Designer Audio...".
Previous to that I was having the "fmod_event.dll" not being recognized. Updated the headers, implemented the changes from Konrad. The error message about the Fmod.dll is now disabled but the T3d is crashing systematically with no error message.
I am using the FMOD Designer trial version 4.32.05
Anyone experiencing the same issue ?
11/17/2010 (11:33 am)
Greetings,Thank you Rene for the excellent resource.
I went through the first part, but having T3d (beta 3) crash everytime I press "ok" on :
File -> Add FMOD Designer Audio...".
Previous to that I was having the "fmod_event.dll" not being recognized. Updated the headers, implemented the changes from Konrad. The error message about the Fmod.dll is now disabled but the T3d is crashing systematically with no error message.
I am using the FMOD Designer trial version 4.32.05
Anyone experiencing the same issue ?
#51
Anyone managed to use FMOD 4.32.05 or any other version with 1.1 beta3 ?
11/18/2010 (1:47 am)
Just tried fmodapi 4.28.22 on T3d 1.1 beta2 and it worked.Anyone managed to use FMOD 4.32.05 or any other version with 1.1 beta3 ?
#52
Sorry for the late reply.
I think you've come across the same problems Konrad came across a short while ago. For his workaround, see the second page of this thread. I'll definitely need to check what's going on there. Looks like maybe an incompatible API change in the FMOD events DLL.
11/18/2010 (2:16 pm)
Sorry for the late reply.
I think you've come across the same problems Konrad came across a short while ago. For his workaround, see the second page of this thread. I'll definitely need to check what's going on there. Looks like maybe an incompatible API change in the FMOD events DLL.
#53
Yes I did implement Konrad's changes on my T3d 1.1 beta3. It does actually disable the error message but T3d still crashes when I press "ok" on :
File -> Add FMOD Designer Audio...".
I might try with an earlier version of FMOD rather than the latest.
11/18/2010 (2:33 pm)
Thank you Rene for the reply.Yes I did implement Konrad's changes on my T3d 1.1 beta3. It does actually disable the error message but T3d still crashes when I press "ok" on :
File -> Add FMOD Designer Audio...".
I might try with an earlier version of FMOD rather than the latest.
#55
Ok, should have looked at Konrad's workaround more closely since that already shows the problem, but yeah. They changed the FMOD_EventProject_GetInfo function in an incompatible way which is why with the DLL function lookup patched to get the correct function, it'll crash.
I'll have an updated version of the relevant code shortly.
11/18/2010 (2:55 pm)
Ok, should have looked at Konrad's workaround more closely since that already shows the problem, but yeah. They changed the FMOD_EventProject_GetInfo function in an incompatible way which is why with the DLL function lookup patched to get the correct function, it'll crash.
I'll have an updated version of the relevant code shortly.
#57
1. Update the FMOD headers in Engine/lib/fmod/inc to the latest FMOD Ex and event API headers.
2. In Engine/source/sfx/fmod/fmodFunctions.h change the line for FMOD_EventProject_GetInfo to:
...continued...
11/18/2010 (3:30 pm)
1. Update the FMOD headers in Engine/lib/fmod/inc to the latest FMOD Ex and event API headers.
2. In Engine/source/sfx/fmod/fmodFunctions.h change the line for FMOD_EventProject_GetInfo to:
FMOD_EVENT_FUNCTION( FMOD_EventProject_GetInfo, ( FMOD_EVENTPROJECT* eventproject, FMOD_EVENT_PROJECTINFO* info ), "_FMOD_EventProject_GetInfo@8" )
...continued...
#58
Delete the following two code sections in SFXFMODDevice::_init
11/18/2010 (3:32 pm)
Delete the following two code sections in SFXFMODDevice::_init
bool dsoundHRTFNone = false;
bool dsoundHRTFLight = false;
bool dsoundHRTFFull = false;
if( smPrefDSoundHRTF && smPrefDSoundHRTF[ 0 ] )
{
if( dStricmp( smPrefDSoundHRTF, "none" ) == 0 )
dsoundHRTFNone = true;
else if( dStricmp( smPrefDSoundHRTF, "light" ) == 0 )
dsoundHRTFLight = true;
else
dsoundHRTFFull = true;
}if( dsoundHRTFNone )
flags |= FMOD_INIT_DSOUND_HRTFNONE;
if( dsoundHRTFLight )
flags |= FMOD_INIT_DSOUND_HRTFLIGHT;
if( dsoundHRTFFull )
flags |= FMOD_INIT_DSOUND_HRTFFULL;
#59
Change the code that comes immediately after "// Get the project info." in SFXFMODProject::_load to read:
BTW, as you see, it's not really doing much with the project info it gathers other than spewing it to the console, so you could just hack this out completely. Still, the proper change is this.
11/18/2010 (3:35 pm)
Change the code that comes immediately after "// Get the project info." in SFXFMODProject::_load to read:
// Get the project info.
FMOD_EVENT_PROJECTINFO info;
int numEvents;
int numGroups;
SFXFMODDevice::smFunc->FMOD_EventProject_GetInfo( mHandle, &info );
SFXFMODDevice::smFunc->FMOD_EventProject_GetNumEvents( mHandle, &numEvents );
SFXFMODDevice::smFunc->FMOD_EventProject_GetNumGroups( mHandle, &numGroups );
Con::printf( "SFXFMODProject - %s: Loading '%s' from '%s' (index: %i, events: %i, groups: %i)",
getName(), info.name, mFileName.c_str(), info.index, numEvents, numGroups );BTW, as you see, it's not really doing much with the project info it gathers other than spewing it to the console, so you could just hack this out completely. Still, the proper change is this.
#60
In the SFXDescription::SFXDescription() constructor, change
to
11/18/2010 (3:38 pm)
In the SFXDescription::SFXDescription() constructor, change
dMemset( mParameters, 0, sizeof( mParameters ) );
to
for( U32 i = 0; i < MaxNumParameters; ++ i )
mParameters[ i ] = StringTable->EmptyString();
Associate Konrad Kiss
Bitgap Games