Jump to content


Photo

Say Hello To Fmod Designer


  • Please log in to reply
11 replies to this topic

#1 LfO

LfO

    Sergeant

  • Xenocide Sound Department
  • 81 posts

Posted 10 August 2006 - 07:21 PM

What's FMOD?

I must confess that I'm not totally clear on how sound was implemented prior to the rewrite - it looks like FMOD was used, but FMOD Designer didn't exist yet. In short, its kind of like a hyper-focused IDE that allows sound designers to put together a tree of SFX events. The events can contain variations, multiple layers, and take parameters. For example, I anticipate being able to make a single "event" for the Silabrate in FMOD Designer. Then, at the beginning of a mission, the developer just has to create one instance of that FMOD event for each Silabrate on the battlefield. From there, FMOD takes care of 3d placement of the Silabrate, and the programer can use FMOD's API to tell the event when the Silabrate attacks, dies, etc.

New Implementation
I've created an FMOD project in the Assets SVN, and put all the currently available Stackless Iteration 3 SFX in there.

Here's where we hit a problem - to use FMOD Designer, you have to use its build process, and its proprietary output files. At present, it only supports PCM (uncompressed audio), ADPCM (a compressed format that I've never heard of before), and MP3. I built the project with each of these formats, and these were the sizes of the ouput:
PCM - 90 Meg
ADPCM - 25 Meg
MP3 (quality=50) - 10 Meg

In its orignal .ogg format, it was about 12 Meg total. As of May 2006, the developers of FMOD stated that there are no current plans to implement .ogg support in FMOD Designer's build:
http://www.fmod.org/...opic.php?t=5264

I have no idea how they get away with including an MP3 encoder in a free download - do you only have to pay licensing on decoders? Anyway, I think we've already established that MP3 is not an option.

Like I said, I've never heard of ADPCM before, and the Wikipedia entry doesn't indicate whether it is lossy or lossless. In any case, it appers to be about twice as large as a high-quality .ogg.

So, are we willing to commit to using ADPCM instead of .ogg, in order to gain the flexibility offered by FMOD Designer? If we are, we should probably discuss the option getting rid of audio compression in the Assets SVN - I've heard that using multiple compression algorithms can yield some pretty awful results.

This seems like something we really need to discuss as a group.

As I mentioned in the Lounge, I'll be out of town for a week and a half starting Sunday (August 13), but don't wait on me to talk about this.



Note to Developers

I didn't upload an FMOD build to Assets - its very easy to do it yourself, though. You'll have to:
-Install FMOD Designer
-Open the project
-In the Events Tab->Project Properties Table (table in the upper right), change the Build Directory to wherever you like - its currently set for my machine.
-Select the Wave Banks Tab
-Currently, there's just one bank. You can change the Compression Type in the table (as I discussed above, the options are PCM, ADPCM, and MP3).
-The Build menu in the toolbar only has one item - select it, and the rest should be pretty obvious.

Edited by LfO, 10 August 2006 - 07:22 PM.

Oscillators make my world...um...oscillate...

#2 reist

reist

    Programming Department

  • Xenocide Programming Department
  • 130 posts

Posted 11 August 2006 - 08:07 AM

Well, I don't think they'll add support for ogg in their ouput files anytime soon, if at all:
http://www.fmod.org/...p?p=24857#24857

Oh, is it possible to build the project and upload it? Anywhere?
I want to experiment with it, but "easy" doesn't describe it on linux.
"impossible" would be closer <_<

#3 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 11 August 2006 - 10:19 AM

[...]Oh, is it possible to build the project and upload it? Anywhere?
I want to experiment with it, but "easy" doesn't describe it on linux.
"impossible" would be closer <_<

Sure. Feel free to download the RARed Build from here. :)

Edited by Mad, 11 August 2006 - 10:24 AM.

Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#4 LfO

LfO

    Sergeant

  • Xenocide Sound Department
  • 81 posts

Posted 11 August 2006 - 10:39 AM

Between your posts, I started an upload to the Build directory in the Assets SVN. I used ADPCM - what format is yours, Mad?
Oscillators make my world...um...oscillate...

#5 reist

reist

    Programming Department

  • Xenocide Programming Department
  • 130 posts

Posted 11 August 2006 - 11:05 AM

Thanks, Mad.
I've got a small test program and the music event plays nicely =b

