Jump to content


Photo

Environmental Audio Extensions (EAX) in TDM


108 replies to this topic

#1 SneaksieDave

SneaksieDave

    QA Lead

  • Development Role
  • PipPipPipPipPip
  • 10125 posts

Posted 11 May 2010 - 10:16 AM

Building upon the work started here and here, I have put together a small EAX demo for The Dark Mod. In order to experience this in TDM, you'll need access to EAX 4.0 or higher (think Creative Audigy 2 or equivalent -- I got mine last week on ebay for $18 total).

* Main download: http://bloodgate.com...pub/eaxdemo.pk4
[Mirror download: Currently it is necessary to Right click and Save Link As eaxdemo.pk4 to your /darkmod folder.]
* Launch TDM and bring down the console, then make sure that the cvars s_useEAXReverb and s_useOpenAL are both set to 1. If they were not already, you must now restart TDM.
* At the console: map eaxdemo

There are a few junk items you can drop or throw around to hear sound differences, and the friendly guard footsteps and door opening/closings give a good impression of the different environmental sounds. Known issue: For some reason at this time, the player's footsteps are not affected by EAX, so you can't simply hop or walk around to hear the environment. Hopefully there is a simple fix, because your own footsteps are a large part of the immersion.

The sounds included here are based on ones from Doom 3, modified by me in an attempt to get decent approximations. Map authors: do not rely on these sounds as being the best they can be! Tweak and come up with better. I did my best with these but don't put them forward as great or anything. Also: I couldn't yet come up with a good underwater sound, so input is very welcome. If we get a good one I'll add it to the map.

Mapping: As indicated in the docs linked, all that's necessary is a mapname.efx definition file, then an info_location in each portal area separated with an info_locationseparator. See the map for examples.

Thanks to those who helped paved the way to this. Hopefully this launches a new sound experience for TDM!

Edit: Added a video to YouTube for those who aren't yet EAX4.0-ready:


#2 ungoliant

ungoliant

    Advanced Member

  • Member
  • PipPipPip
  • 1747 posts

Posted 11 May 2010 - 11:13 AM

hells yes! this is uber awesome. can you add, perhaps, an underwater area? i would like to hear what those sounds are like.

edit:

Also: I couldn't yet come up with a good underwater sound, so input is very welcome. If we get a good one I'll add it to the map.


oops

Edited by ungoliant, 11 May 2010 - 11:15 AM.


#3 SneaksieDave

SneaksieDave

    QA Lead

  • Development Role
  • PipPipPipPipPip
  • 10125 posts

Posted 11 May 2010 - 11:27 AM

Something I haven't quite figured out was why id/Doom3 seem to have not made use of the Creative EAX presets. Maybe because they wanted to support non-Creative cards as well, or perhaps for OpenAL? I'm not sure. Every one of id's environment settings (that I've seen) uses environment = 26, which is EAX_ENVIRONMENT_PSYCHOTIC, instead of using, for example, 22 which is EAX_ENVIRONMENT_UNDERWATER. The most I could figure from what I found online was that id maybe used _PSYCHOTIC as the default setting and then tweaked the parameters with some internal tool which we don't have (apparently it is not in DoomEd, though it might be in Quake4Ed).

Would be great if something could be incorporated into DR, perhaps both parameter tweaking in real time as well as writing the result out to the efx file. Would make fine tuning an area or building something complex, like underwater sounds, much easier.

#4 demagogue

demagogue

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 5360 posts

Posted 11 May 2010 - 12:00 PM

For the record, Patently Dangerous was released with EAX settings for most areas, but reading this I see why I couldn't hear the effects and was putting in values (based on D3 map values) essentially deaf to them. Now I can go back and hear if they make sense.
Posted Image

#5 SneaksieDave

SneaksieDave

    QA Lead

  • Development Role
  • PipPipPipPipPip
  • 10125 posts

Posted 11 May 2010 - 12:15 PM

@demagogue: if you had a thread where you were working out useful EAX stuff (I think you might have... fuzzy memory of such) I'd like to link that here for completeness as well.

#6 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 19863 posts

Posted 11 May 2010 - 12:24 PM

sweet Im gonna have a play with this..

#7 ungoliant

ungoliant

    Advanced Member

  • Member
  • PipPipPip
  • 1747 posts

Posted 11 May 2010 - 12:27 PM

is there anything particular that stops us from using
edit:
"environment" 22
in the efx file?

Edited by ungoliant, 11 May 2010 - 12:48 PM.


#8 SneaksieDave

SneaksieDave

    QA Lead

  • Development Role
  • PipPipPipPipPip
  • 10125 posts

Posted 11 May 2010 - 12:47 PM

That is in the efx, for each area definition. Did you mean "environment" 22 (as in EAX_ENVIRONMENT_UNDERWATER)? Tried it; it doesn't seem to do what was desired, unfortunately.

#9 ungoliant

ungoliant

    Advanced Member

  • Member
  • PipPipPip
  • 1747 posts

Posted 11 May 2010 - 01:13 PM

i tried setting the outdoor area as:
reverb "outdoors" {
"environment" 22
}
and it didn't work. in fact, the gaurds footsteps only came out of one speaker.

