Music modding

From Stellaris Wiki
Jump to: navigation, search

Version

Outliner top.png
This article is timeless and should be accurate for any version of the game.

Creating a mod that adds music to Stellaris is rather easy. Following this guide, you'll create a mod that is essentially a modular music pack. That is to say, if you create a music pack as described in this guide, then create another, a user could download either or both from the Steam Workshop, install them both concurrently and have all the music that was included in both mods.

Essentially, one music pack does not override the other - you can install multiple over top of one another and so build a whole library of music to listen to in-game.

Getting Started[edit]

Let's take a look at the required folder structure and files. These are the contents of the base game's music folder:

Stellaris/music/[edit]

Folder/File Summary
*.ogg A music file.
songs.asset Controls the assignment of music to a code name, and sets the volume of playback.
songs.txt List of the code names mentioned in songs.asset.

We will use this same structure in our mod in order to add foreign music files to the game.

Setting Up[edit]

First of all, follow the step-by-step modding guide to create the folder structure for your mod and enter all the relevant data in the "YOUR-MOD-NAME-HERE.mod" file that you thusly create.

Once you've done that initial set up, it's time to create the folder structure for your music pack mod.

In quick overview, your created mod's folder will by the end of this guide contain this:

  • a "descriptor.mod" file;
  • a "music" folder containing:
 * music files in .OGG format;
 * a "YOUR-MUSIC-PACK.asset" file;
 * a "YOUR-MUSIC-PACK.txt" file.
  • and finally a "YOUR-MOD-THUMBNAIL.jpg" image for the Steam Workshop.

Mod structure[edit]

So create a folder inside your music pack mod's main folder and call it "music". Add to this folder two files:

  • a "YOUR-MUSIC-PACK.asset" file;
  • a "YOUR-MUSIC-PACK.txt" file.

Call them whatever you like. Personally I call them the same thing as my mod name. So if my mod name is "shrooblord-musicpack", I call them "shrooblord-musicpack.asset" and "shrooblord-musicpack.txt".

However, do note that it's probably prudent that you do not call it "songs.asset" and "songs.txt", because this is the name that Stellaris uses for its own files and doing so might overwrite the base game's songbook.[citation needed]

In order to ensure that no other music packs will overwrite your own songlists, call it something unique like I did for my "shrooblord-musicpack.asset".

Next, put music files in Ogg Vorbis format (.OGG) in this same "music" folder. If you have music files in a different file format, convert them to Ogg Vorbis (44.1 Khz) first. A tool you could use for this is Audacity, which is free.

That's all for the main structure of the mod! Now, let's edit those ".asset" and ".txt" files so that Stellaris actually loads our music pack into the game.

Creating the List of Songs[edit]

To know which file names should be displayed as what song title in-game, Stellaris uses the syntax described below. Follow this same syntax and your music will show up in-game and be automatically played by the music player!

songlist.asset[edit]

First, let's build the ".asset" file; we'll call it "songlist.asset" for sake of simplicity.

So say I have placed in my "music" folder two songs I want to add to the game. One is called "LemonDemon-DinosaurchestraPartOne.ogg" and the other is "FoolsGarden-LemonTree.ogg". To get them to show up in-game, I have to put the following in the "songlist.asset" file:

songlist.asset

music = {
 	name = "Dinosaurchestra - Part One"
 	file = "LemonDemon-DinosaurchestraPartOne.ogg"
 	volume = 0.50
}

music = {
 	name = "Lemon Tree"
 	file = "FoolsGarden-LemonTree.ogg"
 	volume = 0.50
}

What are these entries? The first variable "name" is the name that will show up in the Music Player. The "file" variable is the exact filename of the song as it appears in the "music" folder that's in the mod's main folder you created for this music pack mod. "volume" is a relative volume for the music to play at. All music I have encountered always uses "0.50" as a value, but experiment with what works best for your specific songs.

songlist.txt[edit]

Next, we write the following to the "songlist.txt" file: songlist.txt

song = {
   name = "Dinosaurchestra - Part One"
}

song = {
   name = "Lemon Tree"
}

These are simply the same "name" variables as described in the "songlist.asset" file.

In the references I've seen, the order of the songs in both the "songlist.asset" and "songlist.txt" files are identical; I'm not sure if this is crucial, but it's probably best to follow that example. ;)

Wrapping Up[edit]

And that's really all there's to it! Save these files, open the Launcher and select your mod to load it. Launch Stellaris, open up a game and click the Music Player.

Depending on when your mod loads, which is dependent on the filename of the mod, your music files may appear in different places in the Music Player's list of songs. For example, mine showed up all the way at the bottom of the list, since "shrooblord-musicpack" starts with an "s", which is lower down in the alphabet than the "m" that my other installed music pack mod (simply called "musicpack") starts with. Thus, it loads later and all the songs I added to the game with that mod show up in alphabetical order[citation needed] right after the last song that was added by the other mod ("musicpack").

To get your mod to load last (so you know where to look in the Music Player list of songs), call it something like "zzz-musicpack".

Tools & utilities[edit]

  • Audacity - Powerful, well-documented and free audio processing program that allows you to, for example, convert between music file types.
  • dir2ogg - For Linux users, a very easy command line tool for converting mp3, m4a, wma, and wav files in bulk into the ogg-vorbis format.
  • soundconverter - Also for Linux users, Soundconverter is a no Terminal based bulk converter for the most common formats into the Stellaris needed ones.

See also[edit]

References[edit]


Modding
Static modding DefinesStatic modifiersMapSpeciesTraitsEthosGovernmentsEmpiresPoliciesEdictsTechnologyBuildingsShipsFleetsEventsCrisisAnomaliesAgenda
Dynamic modding EffectsConditionsScopesModifiersGameplayDecisionsObjectivesAI
Media/localisation Maya exporterGraphicsPortraitsFlagsEvent picturesEvent soundsInterfaceIconsMusicLocalisation
Other Console commandsSave-game editingSteam Workshop