Game Development Community

setup FMOD EX with TGEA

by Zachary Seldess · in Torque Game Engine Advanced · 03/06/2009 (1:55 pm) · 33 replies

Hi everyone,

I just upgraded from TGE to TGEA and also purchesed the FMOD Ex tool. Is there a simple tutorial on how to integrate FMOD into TGEA. From what I've read, it shouldn't be hard, but I see no specific guide on the Garage Games site.

best,
Zachary
Page «Previous 1 2
#1
03/10/2009 (6:19 am)
[bump]...

Please, some help?

Zachary
#2
03/10/2009 (9:24 am)
Check out this link for basic FMOD.

www.garagegames.com/community/forums/viewthread/79951

Hope that helps.
#3
03/15/2009 (6:45 am)
Thanks Randy,

I'm running TGEA on Mac as well as Windows. Does anyone know if I need to drop libfmodex.dylib into my game directory instead of fmodex.dll? No .dll is provided with the Mac download of FMOD Ex.

Also, I can't find any information on controlling FMOD Ex via Torque script. I'm assuming I'll need to change all my script - any hints at how FMOD is exposed in script? I can't find a thing on it.

Now that FMOD Ex is implemented and available through TGEA, I'd love to see a forum devoted to these issues.

best,
Zachary
#4
03/16/2009 (12:44 am)
I think there is no need to change a single line of script to use the FMOD library over the DirectSound/OpenAL library.

It seems to be completely transparent from the script viewpoint, else you shouldn't be able to change the sound manager during a session, using the option panel.


Nicolas Buquet
www.buquet-net.com/cv/
#5
03/16/2009 (6:28 am)
Thanks Nicolas, that's good news.

But I'm also asking about using the extended functionality of FMOD Ex: choosing rolloff curves (linear, logarithmic, custom), apply reverb, switching from stereo to 5.1 or 7.1, etc. These are all described in the FMOD Ex license on the GG website... and they're the reason I bought the license in the first place.

I'm assuming all my direct calls to OpenAL (alxPlay, alxStop) will have to be abandoned. I'm curious if there are similar direct calls to FMOD.

Anyone? I feel a bit frustrated at the lack of docs in this area.

best,
Zachary
#6
03/16/2009 (1:06 pm)
The audio calls in TGEA are too be converted from alx… to sfx…

And the sfx layer talks to openAL, directSound or FMod, as you choose.

