Jump to content
Age of History 3
Chairman Baad

3 Tips for Creating Soundtracks

Recommended Posts

Soundtracks! They shape the atmosphere of a mod and can control the emotion and tone of the player's game session. With many modders opting to replace the soundtrack of the base game (courtesy of Kevin MacLeod), actually getting new songs for the game can be very tedious. However, I have cracked the code of soundtrack creation and discovered 3 techniques to automate and simplify this otherwise time-consuming process.

NOTE: This modding instruction assumes you're using Windows and have Notepad++ installed. If you don't have Notepad++, you can install it here.

1. Using yt-dlp and FFmpeg to Download Playlists

Let's begin with downloading songs! You're most likely going to grab songs from YouTube, in which case there are two special tools that can speed this up. My go-to YouTube downloader is yt-dlp because it's feature-rich, open-source, and way faster compared to services like Kapwing or those shady online downloaders. yt-dlp works from the command-line, meaning you can only use it through Command Prompt. And trust me, it's actually way easier than it sounds.

One of the most useful features yt-dlp has for creating a soundtrack is the ability to download entire playlists. It also works with a media framework called FFmpeg to convert video and audio into other formats. By using both of these tools together, we can quickly download a set of videos and then convert them to .ogg format without having to process each video one at a time. So now let's learn how to use these tools to download a playlist for use as an AoH2 soundtrack!

  1. To get started, create a new folder on your desktop and name it whatever you want.
  2. Download the latest version of yt-dlp from here. (scroll down and get the file named yt-dlp.exe)
  3. Download the full build of FFmpeg from here. 7-Zip File Manager is required to extract the builds.
  4. Once you've downloaded yt-dlp and FFmpeg, place everything in the folder you just created and rename the extracted FFmpeg folder to "ffmpeg".
  5. Open Command Prompt and run this command:
    cd Desktop\[folder name]
    Replace [folder name] with the name of the folder you created.
  6. Now, you need to find a playlist. For an AoH2 mod, I recommend search terms like "epic trailer music" or "strategy game soundtrack" since it's what most modders usually go for.
  7. Go back into Command Prompt and run this command:
    yt-dlp -U -f ba -o "%(title)s.%(ext)s" --restrict-filenames --no-abort-on-error -x --audio-format "vorbis" --ffmpeg-location ffmpeg\bin [playlist-url]
    Replace [playlist url] with the link to the playlist you've chosen. Once you run the command, all the files from the playlist you chose will be downloaded and converted into a music file you can use in AoH2.

2. Editing an Age_of_Civilizations File

