Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add music and/or sound effects for a mini-game #622

jgbourque announced in Mini-Games
Discussion options

Why this task matters

Adding your own music and sound effects brings your StoryQuest to life and creates a unique atmosphere for players. Custom audio helps establish the mood, tone, and personality of your story while making it feel distinctly yours rather than using placeholder sounds.

Steps

Git Setup

  1. Update your local repository. Open Git Bash and navigate to your project folder. Before creating a new branch, switch back to the main branch and pull the latest changes from your team's GitHub repository. This makes sure that the new branch you are about to create will have the latest updates from your team's StoryQuest.
    git switch main
    git pull
  2. Create a new Git branch
    Now, create a new branch for your work:
    git switch -c new-branch-name
    In general, choose a branch name that reflects what you're doing, like intro-outro-tilemap or add-custom-path. This keeps your work organized. Click here for a more detailed guide and more information on updating your local repository and creating a branch.

  1. Import your sound file. Make sure you have the audio file somewhere easy to locate on your computer, and then decide as a team where to place your audio in the Godot FileSystem:
    For scene-specific audio: Place it in that scene's components folder (e.g., 0_stella_intro/stella_intro_components/ for intro sounds/music only)
    For shared audio: Create a folder at your StoryQuest root level like stella_audio_assets/ so your team can easily find and use music or sounds across all scenes

In Godot's FileSystem panel, navigate to the appropriate folder and drag your audio file (.mp3, .wav, or .ogg) from your computer into it. Godot will automatically import it. If you placed it somewhere different by accident, just use the "Filer search" option in the FileSystem and then move it to the intended folder.

  1. Open the scene where you want music. Navigate to your intro scene folder (like 0_stella_intro/) and double-click the stella_intro.tscn file to open it.

Steps 5-8 For Adding Background Music to a Scene

  1. Add the background_music.tscn. to your Scene Tree In the FileSystem, search for background_music.tscn. This is an AudioStreamPlayer node that is designed to be used for background music in your StoryQuest scenes. To add this file to your scene you can simply click and drag the file into your current Scene Tree and it will be added as a new node in that scene.

  2. Assign your music file to this new BackgroundMusic node. With your BackgroundMusic node selected, look in the Inspector panel. Find the Stream property and click the dropdown arrow. Choose Quick Load and select your imported music file. Alternatively, you can drag your music file directly from the FileSystem panel onto the empty Stream field in the Inspector.

The image below shows the background_music.tscn in the FileSystem and also shows what it will look like when you drag this file into a specific Scene Tree. You can see the "stream" property in the Inspector as well:
image

  1. Adjust volume and looping.
    • Use the Volume Db slider to make the music louder or quieter
    • Check Looping if you want the music to repeat continuously

  2. Test your music. Click the Play Scene button (or press F6) to test that your music starts automatically.

Steps 9-13 For Replacing Sound Effects on Existing Game Assets

  1. Import your custom sound effects. Choose the best location for your sound files:
    Scene-specific sounds: Place in that scene's components folder (e.g., 2_stella_combat/stella_combat_components/ for combat sounds only)
    Reusable sounds: Place in your shared audio folder (e.g., stella_audio_assets/) so your team can use them across multiple scenes

    Drag your sound effect files (.wav, .ogg, or .mp3) into the appropriate folder in the FileSystem panel.

  2. Find game assets with existing sound effects. Look through your scene for interactive game objects like stealth guards, sequence puzzle objects, or other elements like the "Player". Some of these already have sound effects built into their scripts.

  3. Locate the sound property in the Inspector. With the game asset selected, look in the Inspector panel for sound-related properties. This is an example of the inspector panel with one of the stealth guards selected in the Scene Tree:
    image
    These properties will show the currently assigned sound file.

  4. Replace the sound effect. Click on the sound property field in the Inspector. Choose Quick Load and select your new sound effect file, or drag your sound file directly from the FileSystem panel onto the property field.

  5. Repeat for other game assets. Go through your scene and replace sound effects on other interactive elements as desired.


Save To Git and GitHub

  1. Stage and commit your changes. In Git Bash, here is an example of how this flow will generally look:
    git status
    git add scenes/quests/story_quests/yourStoryQuest/
    git commit -m "Add your message here - explain to your team what you changed"
    git push --set-upstream origin your-branch-name
  1. Submit a pull request. Go to GitHub, navigate to your fork, and click Compare & pull request. Write a clear title and description indicating what you changed and why, then click Create pull request.
    Click here for a more detailed guide and more information on creating a pull request to your team's forked repo.

Note: Pull requests are better with a peer review! Click here to learn more. If you are working alone, you can merge your own pull request after submitting it.

Done! Your StoryQuest now has personalized music and sound effects !

Use the Threadbare Melody Loom app to create your own soundtracks and SFX!
Resources for some royalty free game audio: Freesound, Kevin MacLeod's Incompetech

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /