Audio Controller for Sound Effects
I picked up two sound effect libraries recently and decided to try to implement those in-game. I have minimal experience with sound effects. In the past, I've used a single controller for the couple of sound effects needed in a prototype or jam game. This wouldn't scale for this game even in its current state. I added a class to utils for playing random clips and extended this base component where I needed it.
For actions most actions this was pretty easy. The most challenging part was footsteps. I used animation events on the various walking and running animations to implement footsteps. This wasn't difficult to get working, however, when blending between walking and running (or forward/backward movement and strafing) the audio clips would play for each active animation. This meant I could have up to four animations emitting animation events.
To solve this I added some new getter functions that could identify whether the player was walking or running and whether the player was strafing. When an animation event fires I check whether the movement that caused the animation event is the strongest type of movement (is the player running more than they're walking? Or, is the player strafing more than they're moving forward/backward?).
The next thing I need to sort out with sound effects (and audio in general) is a generalized way to apply audio settings. For example, if the player puts SFX volume at 50%, I need to ensure that audio sources used for SFX honor that volume setting. This is something I will return to later, at the moment I'm happy with the audio implementation and I would like to get back to building out the debug level and features needed for the tutorial level.
Files
Vaults & Vampires
A platform adventure game with mechanics and themes inspired by tabletop role-playing games.
Status | Prototype |
Author | rcxa |
Genre | Adventure, Platformer, Role Playing |
Tags | 3D, 3D Platformer, Prototype, Singleplayer, Unity |
More posts
- Refactored Shadows for PerformanceAug 18, 2024
- Refactoring and Starting CombatFeb 03, 2024
- Double JumpingJan 29, 2024
- Spikes and Mobile InterfaceJan 21, 2024
- Player Health and DeathJan 15, 2024
- Waypoint SystemJan 14, 2024
- Jumping and Landing FeedbackJan 08, 2024
- Codebase Restructuring and Walk AnimationsJan 06, 2024
- Player Animation ControllerJan 04, 2024
Leave a comment
Log in with itch.io to leave a comment.