Skip to content

Game Sound Documentation

ShirinNI edited this page Oct 19, 2021 · 68 revisions

# Team 5

Introduction

This is the Game Sound Document that outlines key design considerations, how the feature has been done thus far, and provides example usages in order to help others integrate with this feature.

Key Design Considerations

Team 5 started this feature with key design considerations in mind in order to create cohesive game sounds.

  • The sounds must 'make sense' (e.g. "clicking" sound for a selection)
  • The sounds must relate to the theme of the game (e.g. using Windows sounds)
  • The selected sounds must not be too overbearing and must be completely necessary for the game

Timeline

The team firstly agreed upon a backtrack sound that allowed the team to understand the overall theme/mood. Then the team split into smaller groups to work on different aspects of the sound (e.g. one team on creating different sound effects that were agreed upon by the whole team and another team on coding and implementation). With these base sounds, the team was able to build upon new aspects of the game when they were developed (e.g. new monster on higher level so created new sound built upon previous monster sound).

Behind The Scenes

What program did we use and why?

Initially we used Traction's Waveform but have now considered it to be too difficult for beginner Sound Creators/Modifiers. For More Information

So the chosen Software was Audacity, FL Studio, and Muse score.

MuseScore is a free widely-used score creation software. It requires the most basic of Music Theory to utilize the software to its optimum point. We used it to create several scores which were used in our Back Tracks. For More Information

Audacity is a Free, open-source, cross-platform audio software. It is also very easy to learn and be able to create/modify the sound. Thus Audacity was used for all of our Sound Effects (e.g. Player Death, Button Clicks, and etc). A limitation was its inability to play MIDI files.For More Information

FL Studio is a highly technical audio software, with several features. This software was used in conjunction with the scores created in Muse score to develop the backtracks now implemented in our game. Its largest limitation is the price, however, due to one team member having the software we relied on their support. For More Information

Usage

1) Load the music: First, make sure the music is loaded before play. In major classes, the essential music tracks are already loaded in loadAsset() method. However, in the case they are not loaded you may load them first as below.

  private static final String[] musicToLoad = {"sounds/music.mp3"};
  resourceService.loadMusic(musicToLoad);

2) Play the music using the MusicService & Directory: So allow for our Sound to be further refined in the future and to decrease the difficulty of other teams implementing sound as they proceed to refine their codes. We created a directory where the other teams can ask for the task-specific music and this music would automatically update across the whole instead of attempting to find each individual instant of the music service being called.

  public void playTheMusic() {
        MusicServiceDirectory dict = new  MusicServiceDirectory();
        MusicService musicScreen = new MusicService(dict.[INSERTMUSICNAMEFROMDIRECTORY]);
        musicScreen.playSong(true, 0.2f);
    }

List of sounds

You may find a list of all the sounds we made in core/assets/sounds in the game or see additional links.

# Sprint 1

The sound-related jobs we did for Sprint 1 are summarised below:

Creating Background Track

The Backtrack draws inspiration from Whale. Shark. by a Shell in the Pit (Song on Spotify). The alternating tones were quite appealing as they created the Cyber Techno feel we wanted to establish in the audience. We then proceeded to explore this sound further in different software resulting in many tracks but after discussion through user testing, we proceeded to select one signature sound that we hope to accommodate across the whole game. As we experiment and user test this signature may change.

Creating Sound Effects

Using Audacity we created these sound effects. We took our inspiration from the variety of sounds found within C:/Windows/Media folder. We took these sounds manipulating them, dissecting and changing their structures to create widely common game sounds using these iconic Windows Noises. The Modifications were done on a case by case basis in order to achieve the task assigned to these sounds.

Our Collection of Sounds and Backtracks are found here: #Resources

Adding music to the game

Example: Adding Background Music

Below we demonstrate how our Music Service can be added to the code.

  public void loadTheMusic() {
        MusicServiceDirectory dict = new  MusicServiceDirectory();
        MusicService musicScreen = new MusicService(dict.main_menu);
        musicScreen.playMusic();
    }

Adding Sound Effects

The relationship between the void and the player in terms of sound

