top of page
Writer's pictureDan

Polygon Planet: Post 13 - Sounds good

Updated: May 1, 2023

Up until now the game has been devoid of any sound.


I decided it would be a good moment to add my first audio to the game because having made the wind system that moves the grass and various trees I really wanted to be able to hear the wind.


Wind noise

So I have used the same "wind map" texture and algorithm used in my shaders for animating the trees and grass to alter the pitch and volume of an audio clip of wind noise.


Water noise

Having done that I added audio for water which increases in volume as the player gets nearer to it. I didn't want to have a multitude of audiosources for each and every body of water so instead I've opted for a single audiosource and a script that adjusts the volume based on the player's elevation. This works in my case because water in my scene is a single flat plane that intersects the landscape - therefore all water is at the same elevation everywhere.


Underwater noise

To achieve the feeling of being under water I have applied a low-pass filter to the water audio source whenever the player elevation is such that their head is less than the water plane. Again this approach only works because, by design, all regions of my landscape that are lower lying than the water plane ... are underwater! This is one benefit of my simplification of using a single plane to represent all water everywhere.


Visor, Jawdash and mic movement and noise

Encouraged by how engaging and fun it was to add audio to the game I went on to add some simply controls to raise and lower the visor, jaw-dash and mic boom.


Realtime audio recording

In addition to the up down movement of the mic boom I've added a control for recording audio from the User's mic. Currently it is using Unity's built in method to record microphone audio clips. I am recording a max of 10seconds.


This is the first baby steps towards the goal of capturing the realtime dialog from the User/Player and converting it from speech to text to drive the game interactions with non-player characters.


So it's exciting to have begun on this stage of the journey at last! :)



The video below shows the results.




2 views0 comments

Recent Posts

See All

Comments


bottom of page