Game Development Community

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.
#21
02/22/2010 (3:35 pm)
Good thread.
Thanks Rene.
#22
03/25/2010 (8:37 pm)
Thank you for the posts, nice work. The "fix" for me as far as the FMOD not working was to download the FMOD items directly from FMOD themslev's. The FMOD supplied on the site here is now too old to be used as is. As soon as I used the one off of FMOD's site, I was able to use FMOD in all of my projects.
#23
03/25/2010 (8:45 pm)

Thanks :)

That DLL problem has come up a number of times in the forum. I really should have put a disclaimer somewhere on top of this thread.

The current set of FMOD DLLs supplied here on the site won't work with T3D 1.1.
#24
03/25/2010 (9:10 pm)
Just a note, when I talked to the FMOD support about the issue, they told me that my license purchased here from Garage Games did not include updates from their site. After chatting for a few minutes, they agreed to extend my license to include the code from the site since that resolved the issue.
#25
07/09/2010 (4:49 pm)
@Sean - That was my mistake, I didn't realize that new builds were up on FMOD's website. The new builds are up (4.30.05) and are available for your usage.
#26
07/09/2010 (9:50 pm)
@Derek, thank you sir!
#27
10/15/2010 (8:14 pm)
Hey guys,

I'm having the same "You do not have the requisite FMOD Event DLL in place. Please copy fmod_event.dll into your game/ folder and restart Torque." error. Of course, the dll is there. If I bypass the error message, this is what I get in the console:

Quote:
SFXFMODProject::acquire - could not load 'art/sound/vehicles/viper/viper.fev' (FMOD_ERR_INVALID_PARAM)
4: Register object failed for object Viper of class SFXFMODProject.

And another thing that might be of interest:

Quote:
'Xenocell_DEBUG.exe': Loaded 'D:XenocellMy ProjectsXenocellgamefmodex.dll', Binary was not built with debug information.
'Xenocell_DEBUG.exe': Loaded 'C:WindowsSysWOW64msacm32.dll'
'Xenocell_DEBUG.exe': Loaded 'D:XenocellMy ProjectsXenocellgamefmod_event.dll', Binary was not built with debug information.
FMOD Loader: DLL bind failed for _FMOD_EventProject_GetInfo@12

I use version 4.32.03.

4.30.05 that is on the TorquePowered website did not work, so I gave the latest version a try.

Is there anything I can do? I'm just starting to get the hang of FMOD Designer, and would really like to use it. It's pretty awesome.

Edit: FMOD is the only provider we use, the rest were stripped out.
#28
10/16/2010 (8:20 pm)
Doh, shame on me - forgot to update the includes. Sorry for the false alarm.
#29
10/16/2010 (8:37 pm)
Konrad, give an idiot proof example for the rest of the world to follow - I've heard of more than just you with this problem.
#30
10/16/2010 (8:38 pm)
Steve, sure, hold on, I'm changing some code in the implementation to work with 4.32.03 and will post here once it works.
#31
10/16/2010 (9:19 pm)
Ok, so for 4.32.03 (and only that version) after you copied over the dlls (game directory) and the includes (Engine/lib/fmod directory) from the FMOD API directories, change the following:

sfx/fmod/fmodFunctions.h change that @12 at the end into an @8 to read:
FMOD_EVENT_FUNCTION( FMOD_EventProject_GetInfo, ( FMOD_EVENTPROJECT* eventproject, int* index, char** name ), "_FMOD_EventProject_GetInfo@8" )

sfx/fmod/sfxFMODDevice.h comment out the following code block to read:
/*
      if( dsoundHRTFNone )
         flags |= FMOD_INIT_DSOUND_HRTFNONE;
      if( dsoundHRTFLight )
         flags |= FMOD_INIT_DSOUND_HRTFLIGHT;
      if( dsoundHRTFFull )
         flags |= FMOD_INIT_DSOUND_HRTFFULL;
      */

tools/worldEditor/scripts/AddFMODProjectDlg.ed.cs comment out the following to read:
/*
   if( !( %deviceCaps & $SFX_DEVICE_CAPS_FMODDESIGNER ) )
   {
      MessageBoxOK( "Error",
         "You do not have the requisite FMOD Event DLL in place." NL
         "" NL
         "Please copy " @ %fmodevent @ " into your game/ folder and restart Torque."
      );
      return;
   }
   */

Note that this is an ugly hack at best - but I think it works. I wasn't quite able to test yet, I'm still working on hooking up a vehicle's rpm to an event's dynamic parameter value.

Please let me know if it breaks anything. :)
#32
10/16/2010 (9:27 pm)
Cool. :)