Wanting to create an inverse relationship between the distance of the player and the loudness of the static void (Static here refers to the Noise and not the motion). We created this simple code which using pre-established code by the Void Team edited the loudness of the sound being output by our music service.

        float distance_from_player = getPlayerDistance();
        if (distance_from_player < (float)(-8)){
            musicService.stopMusic(); 
        } else if (distance_from_player > (float)0.01) {
            float change1 = abs(1 - distance_from_player);
            if (change1 > (float)1) {
               musicService.changeVolume((float)0.2);
            } else {
                 musicService.changeVolume((float)0.4);
            }
        }
        else if (distance_from_player < (float)0.99) {
            float change2 = abs(1 - distance_from_player);
            if (change2 > (float)1) {
                 musicService.changeVolume((float)0.9);
            } else {
                 musicService.changeVolume((float)0.6);
            }

Adding the mute button

The Mute button was created so a viewer was able to pause the music while on the MainMenuScreen. Instead of pausing the music, the Mute button ends the music and then restarts it which saves memory. When pressed the button changes to an unmute button. This restarts the music. The button switches text when a switcher variable (which increases by 1 even time it is pressed) changes parity.

  private void onMute() {
    logger.info("Muting MainMenuMusic");
    MusicService musicService = new MusicService("sounds/MainMenuMusic.mp3");
    if (musicService.isMusicPlaying()) {
      musicService.stopMusic();
    } else {
      musicService.playMusic();
    }
  }

# Sprint 2

The sound-related jobs we did for Sprint 2 are summarised below:

1- Fixing mute button

Through observations we found out the mute button is not working properly; that is the music is stopped correctly when the mute button is activated however when the user changes the screen (for example from the main menu screen to the setting screen) the music starts playing again. To fix the problem we've created two Singleton classes; one to be able to keep track of the mute button state (mode) throughout the game (MuteManager) and the other to be able to play just one instance of the music in the main menu screen (MusicSingleton).

Mute button:

  private void onMute() {
    MuteManager mute = MuteManager.getInstance();
    MusicSingleton music = MusicSingleton.getInstance();
    if (mute.getMute() == true) {
      mute.setMute(false);
      music.playMusicSingleton("sounds/MainMenuMusic.mp3");
    } else {
      mute.setMute(true);
      music.pauseMusicSingleton("sounds/MainMenuMusic.mp3");
    }

  }

2- Fixing mute button image

There are two images for the "mute button" on the main menu screen; Mute and Unmute. It works as below:

By default -> Mute image is shown

When the mute button is activated -> Unmute image is shown

When the mute button is deactivated -> Mute image is shown

We found out the mute button image is always the default image regardless of the state of the mute button. Fixing this problem was done by using the new singleton class MuteManager and with the collaboration of team one who originally made the button image.

        muteBtn.addListener(
                new ChangeListener() {
                    @Override
                    public void changed(ChangeEvent changeEvent, Actor actor) {
                        MuteManager mute = MuteManager.getInstance();
                        if (mute.getMute()) {
                            muteBtn.getStyle().imageUp = new TextureRegionDrawable(muteTexture);
                            muteBtn.getStyle().imageOver = new TextureRegionDrawable(muteHoverTexture);
                        } else {
                            muteBtn.getStyle().imageUp = new TextureRegionDrawable(currentlyMutedTexture);
                            muteBtn.getStyle().imageOver = new TextureRegionDrawable(currentlyMutedHoverTexture);
                        }

                        entity.getEvents().trigger("mute");
                    }
       });

3- Test MuteManager class

A few tests have been written to make sure the MuteManager class works as expected:

    @Test
    void setMuteTest(){
        mute.setMute(true);
        assertTrue(mute.getMute());
        mute.setMute(false);
        assertFalse(mute.getMute());
    }

4- Creation of Level 3 Background Music

The Ideation Process

Step 1: Creation of Melody Since the background image of level 3 has a dark background with light rips going across. I believe to match the dark theme, I would create a backing track which would also have a dark theme. Hence, the key of G Minor was selected. A basic melody was created over time, which can be seen below. The dark piano instrument was used which comes within the FL Studio package. Level 3 Basic Melody

After the basic melody was created, the sound itself still feels 'empty' because only the root notes are in place. Thus chords were created by layering the 1st,5th and 8th (octave) notes on top or below the root notes within the G Minor Chord. This allowed for a 'fuller sound' to be created. The layered can be seen below: Level 3 Layered Sound

Step 2: Rhythm Creation Although we have created a melody we require a drum line/kit to create a rhythm for the user. A simple 808 bass pattern and Hi-Hat pattern was created. The 808 bass and hit-hat pattern have changes in pitch so the sound doesn't feel so robotic and automated. Having changes in pitch for the drum line creates a more natural sound. 808 Bass Pattern: 808 Bass Pattern Hi-Hat Pattern: Hi-Hat Pattern

Step 3: Sound Alterations Now that we have a melody and drum kit in place for the backing track, alterations to the sound were made as the sound did not feel 'dark' and 'spooky' enough (although we already used a G Minor scale). Thus a variety of plugins were used to significantly change the sound. The first plug-in to be used was Gross Beat. Gross beat allows the user to change the volume control of every note of the song and speed of the song. The settings used for Gross Beat for this track involved, making the sound wobble/unstable in a certain part of the song and for the volume of the notes to constantly fade in and out. The settings used can be seen below: Gross Beat 1 Gross Beat 2

The next plug-in to be used was Pitcher. Pitcher allowed me to change the pitch of notes to be out-of-tune initially and tuned while the note is being played. Thus, creating a spookier sound. Settings for this plug-in can be found below: Pitcher

Finally, a combination of fruity chorus and compressor was used to create a chorus-like effect, to the sound; which adds more reverb to the sound and in return makes the sound more full. A compressor was used slightly to cut off the unnecessary echo in some sections. Settings for both can be found below: Fruity Chorus Compressor

5- More user testing on the sounds

Please see #User testing documentation

6 - System Sequence Diagram for sound [added for Sprint 2]

7 - UML Diagram for sound and background component [added for Sprint 2]

The above UML diagram attempts to analyse (aside from Void Controller) all the components that Team 5 has worked on

# Sprint 4

The sound-related jobs we did for Sprint 4 are summarised below:

1- Optimized the MusicService class

We combined the two most frequently used methods of this class into one so it's now easier for the coders to use this service. Now the music can be played easily by getting two arguments; one is a boolean value (to choose the music is played in the loop or not) and the other is a float number that defines the volume of the music.

Previously in MusicService class:

  public void playMusic() {
        MuteManager mute = MuteManager.getInstance();
        /* If the mute button is off, play the music otherwise do nothing. */
        if (mute.getMute() == false) {
            music.setLooping(true);
            music.setVolume(0.2f);
            music.play();
        }
    }

    public void changeVolume(float vol) {
        MuteManager mute = MuteManager.getInstance();
        /* If the mute button is off */
        if (mute.getMute() == false) {
            music.setVolume(vol);
            music.play();
        }
    }

Now, these two methods combined to one:

    public void playSong(boolean loop, float volume) {
        MuteManager mute = MuteManager.getInstance();
        /* If the mute button is off, play the music otherwise do nothing. */
        if (!mute.getMute()) {
            music.setLooping(loop);
            music.setVolume(volume);
            music.play();
        }
    }

The previous music methods in the code have been updated to the above method.

2- Make the game juicier by adding more sounds added to the game

With the new features added to the game (such as player jumps, falls, eat power-up element...), we decided to add some of the sounds we already made to the game to make the game more enjoyable to play. Some of the newly-added sounds are:

1- Jump sound

2- Falling sound

3- Victory sound

3- Level 4 Music Creation

An example of music creation. For the Level 4 background, the mood was to create a reminiscent but fast effect to it as its the last level so it needs to be fast but also should remind the player of the game they enjoyed. So I initially started with a slow pace following some elements of John Powell's "How to Train your Dragon" with the notes D C F C. However this beat was used once and we followed the beat established previously. This resulted in the score seen below. Score Iteration 1

However after user testing it was found that the piece while being melodic, it doesn't represent the fast paced nature of the final level so I utilized half notes and combined the two rhythms to create a random combination of the two to unnerve the player but also calm them a little. A mix of emotions bringing the most out of their final game experience. Thus we created the score below. Final Level Final Score Iteration

After the final score was created, the notes were converted into MIDI form and transcribed onto FL Studio. After the notes were converted into FL Studio, several plugins were used to alter the nature of the sound itself, to suite the game. For the level 4 background music the following plug-ins were used: GrossBeat, Pitcher, Soundgoodizer, Maximus, Fruity Compressor and Fruity Reeverb. The combination of these plug-ins assists in creating an eerie and suspenseful sound which follows the sound theme of the game which is present on other levels.

Gross beat was used to alter the timing of the notes played in the melody. This alters the timing of the notes played to follow the settings below:

Level 4 Gross Beat

Pitcher was used to alter the speed of the instrument to find the correct pitch of the note. However, with the settings applied, we were able to create an environment where the correct note is never played and thus making the melody sound more eerie. The settings used can be seen below

Level 4 Pitcher

Soundgoodizer was used to further alter the overall sound of the melody. The settings applied can be seen below:

Level 4 Soundgoodizer

Fruity Reeverb was used to add more echo and reverb to the sound. Specific settings were applied to replicate the sound being played in cathedral and thus making the sound somewhat echo. The settings used can be seen below:

Level 4 Fruity Reverb

Fruity Compressor was used to make the melody sound more "tight and compact". This allowed the melody to sound less airy and more 'strict'. The following settings were applied:

Level 4 Fruity Compressor

Additional Links

Google Drive Containing our Sound Effects and Backtracks Google Drive Containing Backtrack for Sprint 2

Table of Contents

Home


Game Design

Game Design Document

Void/Antivirus

Loading Screen

Game Sound

Menu Assets

Player Design

     Original Design

     Final Design


Gameplay

Movement

Jumping & Sliding

Jump Pads

Portals & Bridges

Buttons

Pick-Ups

Physics

    Momentum & Physics

    Gravity

    Collision


Level Design

Level 1

     Background

     Textures

     Map Design

Level 2

     Background

     Textures

     Map Design

Level 3

     Background

     Textures

     Map Design

Level 4

     Background

     Textures

     Map Design


Sprint Round-Up

Sprint 1 Summary

Sprint 2 Summary

Sprint 3 Summary

Sprint 4 Summary


User Testing

Testing Plans

Sprint 1

     Team 1
     Team 2
     Team 3
     Team 4
     Team 5

Sprint 2

     Team 1
     Team 2
     Team 3
     Team 4
     Team 5

Sprint 3

     Team 1
     Team 2
     Team 3
     Team 4
     Team 5

Sprint 4

     Team 1
     Team 2
     Team 3
     Team 4
     Team 5

User Testing

Sprint 1

     Sprint 1 - Game Audio
     Sprint 1 - Character Design
     Sprint 1 - Menu Assets
     Sprint 1 - Map Design
     Sprint 1 - Void

Sprint 2

     Sprint 2 - Game Audio
     Sprint 2 - Character Design
     Sprint 2 - Menu Assets
     Sprint 2 - Interactable Design Animation
     Sprint 2 - Levels 1 & 4, and Level Editor
     Sprint 2 - Proposed Level 2 & 3 Designs
     Sprint 2 - Current Game State

Sprint 3

     Sprint 3 - Menu Assets
     Sprint 3 - Map Design
     Sprint 3 - Score Display
     Sprint 3 - Player Death and Spawn Animations
     Sprint 3 - Pick Ups and Pause Screen

Sprint 4

     Sprint 4 - Gameplay
     Sprint 4 - Game UI and Animation
     Sprint 4 - Level Background and Music
     Sprint 4 - Game User Testing
     Sprint 4 - Final Game State Testing


Game Engine

Entities and Components

     Status Components
     Event System
     Player Animations Implementation

Level Editor

Level Saving and Loading

Status Effect


Defunct

Development Resources

    Getting Started

Entities and Components

    Level Editor (Saving and Loading
         Multiple Levels)

    Service Locator

    Loading Resources

    Logging

    Unit Testing

    Debug Terminal

Input Handling

    UI

    Level Saving/Loading

    Status Effects

    Animations

    Audio

    AI

    Physics

Game Screens and Areas

    Terrain

    Concurrency & Threading

    Settings


Troubleshooting

MacOS Setup Guide

Clone this wiki locally