BUt, it seems that special FMOD effects done with FMOD Designer are not supported (as Michael Perry told in another forum : see here www.garagegames.com/community/forums/viewthread/79951/1#comment-562882).

Nicolas Buquet
www.buquet-net.com/cv/
#7
03/16/2009 (1:36 pm)
Thanks again, Nicolas. I've looked at that post, and as far as I can tell, every other post mentioning FMOD.

Where did you find the info on converting all alx... calls to sfx... calls?? I don't see a single mention of it in the documenations (there's a section on OpenAL under Scripting Refernce-->Console Functions, but nothing for sfx.

Any ideas how to change from stereo to 5.1 output? Sorry to keep asking. I bought FMOD Ex for these capabilities, and I just want to know what is and isn't possible in script, before I dig into the C++ code myself or hire someone else to do so.

Also, does anyone know: when working with TGEA on Mac, should I use the fmodex.dylib that comes with the FMOD Ex download, or should I manually download the fmodex.dll file instead. No mention of this anywhere...

best,
Zachary
#8
03/17/2009 (12:57 am)
I haven't used FMOD, but I look into discussion about it because it seems very promising…

You can find information you are looking for in the porting guide (or migration guide) in the documentation delivered with TGEA 1.8 engine.

You can find other informations here : www.garagegames.com/community/forums/viewthread/74079

About 5.1 sound, as FMOD can read .ogg files, did you try multi-channels (5.1) OGG file ? (I don't know how to tell in the ogg file which track goes to which channel).

Nicolas Buquet
www.buquet-net.com/cv/
#9
03/17/2009 (6:05 am)
Thanks Nicolas, that link is quite helpful.

Regarding 5.1, I'm not referring to the source files being formatted in 5.1, I'm talking about the in-game audio being dynamically routed to 5.1 rather than stereo for a real (as opposed to virtual) surround sound experience. So I'm wondering if the functionality is already built-in and can simply be enabled, or if I need to modify the engine to make this possible.

best,
Zachary
#10
06/27/2009 (9:53 pm)
Hi guys I am also interested in getting FMOD up and running for a TGEA based project. The game is 3D and I hope to make full use of surround. Once I get more info I'll try to post it here. My experience with FMOD so far is sound design and integration using the FMOD designer tool.
#11
06/28/2009 (4:46 pm)

Just to clear up a few things here.

* alx -> sfx
TGE's audio system, which used the alx prefix for its functions, has been rewritten for TGEA, which now uses the sfx prefix.

* FMOD
TGEA's SFX system supports a range of providers (ATM: DirectSound, FMOD, OpenAL, XAudio2, Null). Each of these providers implements the same device interface which means that all of them provide the same functionality.

For using FMOD as a provider, this means that none of the extended FMOD functionality is directly available through SFX. This pertains to streaming, sound formats, and everything else.

Certain enhancements are trivial and can be added to the existing SFX system, but to really make use of FMOD's capabilities, one would have to go beyond SFX in its current form. In fact, if I were thinking about moving exclusively to FMOD and use it to its fullest extent, I'd probably throw away most of SFX and turn it into a thin wrapper around the FMOD API.
#12
06/28/2009 (11:31 pm)
Thanks Rene.

I posted this earlier and never got a response from anyone. Do you or does anyone else know about it (see below):

Instructions for adding FMOD are found here:
www.garagegames.com/community/forums/viewthread/79951

Step one states:
1. Get fmodex.dll from the fmod.org website and place it in the same directory as the game EXE.

But I'm interested in running FMOD on Mac, in addition to Windows. Does anyone know if I need to drop libfmodex.dylib into my game directory instead of fmodex.dll? No .dll is provided with the Mac download of FMOD Ex, only .dylib files.

best,
Zachary

#13
06/28/2009 (11:38 pm)

You're right on track there. There's no DLLs as such on the Mac (.dll as a file type refers to the dynamic-link PE images on Windows). .dylibs are the DLLs on the Mac, so simply drop the libfmodex.dylib in the executable's folder and the FMOD provider should initialize properly on startup and then be available as an option in the options dialog.
#14
07/03/2009 (9:03 am)
Hey guys I realize this thread is titled "setup FMOD EX with TGEA" so I feel like I'm a bit OT here but ....

It appears unlikely that the FMOD designer tool would work once FMOD EX is integrated based on this thread. Can someone confirm that for me ? Without access to FMODS feature set through the designer tool what exactly is the advantage to a sound designer requesting FMOD EX be integrated into TGEA ?
#15
07/04/2009 (6:35 pm)

Sorry for coming back to you so late.

Yes, without custom modifications to stock FMOD support in Torque, the designer tool output cannot be used. The data produced by FMOD's designer tool must be played back through a separate API that FMOD provides.

With stock TGEA, the only major advantage you gain when using FMOD is its superb mixer. Especially when having an eye on cross-platform support, this is a big advantage as the other cross-platform API in TGEA, namely OpenAL, is pretty weak.

#16
07/08/2009 (7:21 pm)
Ok this helps allot thanks. Can you provide a bit more technical detail for your comment "when using FMOD is its superb mixer" ? IS there a section in the FMOD EX documentation you can refer me to as an example ? Thanks for the help .. :)
#17
07/09/2009 (5:40 am)
Unfortunately, there's not really something in the docs that I can refer you to except maybe the introductory section that highlights the mixer's various features.

To elaborate a bit on this (sorry if I'm just rambling on about things you already know): the mixer isn't something you explicitly use. It's how the sound device layer brings together all the different sounds that are active at any one time and turns them into two (for stereo; more if mixing directly for surround systems) linear audio signal streams. This process can be done in hardware or software.

The basic tenet today seems to be that software mixing is preferable over hardware mixing probably not to the least because of the wildly varying mixing capabilities of cards. As for software mixing, FMOD and XAudio2 are probably the two most advanced offerings here with FMOD having the edge of cross-platform support and a much richer API (that's not quite fair as XAudio2 is explicitly intended as just a low-level API; XACT is supposed to do the high-level stuff).

In plain words, what this means when switching TGEA's sound layer to FMOD is simply that the resulting audio output will usually have a higher quality and be more accurate.

A very simple possible extension to TGEA if you want to use FMOD exclusively is to define a sound occluder primitive (in Torque 3D, there is a general occlusion system emerging that could probably be used for this) and place these in the level where sound should be blocked by walls and the like. These could then be read out after loading a level and fed as sound occluders to FMOD, so 3D sounds can properly react to occlusion.

Making use of FMOD's wide range of supported formats would also be fairly trivial. On creation, device sound buffers are passed SFXProfiles that link to SFXResources. So, instead of using the SFXResource to load the sound data, simply take its filename and pass it to FMOD on sound creation.

To deal with the automatic resource loading done by SFXProfile, either remove that completely or register some dummy resource creation functions for the sound formats you want to support.

In summary, if you want to settle on FMOD exclusively for sound output, it is not difficult to extend the existing system to use FMOD's more advanced features. It's just that the system as is uses a common denominator between all the various devices it supports.
#18
07/09/2009 (6:23 am)
Thinking about it some more, here's how I would go about making TGEA FMOD-exclusive:

- remove all the other sound providers except Null (DS, XAudio, OAL)
- remove all playback virtualization from SFXSystem and SFXSource (this also includes the attenuated volume computations triggered by SFXListener); FMOD does this on its own
- remove SFXResource and all resource implementations; sound loading can be put in the hands of FMOD
- modify SFXFMODBuffer to load through files with FMOD (the filename is stored on the SFXProfile) and honor the mIsStreaming flag in SFXDescription

So far, this would be about two hours work and give the full range of format support with FMOD plus streaming support.

From here on, I'd probably think about adding things like the above-mentioned geometry occlusion.
#19
07/09/2009 (8:06 am)
Renee and others,

I know this is a forum taboo, but I just wanted to link you to another related thread that I have had no luck getting a response to.

On Mac (haven't tested for Windows yet), I'm getting a doppler-like pitch shift when the avatar moves away from and towards any 3D sound in the space (whether attached to an object via %obj.playAudio(...), or with an SFXemitter). I can understand this happening at high speeds - as in the real world - but walking is certainly not fast enough to generate a pitch-shift of the magnitude I'm hearing (ca. 1/2 step).

This behavior occurs regardless of which sound provider I use (have tested OpenAL and FMod). Just to be sure it wasn't being caused by an engine mod, I downloaded a fresh version of 1.8.1 for Mac and tested it out. Same anomalous pitch shifting.

Here's a clear and short demo video showing the described behavior:
NOTE: pitch shifting only occurs when the camera is attached to the avatar. Does anyone have an idea how to fix this?

http://www.zacharyseldess.com/sampleVids/TGEA_dopplerBug.mov

best,
Zachary
#20
07/09/2009 (8:25 am)

@Zachary
Confirmed. Can reproduce this with TGEA and also with the latest Torque 3D. I'll look into this. Logged as THREED-572.
Page «Previous 1 2