found this after looking around... i wonder if this might help?

http://www.atc.creat...ithms/eax20.pdf

descriptions, value ranges, etc are at the bottom.

I couldn't find similar documentation for EAX 4.0 or EFX, but i'm assuming that much of it is similar or the exact same for sake of backwards compatibility.

i'm going to play around with this more when i get home from work. this is a very interesting subject.

Edited by ungoliant, 11 May 2010 - 01:18 PM.


#10 SneaksieDave

SneaksieDave

    QA Lead

  • Development Role
  • PipPipPipPipPip
  • 10125 posts

Posted 11 May 2010 - 01:29 PM

Yep, I was getting a lot of that "out of one speaker" problem when pushing strange values in for properties. So my guess ended up being that id hardwired it to use _PSYCHOTIC as their base and then tweaked from there. Unfortunate if true, but hopefully we can make underwater despite that.

And yep ;) spent a lot of time in that PDF, especially page 29 onwards. A good reference, though I think most of the meat of it is already on the wiki page from Ishtvan.

I also found (and discarded the link, but it's out there somewhere) some code for Quake which directly laid out settings they used to define _UNDERWATER for EAX. However, when I tried the values it sounded nothing like water (not to mention half of the parameters being missing because it was for EAX 1(?) not EAX 4)... so my guess there was that they were simply id's tweaks to Creative's _UNDERWATER preset. Bah.

#11 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 11 May 2010 - 02:30 PM

Building upon the work started here and here, I have put together a small EAX demo for The Dark Mod. In order to experience this in TDM, you'll need access to EAX 4.0 or higher (think Creative Audigy 2 or equivalent -- I got mine last week on ebay for $18 total).

* Right click and Save Link As eaxdemo.pk4 to your /darkmod folder. (I have no idea why this link tends to want to read the pk4 into the browser as opposed to forcing the Save As dialog; other sites don't seem to do it. @Tels: can I get a bloodgate mirror to fix this?)


Done: http://bloodgate.com...pub/eaxdemo.pk4

You should ask dram to fix his server via storing this in an .htaccess file in the server root:

AddType application/octet-stream .pk4

Btw, very cool!
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax

#12 SneaksieDave

SneaksieDave

    QA Lead

  • Development Role
  • PipPipPipPipPip
  • 10125 posts

Posted 11 May 2010 - 02:35 PM

Thanks much. :) I'll send Dram a pm.

#13 ungoliant

ungoliant

    Advanced Member

  • Member
  • PipPipPip
  • 1747 posts

Posted 11 May 2010 - 03:10 PM

I also found (and discarded the link, but it's out there somewhere) some code for Quake which directly laid out settings they used to define _UNDERWATER for EAX. However, when I tried the values it sounded nothing like water (not to mention half of the parameters being missing because it was for EAX 1(?) not EAX 4)... so my guess there was that they were simply id's tweaks to Creative's _UNDERWATER preset. Bah.



is it also not possible that if you are forced to use the _PSYCHOTIC environmental preset as a base in TDM, that you are simply adding an offset to _PSYCHOTIC by using the values that id used to create a brand new _UNDERWATER environmental preset from scratch?

if this is so, is it also not possible that we could create a set of predefined offsets for the _PSYCHOTIC environment that would effectively reset all the values to their default, and then work from there?

#14 SneaksieDave

SneaksieDave

    QA Lead

  • Development Role
  • PipPipPipPipPip
  • 10125 posts

Posted 11 May 2010 - 03:30 PM

I certainly hope we can. Too bad, as far as I can remember, there's no underwater or anything like it sound in Doom3. Hm. Wait, maybe that area near the beginning where you see a scientist complaining/reprimanding a worker behind a thick glass window (very muffled/muted) would be a good start.

Note to all reading who don't have an EAX4.0 ready card: I've updated the first post with a link to a vid on youtube which gives a decent (not great) demo.

#15 Noisycricket

Noisycricket

    Advanced Member

  • Member
  • PipPipPip
  • 1062 posts

Posted 11 May 2010 - 05:08 PM

Brilliant!!!!




(and wtf!) :laugh:

#16 Neb

Neb

    Member

  • Member
  • PipPip
  • 226 posts

Posted 11 May 2010 - 06:36 PM

H'excellent!

I still have to get myself a proper PC though. Can't wait to give this a spin.



#17 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37123 posts

Posted 11 May 2010 - 07:09 PM

Wow, that echo-y effect is cool.

#18 ungoliant

ungoliant

    Advanced Member

  • Member
  • PipPipPip
  • 1747 posts

Posted 11 May 2010 - 09:42 PM

I think I've found what is needed inside the openAL SDK. I'm going to look into this in detail later, but here is what I found inside EFX-Util.h:

#define REVERB_PRESET_UNDERWATER \ {22, 1.8f, 1.000f, -1000, -4000, 0, 1.49f, 0.10f, 1.00f, -449, 0.007f, 0.00f,0.00f,0.00f, 1700, 0.011f, 0.00f,0.00f,0.00f, 0.250f, 0.000f, 1.180f, 0.348f, -5.0f, 5000.0f, 250.0f, 0.00f, 0x3f }
#define REVERB_PRESET_PSYCHOTIC \ {25, 1.0f, 0.500f, -1000, -151, 0, 7.56f, 0.91f, 1.00f, -626, 0.020f, 0.00f,0.00f,0.00f, 774, 0.030f, 0.00f,0.00f,0.00f, 0.250f, 0.000f, 4.000f, 1.000f, -5.0f, 5000.0f, 250.0f, 0.00f, 0x1f }

I might try to decipher what parameters each of those values correspond to later or something, or someone else can take a crack at it.

OpenAL SDK found here: http://connect.creat...%20Windows.aspx and it comes with documentation for EFX too, which is totally backwards compatible with all versions of EAX. I'm pretty sure now that Doom3 uses EFX and not true EAX, as Doom3 uses OpenAL, and EAX uses DS3D, or something like that.... i dunno i'm probably wrong.

Edited by ungoliant, 11 May 2010 - 09:45 PM.


#19 SneaksieDave

SneaksieDave

    QA Lead

  • Development Role
  • PipPipPipPipPip
  • 10125 posts

Posted 11 May 2010 - 11:34 PM

That might in fact be it, or at least a good start for tweaking. I tried out the underwater values above in the demo map, replacing one of the room definitions with this one from the above:

reverb "underwater" {
"environment" 22
"environment size" 1.8000
"environment diffusion" 1.0000
"room" -1000
"room hf" -4000
"room lf" 0
"decay time" 1.4900
"decay hf ratio" 0.10
"decay lf ratio" 1.00
"reflections" -449
"reflections delay" 0.007
"reflections pan" 0.0000 0.0000 0.0000
"reverb" 1700
"reverb delay" 0.0110
"reverb pan" 0.0000 0.0000 0.0000
"echo time" 0.250
"echo depth" 0.000
"modulation time" 1.180
"modulation depth" 0.348
"air absorption hf" -5.0000
"hf reference" 5000.0000
"lf reference" 250.0000
"room rolloff factor" 0.0000
"flags" 63
}

As is, it doesn't immediately make you feel like you're underwater, but the sounds are modulated and muted in a way that makes me think, when coupled with TDM's underwater sound (which already works), this might do the trick nicely. As with the rest of the areas in the map, the surface of the water will have to include a visportal and info_locationseparator.

Tomorrow though, for me at least; I'm off to bed. -_-

#20 ungoliant

ungoliant

    Advanced Member

  • Member
  • PipPipPip
  • 1747 posts

Posted 12 May 2010 - 11:51 AM

As with the rest of the areas in the map, the surface of the water will have to include a visportal and info_locationseparator.


I'm not entirely sure how locations work when the player passes through one into another, but I have a feeling that if you portal the water surface, that once you stick a toe in the water, the environment effects will change regardless of if your head is submerged underwater or not.

#21 SneaksieDave

SneaksieDave

    QA Lead

  • Development Role
  • PipPipPipPipPip
  • 10125 posts

Posted 12 May 2010 - 12:05 PM

It is hopefully the same as for detecting breathing (underwater or air) and vision (blurry or clear): in the head.

#22 aidakeeley

aidakeeley

    Advanced Member

  • Banned
  • PipPipPip
  • 913 posts

Posted 12 May 2010 - 01:52 PM

That's some cool stuff.

It's weird that this (or some facsimile of it) isn't a standard thing by now. Isn't it?
"A Rhapsody Of Feigned And Ill-Invented Nonsense" - Thomas Aikenhead, On Theology, ca. 1696

#23 Serpentine

Serpentine

    Uber member

  • Active Developer
  • PipPipPipPip
  • 2903 posts

Posted 12 May 2010 - 02:28 PM

That's some cool stuff.

It's weird that this (or some facsimile of it) isn't a standard thing by now. Isn't it?


Proprietary stuff like EAX generally kills people's desire to use it.

#24 SneaksieDave

SneaksieDave

    QA Lead

  • Development Role
  • PipPipPipPipPip
  • 10125 posts

Posted 17 May 2010 - 08:34 PM

Who else has had this working in-game so far? I'm experiencing a problem where now after I close each of the heavy effect rooms (tunnel, cavernous), the effect stays even after I leave that zone. This wasn't happening before, so I'm trying to narrow down what the problem might be (I didn't change any drivers, settings, etc). I've had problems before with too many USB connections competing for my sound device, but I've disconnected them all and rebooted and it's still happening.

#25 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 18 May 2010 - 02:54 AM

Who else has had this working in-game so far? I'm experiencing a problem where now after I close each of the heavy effect rooms (tunnel, cavernous), the effect stays even after I leave that zone. This wasn't happening before, so I'm trying to narrow down what the problem might be (I didn't change any drivers, settings, etc). I've had problems before with too many USB connections competing for my sound device, but I've disconnected them all and rebooted and it's still happening.


Currently switching back from release 1.02 to trunk to test it out.
"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

"Remember: If the game lets you do it, it's not cheating." -- Xarax



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users