This step deals with making your music files play in AoH2 itself. See, Age of History 2 uses files named "Age_of_Civilizations" (a relic of the game's previous identity) to store lists of game elements like civilizations and scenarios. If something doesn't appear in Age_of_Civilizations, it won't show up when you go to play the game. AoH2's music folder contains 3 files of interest: an Age_of_Civilizations file, Impact_Allegretto.ogg, and Scheming_Weasel.ogg. Impact_Allegretto.ogg is the music you hear whenever you start the game, while Scheming_Weasel.ogg is the music you hear while using the console. Here's how to use your downloaded music files in AoH2!

  1. Start by deleting all the files in the AoH2 music folder except for the 3 files I just mentioned.
  2. Drag all the audio files you got from YouTube into the music folder.
  3. Open the Age_of_Civilizations file in Notepad++ and delete everything in it.
  4. After that, you'll want to open Command Prompt again. This time, you'll want to run this command:
    cd C:\Program Files (x86)\Steam\steamapps\common\AoCII\music
    This is the location for vanilla AoH2. A lot of mods will rename "AoCII" to something different, so just replace "AoCII" to whatever the mod directory is named.
  5. Once you've done that, run the dir command. This will list each file in the music folder and allow you to copy all the file names at once.
  6. Hold down ALT and drag over each file name until all the file names are selected, then copy them and paste them into Notepad++.
  7. In Notepad++, delete Age_of_Civilizations, Impact_Allegretto.ogg, and Scheming_Weasel.ogg from the list.
  8. On the very last item in the list, add a semicolon at the end.
  9. Hit Ctrl+A to select the list, Ctrl+J to join all the items into one line, and Ctrl+F to bring up the Find and Replace tool.
  10. Click on Replace, put a space in the "Find what" box and a semicolon in the "Replace with", hit Replace All, and you're all set to use your new soundtrack in AoH2. Just don't forget to save!

3. The Hidden Power of .obb Files

This one is specific to Android, but it can save your players a ton of storage space, which is a big deal for people who have issues installing mods on their phones. Open MT Manager, tap on "Android", and then on "obb". You'll notice a folder named "age.of.civilizations2.jakowski.lukasz". If you have mods installed, you'll see a similarly named folder for each mod you have. If there aren't any folders, you can create one and name it age.of.civilizations2.jakowski.lukasz. If you open the folder, you may see an .obb file which contain the soundtrack for your mod. If not, that's OK! You can download my recreation of HoI4's Sabaton Soundtrack and use that. But if you see an .obb already in the folder, take note of the file name, "main.4.age.of.civilizations2.jakowski.lukasz". You can swap the .obb that gets loaded by renaming it to that string.

Now comes the part where you add your soundtrack to an .obb file.

  1. Have an .obb file ready. Again, you can use my Sabaton Soundtrack if you haven't already found the one AoH2 actually uses.
  2. Open the .obb with "ZIP Viewer", open the "music" folder inside it, and delete everything except Age_of_Civilizations.
  3. Download your AoH2 music folder from your PC to your phone.
  4. Open your downloaded music folder and select everything inside.
  5. Prepare to add everything from your own music folder to the music folder in the .obb. Set the level to "Storage" and keep "Replace all" as the update mode, and then hit OK.
  6. Once that's finished, exit the .obb and rename it to main.4.age.of.civilizations2.jakowski.lukasz if needed. Or if you're working with a mod, name the .obb file main.4.[whatever the folder for the mod is called].

And with that, you've successfully ported your soundtrack to Android without touching any ay-pea-kays! If the songs don't play, try setting the level to "AРK mode" instead of "Storage". If you want to use someone else's .obb file in AoH2, simply go to Android/obb/age.of.civilizations2.jakowski.lukasz and overwrite the .obb in there with the one you downloaded.

Edited by Chairman Baad

Share this post

Link to post
Share on other sites

Additional Info: Deconstructing the yt-dlp Command

The command for using yt-dlp may appear a bit intimidating, especially to people who aren't familiar with how youtube-dl (the program yt-dlp is based on) works. But don't fret! I'll deconstruct the command I showed you so you can get a clearer understand of what exactly yt-dlp will do.

yt-dlp -U -f ba -o "%(title)s.%(ext)s" --restrict-filenames --no-abort-on-error -x --audio-format "vorbis" --ffmpeg-location ffmpeg\bin [playlist url]

Let's see what each part of this command is for, shall we?

  • yt-dlp -U: This part runs yt-dlp and checks for updates. Everything after tells yt-dlp what it's downloading, how to download it, and what to do with the downloaded files afterward.
  • -f ba: This tells yt-dlp to download videos in the best available audio format. "ba" stands for bestaudio.
  • -o "%(title)s.%(ext)s": This tells yt-dlp to name each downloaded file as the title of the video followed by the file extension. Without this, the video IDs would also be added to the file names. It would be a hassle to remove the video IDs from every file name, so this part will take care of it for you.
  • --restrict-filenames: This tells yt-dlp to remove all non-ASCII characters, including spaces. Spaces are replaced with underscores, just like the music files AoH2 uses.
  • --no-abort-on-error: Sometimes when downloading a playlist, an error may occur which will halt the download process for the rest of the playlist. This part of the command tells yt-dlp not to halt the download process after an error has occurred. You won't have the entire playlist downloaded by the end, but at least your download won't be interrupted.
  • -x --audio-format "vorbis": This part tells yt-dlp that after each video has been downloaded, it needs to be converted to the .ogg format.
  • --ffmpeg-location ffmpeg\bin: This part shows yt-dlp where FFmpeg is located. FFmpeg is required in order to convert the downloaded videos to .ogg.
  • [playlist url]: This part is pretty self-explanatory. This is where you put the URL of the playlist you want to download. Just make sure not to include the brackets.
Edited by Chairman Baad

Share this post

Link to post
Share on other sites

This topic is now closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Age of History Games