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

Mimic original DOS behavior regarding music more closely #6684

Closed
DorpsGek opened this issue Mar 5, 2018 · 4 comments
Closed

Mimic original DOS behavior regarding music more closely #6684

DorpsGek opened this issue Mar 5, 2018 · 4 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Mar 5, 2018

nielsm opened the ticket and wrote:

The premise of this patch is that the DOS version of TTD is primary canon, while the Windows version is a port that didn't get everything perfectly accurate. I.e. when using data from the original game, it should act as closely to the DOS version as reasonably possible. However the game data must be used without direct modification.

This patch does three things:

  1. Make the title screen music loop tightly, no pause between loops at all
  2. Remove the long silence in "Can't Get There From Here", which wasn't there in the DOS version
  3. Not play the theme song during regular gameplay

This patch only implements the changes for DirectMusic, since I don't have any systems at hand for attempting to replicate on. I quickly gave up on trying to do anything with the Win32 (MCI) music driver since MCI Sequencer appears to be broken in Windows 10, taking 5+ seconds just to load a single song.

Items 1 and 2 are achieved by adding new annotations to the orig_win.obm file that describes the MIDI timestamps the actual music runs from and to. This allows the music driver to accurately skip the unwanted silences. There is currently an assumption that this will only be used with the original files, to be fully general the code will need at least a partial MIDI file parser to read out the actual time division of the file.

Item 3 is handled by simply special-casing the first entry in the .obm file ("theme"), so if it exists it gets taken out of rotation from the "All" playlist, but still gets used on the title screen. Additionally, the music is restarted when changing game modes, so the theme song doesn't bleed into the gameplay.

Attachments

Reported version: trunk
Operating system: Windows


This issue was imported from FlySpray: https://bugs.openttd.org/task/6684
@DorpsGek
Copy link
Member Author

DorpsGek commented Mar 6, 2018

nielsm wrote:

I think this will also close #6582


This comment was imported from FlySpray: https://bugs.openttd.org/task/6684#comment14865

@DorpsGek
Copy link
Member Author

nielsm wrote:

Cleaned up version of the patchset, split out into multiple logical changes. Application order is music-1, music-2, music-3, music-4. The dmusic-3 patch also depends on patches in #6683 and #5807.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6684#comment14871

@DorpsGek
Copy link
Member Author

nielsm wrote:

If the changes in #6685 are applied, this additional patch to the DirectMusic driver will use the MidiFile class to read correct time scale values from the MIDI file, instead of assuming only the TTD-Windows files are ever used.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6684#comment14873

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
@frosch123 frosch123 removed the Core label Apr 14, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Theme song is whatever song is in the "theme" slot in the baseset music definition.
If the baseset doesn't define a theme song, this change should keep playing from
the playlist as usual, but that's untested. All known music sets have a theme.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
This fixes bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Also number it zero in the music programme window, keeping track numbering of the rest consistent with original TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
This fixes bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Theme song is whatever song is in the "theme" slot in the baseset music definition.
If the baseset doesn't define a theme song, this change should keep playing from
the playlist as usual, but that's untested. All known music sets have a theme.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Also number it zero in the music programme window, keeping track numbering of the rest consistent with original TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
This fixes bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Theme song is whatever song is in the "theme" slot in the baseset music definition.
If the baseset doesn't define a theme song, this change should keep playing from
the playlist as usual, but that's untested. All known music sets have a theme.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Also number it zero in the music programme window, keeping track numbering of the rest consistent with original TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
This fixes bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Theme song is whatever song is in the "theme" slot in the baseset music definition.
If the baseset doesn't define a theme song, this change should keep playing from
the playlist as usual, but that's untested. All known music sets have a theme.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Also number it zero in the music programme window, keeping track numbering of the rest consistent with original TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
This fixes bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Theme song is whatever song is in the "theme" slot in the baseset music definition.
If the baseset doesn't define a theme song, this change should keep playing from
the playlist as usual, but that's untested. All known music sets have a theme.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Also number it zero in the music programme window, keeping track numbering of the rest consistent with original TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
This fixes bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Theme song is whatever song is in the "theme" slot in the baseset music definition.
If the baseset doesn't define a theme song, this change should keep playing from
the playlist as usual, but that's untested. All known music sets have a theme.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
Also number it zero in the music programme window, keeping track numbering of the rest consistent with original TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
This fixes bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 27, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 29, 2018
Theme song is whatever song is in the "theme" slot in the baseset music definition.
If the baseset doesn't define a theme song, this change should keep playing from
the playlist as usual, but that's untested. All known music sets have a theme.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 29, 2018
Also number it zero in the music programme window, keeping track numbering of the rest consistent with original TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 29, 2018
This fixes bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 29, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Apr 29, 2018
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Jun 6, 2018
This improves bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Jun 7, 2018
This improves bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
nielsmh added a commit to nielsmh/OpenTTD that referenced this issue Jun 7, 2018
This improves bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
michicc pushed a commit that referenced this issue Jun 15, 2018
This improves bad looping of title screen song from Windows TTD, and fixes
a long silence at the end of "Can't get there from here" from Windows TTD.
@nielsmh
Copy link
Contributor

nielsmh commented Jun 25, 2018

With #6839 all changes in the original patches have been implemented.

@nielsmh nielsmh closed this as completed Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

3 participants