Thank you too, LfO. Mad's files are about 25MB, so it's probably ADPCM too.

Edit: Just adding that the automatic mixing in of different sounds and the ability to randomize the file an event plays are really cool.

Edited by reist, 11 August 2006 - 11:14 AM.


#6 Mad

Mad

    Creative Text Department

  • [Xenocide Senior Members]
  • 1,958 posts

Posted 11 August 2006 - 11:21 AM

[...]
Mad's files are about 25MB, so it's probably ADPCM too.
[...]

Correct. I don't like MP3 too much, and Wav was a liiitle big too huge for my taste... :P
Keep smiling while dying

Of course I have gone mad with power! It would be completely ridiculous to go mad without power!
And no, this is not a quote from the Simpson's movie, I want it on paper, that I actually wrote that quite some time before the movie came out.

Posted Image

#7 reist

reist

    Programming Department

  • Xenocide Programming Department
  • 130 posts

Posted 12 August 2006 - 02:25 PM

Hope I'm not hijacking the thread ^^;
A couple of points about the fmod project:
  • Put all music events under their own category, like..."music" :P
    That'll make it soooo much easier to control global music/sfx volume.
  • I don't think it was intentional, but the Intercept event is looping.
If these two points are taken care of and no one objects, I'll connect audio to the game based on this file's structure (with an option to activate only if it finds an audio directory)

#8 LfO

LfO

    Sergeant

  • Xenocide Sound Department
  • 81 posts

Posted 12 August 2006 - 03:23 PM

Fixed the looping problem.

Split the Xenocide_00 wave bank, or whatever it was called, to seperate SFX and Music wave banks (which translates to seperate .fsb files). I also adjusted the event group heirarchy so that Music is just below the root level. I'm not sure which of these changes you wanted, but hopefully one of them fixed it.

Also, I should describe what I did with the Interceptor chatter. There are actually two sets - one female and one male. Which set is played is determined by the the "param00" parameter of the event. I assume you've just been using the default, which is probably 0. I've defined user-properties on each chatter event (Min and Max, set to 0 and 1). The idea is that when you spawn an interceptor, you pick and random number between min and max - then, whenever you call an Interceptor Chatter event, send that value to param00 (which I suppose I should rename to something like "ID" or "voice"). This way, the interceptor will always use the same "voice", but each interceptor will have a different voice.

Well, at the moment, one of two voices, but I believe this set-up will allow you to program it once, while SND can keep expanding the number of available voices (we'll keep Min and Max updated). This can serve as a prototype of how we implement battlefield chatter.

Let me know how things go.


oh, it looks like I left the original wavebank/.fsb out there in my SVN checkin - just ignore it for now, and we can clean it up after we see how this works.

Edited by LfO, 12 August 2006 - 03:27 PM.

Oscillators make my world...um...oscillate...

#9 reist

reist

    Programming Department

  • Xenocide Programming Department
  • 130 posts

Posted 12 August 2006 - 04:12 PM

Thanks, LfO. Looking at it now.
The parameters are cool, and reminded me that I didn't yet make per-actor events ^_^;;
A better name is nice, unless that's the only parameter there, because I can just get it by index.
Also, some of the params have a Max of 2, and with 1 I hear both the female and the male voices at once...each randomized by itself. A pilot and co-pilot answering :D
Not a problem, it's a range and it's possible to just use Min and Max as long as there are only two voices.
Are there any other parameters/values I should watch for?

About the music - there's supposed to be a category view in the designer. It's not even shown in the tutorial, but it's something that can be done only in the designer, and it's mentioned in the tutorial's terminology in the end.

I'm not really sure music should be at top level.
It's supposed to be split between different scapes (Battleview, Planetview, etc) and later, if possible, somehow between "moods" (ambiant, intercepting, ?) by parameter value or name...
At least, those are the hopes in PRG :)

Edited by reist, 12 August 2006 - 04:13 PM.


#10 LfO

LfO

    Sergeant

  • Xenocide Sound Department
  • 81 posts

Posted 12 August 2006 - 06:49 PM

I'm not really sure music should be at top level.
It's supposed to be split between different scapes (Battleview, Planetview, etc) and later, if possible, somehow between "moods" (ambiant, intercepting, ?) by parameter value or name...
At least, those are the hopes in PRG :)



