StarRuler2-Source
StarRuler2-Source copied to clipboard
Music replacement requirements?
What are the requirements for the music to be replaced? Is .ogg supported? Are file names hard-coded or is there some kind of dynamic music system in place?
I started a collection of potential free music over at OGA: https://opengameart.org/content/star-ruler-2-replacement-music
Even glancing over the data folder tells you all of that.
- all audio files are OGG.
- filenames are defined in
data/sounds/sfx.txt
with common names - audio is used by scripts with proper names
-
To my knowledge, SR2 only supports OGG files.
-
File names are not hardcoded, but you will find it difficult to add music without analyzing the orchestra.txt file, which seems to have been omitted from the files. (The main menu also uses
data/music/title.ogg
, or the contents ofdata/music/theme/
if you're using the Multiple Theme Enabler addon.) -
DarkMio's glance is only valid for non-music sounds.
Couple of Q's:
I see in orchestra.txt that there are multiple arrangements, but also that Era is currently not implemented.
-
How do we predict which Arrangement will be played when? I noticed that the "Ambient" entry of each arrangement isn't set to loop: true, does that mean that once an Ambient track of an Arrangement has finished playing, it would go to the next Arrangement?
-
Under Industrial1, there is a Combat movement which is commented out and not seen anywhere else. Is this movement implemented?
-
I also noticed that under Industrial and Imperial arrangements, only an Ambient track is found. Does that mean that either: 1. the game ignores those arrangements, 2. the game doesn't play the victory/defeat music when it's in that arrangement, or 3. it inherits another movement somehow?
-
Is there a limit to how many Arrangements we can have, or what the names are? Or will the game just loop thru all of them randomly, as long as the format is satisfied?
Thanks!
-
Probably.
-
Dunno.
-
I think it's 2.
-
I suspect it's less "random" and more "go through all declared arrangements in the order they're defined."
So I recorded my voice and played around to try and figure out the pattern.
-
That is the pattern. Confirmed.
-
The "Combat" movement, when I configured it, seemed to always play and override all other sound. It also had some weird reverb effect. I'm assuming this feature is bugged and didn't get fixed, therefore not implemented
-
I started a game and set the time limit to 1 minute. The game ended and I won. While at the "victory" screen, I still only heard the Ambient music playing. I also had a defeat and it was the same issue. This might also be bugged?
-
Turns out it's random. I recorded myself saying numbers and they didn't come in the same order every time
Looks like most of it is bugged and only the Ambient entry is considered. Thoughts?
Spent some time to gather all this info and made a little Playlist generator (orchestra.txt) which is hosted on my github
https://github.com/powercat/Star-Ruler-2-Orchestra.txt-generator
After seeing that most of the file's Movements didn't work, I trimmed it down and that's the result. Only kept the "Ambient" movement cause that's the only one that seems to work.
- The victory/defeat music changes its volume based on how many ships have recently been destroyed or lost by the player. It's "I'm winning/losing this battle", not "I've won/lost the game".
The victory/defeat music also never played while on combat or after having destroyed ships.
The way I tested it was to have this orchestra.txt:
Arrangement: Exploration1
Era: Exploration
Movement: Victory
Track: data/music/victory1.ogg
Loop: true
Volume: Ambient.playing * 0.15 * (ships_destroyed.acc / (4 + ships_destroyed.acc))
Movement: Defeat
Track: data/music/defeat1.ogg
Loop: true
Volume: Ambient.playing * 0.25 * (ships_lost.acc / (4 + ships_lost.acc))
Movement: Ambient
Track: data/music/ambient.ogg
Volume: min(0.25, 1.0 - (Victory.volume + Defeat.volume) * 0.5)
And each ogg file was of me saying that word, ie "victory sound one", "defeat sound one", etc.
Got in a few battles, destroyed a bunch of ships, but only ambient was ever playing.
Turns out I was wrong about the defeat/victory music. I've modified the orchestra.txt generator to have more options for ambient, victory and defeat.
It now has 3 tabs to add songs to the playlist of each Movement, and when you generate it they'll just match up sequentially and loop the list of victory and defeat. Also added a shuffle button :)
https://github.com/powercat/Star-Ruler-2-Orchestra.txt-generator/releases/tag/1.1
Just wanted to add a note. Using the songs on poVoq's page, I suffered frequent crashes.
So I used winlame to re-convert the ogg to static bitrate ogg and it resolved the crashing issue.
There must have been something in the files that wasn't compatible. Maybe the fancy ogg stuff like album art, etc.
Could you share your re-encoded files somewhere?
I've uploaded them at the same github page as the playlist generator I wrote, you can grab it from release: https://github.com/powercat/Star-Ruler-2-Orchestra.txt-generator/releases