T3D 1.1 FMOD functionality in T3D 1.0.1?
by Aaron R. Baker · in Torque 3D Professional · 12/04/2009 (4:29 pm) · 32 replies
I am a Columbia College Student, and we have been working on a project for the past couple months using T3D. We upgrade to 1.0.1 when it came out, but we are likely not going to upgrade to 1.1 when it comes out because it would be getting to close to the end of our project.
I saw the FMod incorporation in the 1.1 Alpha, and I was really hoping we could have that in our project, but again we don't want to upgrade. I was wondering if it would be a huge undertaking to take that functionality from 1.1 Alpha and put it into 1.0.1.
In case "FMod incorporation is not specific enough, what I mean is that I want our sound guys and designers (and maybe myself), to be able to open up the World Editor and "Add" a Fmod Designer project into our game, then to be able to manipulate it in script the same way that you can in 1.1 Alpha.
I saw the FMod incorporation in the 1.1 Alpha, and I was really hoping we could have that in our project, but again we don't want to upgrade. I was wondering if it would be a huge undertaking to take that functionality from 1.1 Alpha and put it into 1.0.1.
In case "FMod incorporation is not specific enough, what I mean is that I want our sound guys and designers (and maybe myself), to be able to open up the World Editor and "Add" a Fmod Designer project into our game, then to be able to manipulate it in script the same way that you can in 1.1 Alpha.
About the author
#2
It's not a huge thing to do but you'll probably be hitting a few snags along the way. For the SFX system itself, you can replace the entire sfx/ directory with the one from 1.1 but there's probably some dependencies outside that have also changed and need to be merged.
Then there's the script changes that need to be sync'ed as well. This is the client-side audio scripts (the audio states, descriptions, etc.) and, if you want it, the editor-side things (the "Add FMOD Designer Audio..." and the "Audio Parameters..." window).
12/04/2009 (6:06 pm)
It's not a huge thing to do but you'll probably be hitting a few snags along the way. For the SFX system itself, you can replace the entire sfx/ directory with the one from 1.1 but there's probably some dependencies outside that have also changed and need to be merged.
Then there's the script changes that need to be sync'ed as well. This is the client-side audio scripts (the audio states, descriptions, etc.) and, if you want it, the editor-side things (the "Add FMOD Designer Audio..." and the "Audio Parameters..." window).
#3
Ah forgot the whole range of changes to the listener tracking and the T3D subsystem. This will be quite a bit of tedious merging and I'd rather not recommend it.
12/04/2009 (6:18 pm)
Ah forgot the whole range of changes to the listener tracking and the T3D subsystem. This will be quite a bit of tedious merging and I'd rather not recommend it.
#4
12/04/2009 (7:47 pm)
Just out of curiosity how badly broken is your project if you simply upgrade to the 1.1 alpha? i mean i know some things are incomplete (mostly new features) and some things are broken (can probably repair relatively easily by back porting some minor features). It appears to me that upgrading even to an alpha release if that alpha contains a hugely important feature would be the best course of action, at the very least a few hours of merging would identify the problem areas and whether those were significantly destructive the overal project and its timeline
#5
@BloodKnight: Upgrading to alpha could be a potential solution, but we are also going to be using both the AFX kit and the Game Mechanics Kit (GMK released an alpha-compatible version already, I know). We are worried that AFX will not work with the 1.1 Alpha, and getting AFX to work in our game is one of our top priorities.
12/04/2009 (8:07 pm)
@Rene: Thanks for the info. I'll try to look and see if I can comprehend the process of merging that much code. For the record, other than putting the Game Mechanics Kit in, we haven't modified the source too much, so overwriting files is generally not a problem unless they're going to cause conflict with the stock 1.0.1 source (I would merge the FMod stuff into a fresh install of 1.0.1 and then put the GMK back in on top of that).@BloodKnight: Upgrading to alpha could be a potential solution, but we are also going to be using both the AFX kit and the Game Mechanics Kit (GMK released an alpha-compatible version already, I know). We are worried that AFX will not work with the 1.1 Alpha, and getting AFX to work in our game is one of our top priorities.
#6
Now trigger a build. If you're lucky, all you get is a lot of #include problems with the SFX headers, i.e. stuff is missing since the various files only include sfx/sfxProfile.h. Patch all these files up to include the relevant SFX headers.
Also, there's a number of files where uses of SFXProfile have been replaced by uses of SFXTrack to allow the new track types (SFXPlayLists and SFXFMODEvents) to be used. T3D/player.h|cpp is one such module. There are some others. Merge what you need.
Catch: nothing of this is even remotely tested. You may very well run into a host of issues and I may have even forgotten about a few things (big or small) entirely.
//Edit: corrected some paths
12/04/2009 (8:24 pm)
Out of the top of my head, here's some step-by-step info for the merge that might help:Engine
- Delete sfx/
- Copy sfx/ from 1.1
- Delete T3D/sfxEmitter.h and T3D/sfxEmitter.cpp
- Copy T3D/sfx from 1.1 and add it to the project config
- Copy util/scopeTracker.h from 1.1
- Copy sceneGraph/sceneManager.h and sceneGraph/sceneManager.cpp from 1.1
- Overwrite sceneGraph/sceneObject.h and sceneGraph/sceneManager.cpp with the files from 1.1
- Overwrite T3D/shapeBase.h and T3D/shapeBase.cpp with the files from 1.1
Now trigger a build. If you're lucky, all you get is a lot of #include problems with the SFX headers, i.e. stuff is missing since the various files only include sfx/sfxProfile.h. Patch all these files up to include the relevant SFX headers.
Also, there's a number of files where uses of SFXProfile have been replaced by uses of SFXTrack to allow the new track types (SFXPlayLists and SFXFMODEvents) to be used. T3D/player.h|cpp is one such module. There are some others. Merge what you need.
Scripts
- Copy all core/scripts/client/audio*.cs files from 1.1 and overwrite the files in 1.0.1
- Copy tools/worldEditor/gui/AddFMODProjectDlg.ed.gui and tools/worldEditor/scripts/AddFMODProjectDlg.ed.cs
- Copy tools/worldEditor/gui/ManageSFXParametersWindow.ed.gui and tools/worldEditor/scripts/ManageSFXParametersWindow.ed.cs
- Make sure the files added in step 1, 2, and 3 are executed by their respective main/init files.
- Merge the relevant changes from tools/worldEditor/scripts/menus.ed.cs
- Merge the SFX parameter window init in tools/worldEditor/scripts/EditorGui.ed.cs
Catch: nothing of this is even remotely tested. You may very well run into a host of issues and I may have even forgotten about a few things (big or small) entirely.
//Edit: corrected some paths
#7
12/04/2009 (8:30 pm)
Rene, thanks so much for thinking it through that much. I'll put some time into it throughout the next week, and I'll post whatever problems I may (probably will >.<) have. Without this post, I'd really have no idea where to start, so you've at least given me a kickoff. Thanks again!
#9
EDIT: Rather, I got this missing include in several places. So if anything from 1.0.1 can be used instead, that would be excellent.
12/10/2009 (4:19 pm)
So, I have finally gotten around to trying this (Finals week, so I've been busy). I did steps 1-8 for the engine code, as Rene said above. I cleaned and built. One error I got was from sfxDescription.h which could not include "math/mEase.h". Any idea what file(s) I can replace this with? I can experiment for a bit to find out, but I was hoping someone might know off the top of their head (or tell me if there was a lot added to "math".EDIT: Rather, I got this missing include in several places. So if anything from 1.0.1 can be used instead, that would be excellent.
#10
No, this needs to be brought over from 1.1. For starters, you can just take mEase.h/cpp and the relevant defs in mathTypes. For the editor-side things, you would need the GuiEaseViewCtrl, the inspector types, the globals in gameFunctions.cpp and the script-side ease edit code.
12/10/2009 (4:43 pm)
No, this needs to be brought over from 1.1. For starters, you can just take mEase.h/cpp and the relevant defs in mathTypes. For the editor-side things, you would need the GuiEaseViewCtrl, the inspector types, the globals in gameFunctions.cpp and the script-side ease edit code.
#11
12/10/2009 (4:44 pm)
Scratch that last question. I just copied over math/mEase.h and math/mEase.cpp from 1.1 (please tell me if that's bad for any reason). Still seeing a lot of errors with other things, but I'll post after I've tried at it for a while.
#12
EDIT: Or what is "Ease" in general rather?
12/10/2009 (4:45 pm)
What is mEase? Is it necessary for FMod other than the include that I obviously had trouble with?EDIT: Or what is "Ease" in general rather?
#13
Easing refers to ramping curves in animation. In the SFX system, it's used to let the user apply different falloff curves to volume fade-ins and fade-outs.
You could take the fields out of SFXDescription but then you'd have to remove the functionality from SFXSource as well and if you don't touch SFX, you can easily drop in the code from 1.1 Beta when it's out. It'll have some vital fixes.
12/10/2009 (4:48 pm)
Easing refers to ramping curves in animation. In the SFX system, it's used to let the user apply different falloff curves to volume fade-ins and fade-outs.
You could take the fields out of SFXDescription but then you'd have to remove the functionality from SFXSource as well and if you don't touch SFX, you can easily drop in the code from 1.1 Beta when it's out. It'll have some vital fixes.
#14
12/10/2009 (5:03 pm)
It looks like Sim.h and Sim.cpp had some changes that I need. Do you think these can just be copied over the old version? (please? >.<)
#15
Probably you can. You need the simset decls. And those in SimManager.cpp too.
12/10/2009 (5:10 pm)
Probably you can. You need the simset decls. And those in SimManager.cpp too.
#16
12/10/2009 (5:10 pm)
@Rene regarding what you said about Ease before, what are the "inspector types" you mentioned? Where could I find those?
#17
In guiInspectorTypes.h/cpp. These allow editing the various SFX fields on objects in the editor's object inspectors.
12/10/2009 (5:13 pm)
In guiInspectorTypes.h/cpp. These allow editing the various SFX fields on objects in the editor's object inspectors.
#18
12/10/2009 (6:58 pm)
I am getting an error in mMathFn.h saying numeric_limits is not a member of std. Does anyone know why that might be? do I need to add any additional references to my project for this to work?
#19
Hmm, that is standard c++ functionality. All you need for this is a (more or less) ANSI C++ compliant compiler.
Is this with VC++? If so, what version are you using?
12/10/2009 (7:04 pm)
Hmm, that is standard c++ functionality. All you need for this is a (more or less) ANSI C++ compliant compiler.
Is this with VC++? If so, what version are you using?
#20
Edit: It even comes up on intelli-sense, now that I checked...I'm trying cleaning the whole solution and building again. I think I tried that already, but sometimes I forget.
12/10/2009 (7:09 pm)
Yeah, visual studio 2008.Edit: It even comes up on intelli-sense, now that I checked...I'm trying cleaning the whole solution and building again. I think I tried that already, but sometimes I forget.
Torque 3D Owner Rapid Fire
Rapid Fire Studios
I'm not 100% sure what all the requirements are but if you read the loading screen on any level loadup, it searches for the FMod dll.
The FMod option is available within the source code. There are the options: FMod, OpenAL, dSound(directSound I assume), and xaudio.
There is also an instructional on how to import your FMod file into Torque3D somewhere on this site, but I can't seem to find it at the moment.