Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Music replacement requirements? #3

Open
poVoq opened this issue Jul 24, 2018 · 12 comments
Open

Music replacement requirements? #3

poVoq opened this issue Jul 24, 2018 · 12 comments

Comments

@poVoq
Copy link

@poVoq poVoq commented Jul 24, 2018

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
Copy link

@DarkMio DarkMio commented Jul 24, 2018

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
@DaloLorn
Copy link
Contributor

@DaloLorn DaloLorn commented Jul 24, 2018

  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
Copy link
Contributor

@OlivierGagnon OlivierGagnon commented Jul 26, 2018

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!

@DaloLorn
Copy link
Contributor

@DaloLorn DaloLorn commented Jul 26, 2018

  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
Copy link
Contributor

@OlivierGagnon OlivierGagnon commented Jul 27, 2018

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
Copy link
Contributor

@OlivierGagnon OlivierGagnon commented Jul 27, 2018

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
Copy link
Contributor

@DaloLorn DaloLorn commented Jul 27, 2018

  1. 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
Copy link
Contributor

@OlivierGagnon OlivierGagnon commented Jul 27, 2018

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
Copy link
Contributor

@OlivierGagnon OlivierGagnon commented Jul 28, 2018

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
Copy link
Contributor

@OlivierGagnon OlivierGagnon commented Jul 28, 2018

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
Copy link

@ethchest ethchest commented Jul 30, 2018

Could you share your re-encoded files somewhere?

@OlivierGagnon
Copy link
Contributor

@OlivierGagnon OlivierGagnon commented Jul 31, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants