Making use of non-audio information, audio systems like reverb can be created.
Original post: June 2015
This game I’ve beenworking on has a Dynamic Airflow System, allowing voids to pull objects and actors from the non-void interiors of a SpAcE sTaTiOn! This is being used to simulate open airlock / hull breaches on said space station, adding a particularly fun force to experience.
[ugly debug image]
I did not code these magical laser cubes, so I can’t tell you how to make this part… BUT I am able to hijack it for audio reasons!
Each volume generates cells within the space / meshed out room it resides.
I decided to try taking this cell # info, and convert it to the sounds for Accurate Reverb™!
Preparing the Events in FMOD
In FMOD Studio, I created six Reverb Returns sorted by the size of the room.
I then laid out Sends to each one, enveloping as shown:
You’ll see I put on a long Release for the AHDSR. For some reason without this, the one shots would cut the reverb too soon, killing the effect! I’m not sure if that counts as an FMOD Bug or what, but keep an eye out for that.
*[[You’ll also see a LowPass Effect sitting there. This is for distance based occlusion, which I’ll make another post on soon.]]*
Luckily We can select and Copy over all these sends with included Envelope changes AND the Parameter itself to other Events!
Now that I have these in all applicable events, time to get things rolling in the Blueprints!
Getting the Cell count is easy. Lucky grab: the variable is already there!
From the AirVolume [the malleable box for placing saturated air], I have it detect all things within it’s boundaries. I scaled down the detection range a bit, so as to keep the applications within the right range (the box extends further than i’d like, so this fixes that).
From here, I go into a small Function: ‘AirVBP1’
I then Cast to theParent Actors that would have FMOD events [This part could potentially become huge, file under “Might Bite in the Butt”]:
You’ll want to use Parent Actors, because you can have some scripts that would be globally usable for all Children Actors under it; saving a lot of time, and to avoid obscene redundancy [If we can!].
When the airvolumes are overlapping, I combine their cell counts. this is for oddly shaped rooms.
Now in each of the Parent Actors that might have FMOD Events, I created one Function, and two Int Variables.
Now inside the Function, I created 4 Inputs:
1+2: FMOD Audio Component Reference, both normal and as an array
3: Cell Int.
4: Travel Int.
[Note:Cell and Travel Are also the Variables made for the parent actor ingeneral.
Here is the function:
Now with this in place, I can now take this function on any child actors I need, and it’ll work whether there’s just 1, or 16 events. I have this next bit happening under the Tick Event in the blueprints. this way, if the actor is moving room to room its sounds will take the volume’s different reverb sizes dynamically.
Sincethis is a child actor (or the parent itself), dragging off shouldlist the Apply Cells Function, and from the Int inputs, you can getthe Vars from the parent.
So with this, We are done!
This works pretty well as a general room size reverb system goes. I plan to figure out how to find the X,Y,Z ratios of the Air Cells to end up simulating a hallway effect.
Here’s a little test run around showing this in effect: