Interactive Levers with GameSynth & UE4
Creating a non-linear sound system can be tricky due to all the moving parts. We want to design something that sounds great regardless of how it is being interacted with. The challenges that non-linearity present also scales with the complexity of the system, as more variables leave more room for things to go wrong. However, these sorts of systems can really enhance immersion and gameplay; so for now, let’s have some fun creating a simple system to get the hang of things.
Prototyping with GameSynth
For me, the Modular model is the most exciting part of GameSynth. It can be overkill if all you need is a whoosh or a whack, but it’s super handy for fleshing out ideas with a broader scope, or more moving parts. Since there aren’t any models designed specifically for levers, and since levers have interesting interactive potential (especially within VR), I thought that they would make a great entry point.
For our simple clicky lever model, the bulk of the sound design can be achieved with the Footsteps, Chirp, and Ring Modulator modules. By setting the Footsteps to bare feet on carpet, and the movement style to run, we get a very subtle thud sound which forms the bass portion of the system. Chirp gives us our short clicking sounds, but since this tends to sound a little severe, we can use the Ring Modulator to change the timbre completely. Ring Modulator alone is excellent for finessing better sounds out of Chirp.
Interactivity throughout all the models in GameSynth can be achieved with Meta Parameters. These allow us to customise control curves, much like with RTPC’s, which can then be used to drive our machines.
Since the default linear ramp is too extreme at both ends, we can customise our curve to be gentler. By using this Meta Parameter to control the frequency (rate) of the clock and the frequency/tone of our sound sources, we can exert quite a bit of interactive control. This same curve can also be used to control the overall gain, so that playback stops completely when the slider is set to 0.
Designing interactivity inside the tool is a handy way to test out some potentially complex behaviour, without having to iterate between game/audio engine and sound design tools.
With our prototype ready, we can save our patch, detach the Meta Parameters, render a few variations, and close without saving (to retain our interactive patch). Then we can work on recreating the system in the Unreal Engine.
Implementation with UE4
Besides creating a physics-based lever (for which this video was a huge help https://youtu.be/pERvMrTh7Tw), everything else is relatively straight-forward. Various control data is being gathered from the Handle component, which is then being used to affect and effect playback.
First, a Math Expression is being used to check if the Y rotation of the Handle has exceeded a definable Step Count (set to 5 in the example). If it has, the Angle Check variable is reset, and the sound is played. This is to prevent rapid-fire playback and to simulate the kind of teeth a gear connected to a lever might have.
Next, the Physics Angular Velocity Y value of the handle is acquired and scaled to fit within a range that feels right. The scaled value is then clamped to prevent anomalies. This part is done through iteration and can be further aided by a Print String action to determine what the values being output are.
The controls and effects in the final implementation aren’t quite the same as the original, but (at least as far as I found) prototyping in GameSynth can help with designing the sound and feel of interactive systems. Regardless, the result would fit well in an interactive VR game or any other game which isn’t only using binary switches.