Unity – Brad's Sonic Musings https://bradleymeyer.com/wp-core audio blog of the Rev. Dr. Bradley D Meyer Sun, 11 Sep 2022 22:06:15 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://bradleymeyer.com/wp-core/wp-content/uploads/2022/09/cropped-icon_01_512-32x32.png Unity – Brad's Sonic Musings https://bradleymeyer.com/wp-core 32 32 36691641 Adventures in the Field, Volume 2: Snowboarding https://bradleymeyer.com/wp-core/2012/11/14/adventures-in-the-field-volume-2-snowboarding/ https://bradleymeyer.com/wp-core/2012/11/14/adventures-in-the-field-volume-2-snowboarding/#respond Wed, 14 Nov 2012 05:10:36 +0000 http://www.bradleymeyer.com/wp-core/?p=118 While we were working on the skateboarding game back at Free Range Games, we were hoping it would take off and they’d ask us to do a snowboarding game (it didn’t, but as a stopgap we ended up making SummitX … Continue reading ]]>

While we were working on the skateboarding game back at Free Range Games, we were hoping it would take off and they’d ask us to do a snowboarding game (it didn’t, but as a stopgap we ended up making SummitX Snowboarding on our own).  Since the project would have likely happened in the summertime, I opted to make a huge sacrifice for the team and spend a lot of time up in Lake Tahoe recording snowboarding sounds during the winter.  I needed to get a gamut of various terrain types from the corduroy and packed powder of ski run groomers to spring corn to the neck deep powder of the backcountry and even loathesome sheets of ice and rocks.

Fortunately, I’m a much more competent snowboarder than I am a skateboarder, so I would be able to capture the sounds myself.  The challenge here was how to get quality sounds of the board carving through various snow types with minimal (and ideally no) wind. I decided to try two methods simultaneously and see what worked.  First off, I bought some little windscreens for my Core sound binaural mic.  I attached this to an Edirol R-09 stuffed into my pocket.  Over the course of several sessions, I experimented with several mic placements: taping them to the back of the board on either side (facing backwards to minimize wind), strapping them to the top of my boots, and taping them to the middle of the board on the left and right. I coupled this with a Zoom H2 with a windscreen stretched over the mics held in my hand as low to the ground as I could get it. Again, not the best quality recorders, but with a high impact sport like snowboarding I was only willing to risk my equipment so much!

Between the two, over a course of many days, I was able to get some decent sounds across multiple types of terrains.  (The schedule was a scant 2 months, so we ended up forgoing terrain types.  I experimented with changing the terrain based on altitude from powder to packed powder to ice, but it didn’t work very well without a visual or physical change to the terrain). I found the best results actually came from the mics on the inner (wind-protected) side of the binding and holding a recorder low behind me with the mic facing up the mountain (and thus away from the wind direction).

The bulk of what ended up in SummitX Snowboarding was from a bluebird day doing backcountry with my friends Sati and Melody Shah on Rose Knob Peak, near Mt. Rose in North Lake Tahoe.  It was perfect powdery spring conditions with very little wind.  We did see some bear tracks, but fortunately, no bears! To get the sound of your board riding over rock, rather than sacrifice my board, I ran the edges over a stone mortar and pestle and the results worked pretty well. The turns, carves, and powerslides were taken from some of my other recordings, and I made soundsets for more of the planned terrains, which have yet to see the light of day. For the snowboarder movement including clothing, boot squeaks and binding creaks, I recorded those in the comfort and relative quiet of my apartment, using Mackie Onyx pres and a Neumann TLM 193.

Here’s a composite from the game:

You can also buy it on Android or iOS

]]>
https://bradleymeyer.com/wp-core/2012/11/14/adventures-in-the-field-volume-2-snowboarding/feed/ 0 118
Psuedo-Occlusion in Unity https://bradleymeyer.com/wp-core/2012/09/30/psuedo-occlusion-in-unity/ Sun, 30 Sep 2012 00:26:51 +0000 http://www.bradleymeyer.com/wp-core/?p=193 Unity is an awesome engine for quickly iterating and building game content. The audio features have definitely improved over the years, but it’s still rather limited in many ways.  Randomization of pitch, volume, lpf, or even sounds can only be … Continue reading ]]>

Unity is an awesome engine for quickly iterating and building game content. The audio features have definitely improved over the years, but it’s still rather limited in many ways.  Randomization of pitch, volume, lpf, or even sounds can only be done with a little bit of scripting savvy.  Someday, either Unity will fix this or I’ll publish my scripts for these common practices on the asset store Smilie: :-).   One of the features we added at Free Game Games which I’m most proud of was a psuedo-occlusion scheme utilizing trigger boxes and an enum (and enumerated static variable) to attenuate and apply a low pass filter on certain sounds. This feature was used prominently throughout Free Range Games’ canceled skateboarding game, as well as Freefall Tournament, which is playable on Kongregate.com.  It was one of the more advanced features we added to Unity on the audio side.  I relied heavily on the scripting wizardry of Jeff Wood, a fantastic designer whom I worked with both at Free Range Games and Shaba Games before that, to handle most of the technical scripting. Our solution was not necessarily the best method to occlude sounds, but it was functional, so I’d like to outline the system so that people can ideally glean some information from it and possibly improve upon it themselves.

The core script components of our system were an AudioOcclusionTrigger and an AudioOcclusionObject.  All objects the we wanted to occlude would have an AudioOcclusionObject script attached to it.  To trigger the occlusion we created trigger boxes and attached an AudioOcclusionTrigger to that trigger box.  Since we may want an object to be occluded in multiple boxes, we created an enum containing a list of occlusion “categories.”  This list was rather arbitrary and dependent on the level design.  I believe we had things like “Hallway,” “ExtAmbience”,  and “IntAmbience” So for example in our skateboarding game, we had a warehouse level in which two cavernous rooms were connected by a small hallway. Each room had an ambient emitter which played a looping ambient drone and  occasional one shots and a PA loudspeaker which was pumping out our licensed music soundtrack. The hallway had a trigger box around it with an AudioOcclusionTrigger script labeled as “hallway.” The ambience and music emitters in each large room where tagged with the hallway enum with their respective AudioOcclusionObject scripts, and whenever the player entered that trigger, all the sounds which contained an AudioOcclusionObject script with the category set to “hallway” would  attenuate and get filtered over time.  And when the player exited that box, the reverse wold happen (the objects volume and lpf would be restored to where they were prior to occlusion).

Here is a short video demonstrating the effect on the music and ambience:

We did a lot of safety checks to make sure the sounds aren’t already occluded before attempting attenuation, creating filters if they don’t exist, etc. but it’s still a far from perfect solution.  It really only works well with fairly simple geometry and the more occlusion categories you add, the crazier it can get to keep track of your objects and make sure everything is set up properly.

But there you go.  If you’d like to download the scripts and check it out yourself, they’re available here.

]]>
193