Jump to content
Age of History Games
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

Guest
This topic is now closed to further replies.

  • Similar Content

    • By Chairman Baad
      A lot of modders choose to upload their mods to Google Drive. Typically they post two links: one for the PC version of their mod, and one for the Android version. And on some occasions, a modder will share links to past versions as well. But having to constantly replace the download links whenever a new update rolls out can be a hassle. In fact, there's a more automated way to go about updating your mods that nobody appeared to be using until now.
      So how can you make the process of updating easier? It's so simple that even a no-good, incompetent spam-bot could do it. Simply place your mod downloads in a new folder and share the folder in the same way you would a file. You can see an example of this with The Lost Update.
      Now whenever you want to upload a new version of your mod, you can just upload it in the new folder and it will automatically appear for everyone to download. You can also keep past versions in there as well, but make sure to mark them as old so people won't get confused trying to find the latest version. Another option is to create another folder inside of the current folder and place your old versions in there.
    • By Chairman Baad
      This is a recreation of the Sabaton Soundtrack DLCs for Hearts of Iron IV. The loading and console music are the normal songs from Kevin MacLeod. Everything else is Sabaton songs.
      PC (.zip) - Android (.obb)
      The original DLCs from HoI4 are here and here.
    • By Chairman Baad
      AoH2 typically names a province after its city. But you can actually change the province name to whatever you want. And even without a city in the province, you can still give it a name other than "Fokus". This is done through a map's province_names folder. In the base game, this is how the sea provinces get their names.
      How to add a unique province name:
      Find the ID of the province you want to name by going into "Edit Connections And Provinces". In your AoH2 directory, go to map/<map name>/province_names. If you don't have a province_names folder, copy the one from the AoH1 map into your map. Open the names file in a text editor, preferably Notepad++. Add your province name on the line with a value one higher than the province ID. (ex. province ID 1821 = line 1822) Save your changes and reload the map. And now whenever you hover over the province in-game, you'll see the name you gave it regardless of how many cities are in it!
    • By Chairman Baad
      If you've seen or created an event before, you'd understand the various issues behind the event text. Why can I only see part of the text in the event creator? Why did the description I just wrote get deleted when I added a trigger? Why are all the events in a different language? For many mods, these issues are common in scenarios with events. Luckily, there's a better way to display event text: event localization! Inspired by the system in Hearts of Iron IV, and originally demonstrated in The Chairman Baad Collection (rest in lack of content and peace) before being used in Norrvägen and The Second Great War, event localization alleviates all of the issues present with the standard way of event writing.
      So how do you use event localization?
      Event localization is a process that's simple for even a first-time modder.
      Go into your AoH2 directory, go to game/languages/, and open Bundle.properties. (the English language file for AoH2) Write your event's title, description (if you plan to add one), and outcomes under a tag for each piece of text. Be careful not to use the same tag for more than one event.
      Here's an example with the Turkish defensive pact event from TCBC. In this example, _t corresponds to _title, _d is for _description, and _o1 and _o2 are for _outcome1 and _outcome2 respectively. Replace each tag and description with your own, and make sure to save your changes! tur_azeripactexp_t = Defensive Pact with Azerbaijan Expiring tur_azeripactexp_d = Our agreement for mutual security with Azerbaijan is set to expire on the 16th of August. However, we have the option to renew the agreement and extend it until 2030. The only catch: both parties must agree to a renewal. What should we do? tur_azeripactexp_o1 = Appeal for a renewal. tur_azeripactexp_o2 = Let it expire.        3. In the AoH2 event creator, instead of writing your event text like you normally would, write the tags corresponding to the ones you added in
                 Bundle.properties.
      And that's it! You've just set up an event using event localization! During gameplay, if your event pops up and you see the event tags instead of your text, go into the settings and reselect your game language. This reloads the Bundle files so that your text will appear the next time you see the event.
      Now how does this solve the issues with normal event text?
      Let's go over that, shall we?
      Why can I only see part of the text in the event creator? By writing your event text in Bundle.properties, you are relieving yourself of this issue by using a text editor instead of the event creator. Unlike the event creator which doesn't let you scroll through your text, a text editor will let you see your text in full, allowing for longer descriptions and clear writing.
      Why did the description I just wrote get deleted when I added a trigger? It is frustrating to spend a few minutes writing an event description only to lose it upon adding a new trigger. But with event localization, you don't have to spend another few minutes retyping your description from the beginning. The next time you lose your description, you can simply retype the description's tag rather than the description itself, saving you some precious time in the event creator.
      Why are all the events in a different language? Ah yes, the classic "events only support one language" issue. This is probably the biggest advantage of using event localization: events can support multiple languages! Let's say that you want your event to support Turkish and English. By writing your English event text in Bundle.properties and your Turkish text in Bundle_tr.properties, players will see the event text in the correct language whether they're playing in English or Turkish. No more confusion or duplicate scenarios for each language!
      Now that you know the steps and advantages of using event localization, I hope you consider using it the next time you add events to a mod or scenario!
    • By Chairman Baad
      When it comes to adding cities to a map, you have two methods for how to do it. The first method is to use the in-game city editor, and while this does work in adding new cities, it doesn't let you change existing cities. It also displays new cities at the incorrect level. The worst part is that it leaves a file for each city, therefore forcing Android modders to add these and bringing their mods closer to the 65,536 resource limit.
      The second method is by using the cities.json files in the map's cities folder. This method requires you to have the map editor open, but the process for adding cities is still quite easy. It also lets you change existing cities and displays cities correctly while only using 1-5 files. Let's go through the steps for using cities.json in a map.
      Go into your map's directory and go into the cities folder. If it does not exist, create it. Add a file for each level of city you plan to create: cities.json for capitals, cities_1.json for major cities, cities_2.json for towns, cities_3.json for villages, and cities_4.json for hamlets. For each new file you created, copy the below example into it. Replace City 1 with your city name, and copy the parts in bold for each city you plan to create on the same level. { cities: [ { Name: "City 1", x: 0, y: 0 }, ], name: Earth }        4. This is the part where you need the map editor: click the point on your map where you want each city to appear. For each point, you will get a
                 set of coordinates in the top-right corner. Replace the "zero coordinates" for each city with the corresponding set you got from the map editor.
      And now you're done! Unless you recreated some cities you made with the in-game city editor, in which case you'll need to delete the city editor versions. But now you can reload your map and see your new cities appear!
  • Popular Now

  • Our picks

  • Tell a friend

    Love Age of History Games? Tell a friend!

  • Posts

×
×
  • Create New...