We can do music as one event with different parameter values, or as seperate events - seperate events for different gamestates seems best to me, but its really fairly easy either way.

When it comes down to it, does it really matter where it is in the event tree, as long as its in a seperate .fsb? I'm unclear what granularity of control you have in what to load into memory.

Is this the king of heirarchy you have in mind?

|
|-Music
| |
| |-Planetview
| |-Battleview
| |-Main Menu
|
|-SFX
|
|-GUI
|-Planetview
| |
| |-Interceptor
|-Battleview

Where there are seperate .fsb files for Planetview Music, Battleview Music, Main Menu Music, etc. and GUI SFX, Planetview SFX, Battleview, etc.

As far as I can tell, there's no association between where something is in the heirarchy and which .fsb file its in.

Also, there are three options for the .fsb files - load into memory, uncompressor into memory, and stream from hard disk. Can you override these as needed, and is there something in particular they should be set to?

I just came up with the Min and Max concept myself, and put in a rough implementation - currently, those are the only 2 user-defined values. Apparently, I put in some wierd values...I'll take a look at them, but I may not get a chance until after vacation (9 days from now). Same for changing the parameter name - does "ID" sound reasonable to you? If anyone else wants to make these changes in the meanwhile, feel free.

Some more details about my intended implementation - Designer recognizes parameters as continuous variables with a fairly high resolution (7 decimal places, I think). What I THINK I've done is defined, using the Launch event as an example, is something like:
if (param00 >= 0) && (param00 < 1)
play random female launch sample
if (param00 >= 1) && (param00 < 2)
play random male launch sample

I had to manually set the range for which each sample would be played (male vs. female), so I probably made some data entry errors. I thought I set all the Min and Max values the same using a template, but doc is sparse for the Designer, and i guess I did something wrong.
Oscillators make my world...um...oscillate...

#11 Lars W

Lars W

    Sergeant

  • Xenocide Programming Department
  • 21 posts

Posted 12 August 2006 - 08:53 PM

The Category View is an alternative to the hierarchie view and allows a second kind of grouping

Here is a little Screenshot of the two different views:
Posted Image Posted Image


You can move around the events in the categories without affecting the hierarchy.


greets
Lars

#12 reist

reist

    Programming Department

  • Xenocide Programming Department
  • 130 posts

Posted 13 August 2006 - 02:33 AM

We can do music as one event with different parameter values, or as seperate events - seperate events for different gamestates seems best to me, but its really fairly easy either way.

That's good to know. We'll probably have to get to these events first to see how best to calls them.

That hirarchy looks good.
Granularity...well, all the music can even be in one fsb, as long as the fsb is marked 'stream from disk'.
Seems that with the designer, you have all the control.
I don't know which kind of sound cards can handle compressed audio, but if it's possible than unless you specifically use effects that you want fmod to do by itself, you'd want to mark the events as HARDWARE to leave them compressed.

There is one thing about groups - I can load all the events in a group and sub-groups at once, so they won't suddenly stall in the middle of the game. When I do that, whole banks are loaded, even if they have events from other groups. I'd say it's best to separate groups into different fsb, unless you know they'll be used together or used always (probably some basic gui sounds and such)

I just came up with the Min and Max concept myself, and put in a rough implementation - currently, those are the only 2 user-defined values. Apparently, I put in some wierd values...I'll take a look at them, but I may not get a chance until after vacation (9 days from now). Same for changing the parameter name - does "ID" sound reasonable to you? If anyone else wants to make these changes in the meanwhile, feel free.

Some more details about my intended implementation - Designer recognizes parameters as continuous variables with a fairly high resolution (7 decimal places, I think). What I THINK I've done is defined, using the Launch event as an example, is something like:
if (param00 >= 0) && (param00 < 1)
play random female launch sample
if (param00 >= 1) && (param00 < 2)
play random male launch sample

I had to manually set the range for which each sample would be played (male vs. female), so I probably made some data entry errors. I thought I set all the Min and Max values the same using a template, but doc is sparse for the Designer, and i guess I did something wrong.

Yep, looks like that's what you did. We could just use integer values+0.5 to get around it easily. That way no matter how many voices you add, if this pattern will continue there'll be no problem.

And have a fun vacation! Don't ruin it with work ^_^

Edited by reist, 13 August 2006 - 02:33 AM.