BlindMindStudios / StarRuler2-Source

4X Space Strategy game Star Ruler 2's open source distribution.
http://starruler2.com
Other
1.45k stars 243 forks source link

Music replacement requirements? #3

Open poVoq opened 5 years ago

poVoq commented 5 years ago

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

DarkMio commented 5 years ago

Even glancing over the data folder tells you all of that.

DaloLorn commented 5 years ago

1) To my knowledge, SR2 only supports OGG files.

2) 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 of data/music/theme/ if you're using the Multiple Theme Enabler addon.)

3) DarkMio's glance is only valid for non-music sounds.

OlivierGagnon commented 5 years ago

Couple of Q's:

I see in orchestra.txt that there are multiple arrangements, but also that Era is currently not implemented.

Thanks!

DaloLorn commented 5 years ago

1) Probably.

2) Dunno.

3) I think it's 2.

4) I suspect it's less "random" and more "go through all declared arrangements in the order they're defined."

OlivierGagnon commented 5 years ago

So I recorded my voice and played around to try and figure out the pattern.

  1. That is the pattern. Confirmed.

  2. 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

  3. 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?

  4. 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?

OlivierGagnon commented 5 years ago

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.

DaloLorn commented 5 years ago

3) 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".

OlivierGagnon commented 5 years ago

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.

OlivierGagnon commented 5 years ago

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

OlivierGagnon commented 5 years ago

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.

ethchest commented 5 years ago

Could you share your re-encoded files somewhere?

OlivierGagnon commented 5 years ago

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