Whilst I do have Fmod Ex ... I've never actually looked at it yet (one thing at a time!) though I know someone had said that they'd been unable to get T3D to recognize the fmod_event.dll.
#33
10/16/2010 (9:29 pm)
That was just due to uninitialized script variables afaik, but I haven't looked into it.
#34
10/16/2010 (9:57 pm)
@Rene: Forgive my persistence. :) I have a question for you.

Is there a way to use an sfxFMODEvent in place of an sfxSource in an easy way? Also, I've not been able to hook the rpm value to the event I have - it goes along this way:

SFXParameter* parameter = dynamic_cast<SFXParameter*>(Sim::findObject(mEngineSound->getTrack()->getParameter(0)));
   parameter->setValue(mFabs(rpm));

The only problem I have is how do I load the event without having to change SFXSource declarations. I have a feeling there's an easier way than having to change declarations (and even then I'd be clueless). The SFX system is way too big for me to get an idea about this in a few days, so I was hoping you could shed some light on how event parameters can be set dynamically.

Many thanks in advance!
#35
10/17/2010 (10:22 am)

Kind of late to the game again :)

Need to take a look at the version thing. The DLLs from the website here are definitely too old and the code is meant to work with the DLLs directly from the FMOD website but looks like there was a change in the API.

Quote: Is there a way to use an sfxFMODEvent in place of an sfxSource in an easy way?

There's three things the SFX system needs to play a sound: a track, a description, and a source. The track is the raw data and the source is the playback of that data.

SFXFMODEvent is just one type of source data the same way that SFXProfile is. So, since sources are created from tracks, it's up to you whether you pass in a SFXFMODEvent or a SFXProfile into the play functions. You will get an SFXSource back that controls playback of whatever kind of data you passed in.

So, whenever you want to play a sound and it should be an FMOD event instead of an audio file, simply pass the SFXFMODEvent instance instead of an SFXProfile object.

The code you've shown won't work because parameters are looked up by their internal name rather than their object name. This avoids introducing yet more conflicts in the global namespace.

The idea with parameters is that you create a central object that is monitored by however many sound sources. To change the parameter, you just set its value without having to care for attached sources. To attach sources, you list the parameter in the SFXDescription, the SFXTrack, or attach it directly through the "addParameter" function.

Quote:The only problem I have is how do I load the event without having to change SFXSource declarations.

I'm not entirely sure what you mean by "SFXSource declarations." Except when creating logical source groups, SFXSources are not created directly but rather only through the API.

PS: Just to make sure, did you get the email I've sent to your paypal email address?
#36
10/17/2010 (10:32 am)

Ah, just realized that since this is in an FMOD Designer project, you are dealing with implicitly created SFXParameters. There's two ways you can go about this:

1) Create the parameter yourself. If there already is an SFXParameter with the same internal name in the SFXParameterGroup, the FMOD event will just hook up to that. The downside to this is that you have to manually configure the channel and ranges on the parameter.

2) Look up the parameter through SFXParameter::find (in C++) or by internal name on SFXParameterGroup.
#37
10/17/2010 (12:16 pm)
@Rene: Thank you very much for the explanations. I'm still getting my feet wet, but it's an awesome system. And it becomes even more robust as I'm getting a hang of what's actually in it. It's huge!

As soon as I manage, I'll post a video here with the vehicle sounds a'la Sonory - who provide a great FMOD Designer example for having event driven vehicle sounds in a game.

I think looking up the parameter on SFXParameterGroup will work beautifully. I'm gonna give that a try first.

PS: Yes, got your email, many thanks! I wasn't sure whether you were expecting a reply or not, didn't want to spam you. :)
#38
10/17/2010 (12:29 pm)

@Konrad
Cool, looking forward to that. Let me know if something in SFX is giving you trouble.

Quote:PS: Yes, got your email, many thanks! I wasn't sure whether you were expecting a reply or not, didn't want to spam you. :)

Hehe, cool. Just wanted to make sure it didn't get lost and you were left without any reaction thinking that I must be one damn ungrateful bastard :)
#39
10/17/2010 (1:23 pm)
Thanks Rene, I'll keep you updated. Still adding SFXFMODEvent objects to the wheeled vehicle class and exposing them to script atm. Perhaps sound[n] would better be stored in WheeledVehicle as an SFXTrack instead of an SFXProfile. Might give that a try later - for now, I'll create new member variables to store sfxFMODEvent objects.

Quote:
...thinking that I must be one damn ungrateful bastard

Lol, no, nothing like that. :)
#40
10/17/2010 (1:48 pm)

Quote:Perhaps sound[n] would better be stored in WheeledVehicle as an SFXTrack instead of an SFXProfile.

Yes, definitely an oversight. I went through the codebase and converted most uses of SFXProfile to SFXTrack but this one I definitely missed.

Checked in a fix.