Music doesn't start up on title screen with very specific setup

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
User avatar
Eizzoux
Posts: 599
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Music doesn't start up on title screen with very specific setup

Post by Eizzoux »

That sounds very specific, but there's a very specific way to make music not play on title screens even when it should.
  • Make a levelset with at least one titlescreen/message and one initial titlescreen/message (for example, titlemessage_1.txt and titlemessage_initial_1.txt),
  • Disable screen fading on both title and title_initial with '.fade_mode: none' with custom graphics,
  • Add a custom global animation in the initial title you have (global.anim_1.TITLE_INITIAL_1, for example),
  • Apply two custom songs, one to the global animation you just made, another to the other non-initial titlescreen/message itself (titlemessage_1: song.mp3, for example),
  • Open the game with the levelset already pre-loaded.
Actually, why am I explaining, here's the levelset for you to try that out.
about_titlescreens.zip
(4.69 MiB) Downloaded 349 times
EDIT: turns out, this also happens if you press escape on title initial if main menu has music.
𒈟
User avatar
Holger
Site Admin
Posts: 4178
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Music doesn't start up on title screen with very specific setup

Post by Holger »

I can reproduce all that you've observed and desribed.

And no, it should not behave that way.

I will have to have a closer look what's going on here in this special case with title screen fading disabled. :?
User avatar
Holger
Site Admin
Posts: 4178
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Music doesn't start up on title screen with very specific setup

Post by Holger »

OK, I've found and fixed the problem. Here is what was going on in detail (from the commit message):

Code: Select all

    fixed stopping music if global anim music differs from current music
    
    As there is only one single music channel, the following edge case
    could happen before this commit: The current screen plays music from
    a global animation, while the next screen plays background music as
    defined for this screen (as it might happen with two title screens).
    When going from one screen to the other screen, the global animation
    music from the first screen is stopped and the background music for
    the second screen is started.
    
    If there is a delay between both screens (typically by fading from one
    screen to the next one), the first music is stopped and the second
    music is started shortly after. Everything works as expected.
    
    However, if there is no delay between both screens (if fading is
    disabled by setup menu or by graphics configuration), stopping and
    starting old and new music happens in the same screen frame. But as
    global animations (including music) are applied *after* the screen is
    prepared (also including music), the music for the new screen is
    started and immediately stopped again by the global animation code,
    which notices the screen change and stops the global animation for the
    previous screen (including stopping music for it).
    
    This is fixed now by only stoping the global animation's music if it
    is still the same as the currently playing music (which would not be
    the case in the edge case described above).
I should release a bugfix version soon, I think (as the code already contains quite a number of fixed bugs for version 4.3.6.0).
User avatar
Eizzoux
Posts: 599
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Re: Music doesn't start up on title screen with very specific setup

Post by Eizzoux »

Forgot to specify something related to that. It seems like it can not only happen when the first screen with global anim music instantly switches to second one with background music with no delay. You see, after posting that I decided to make some kind of manual workaround for such inconvenience. I first made the TITLE have it's own global anim music, which indeed works, but now it, obviously, instead silences MAIN menu music now. So what I instead tried to do is have music play specifically on .part_1 of the animation, and then shut it some time before the title sequence ends with anim delay changing it to .part_2 without any music. Strangely, it still silences the menu music. Well, it first plays it for a frame but then instantly shuts it. I don't exactly have the example on hand, but I'll assume the game still keeps the music sequence active, but just silenced.
I tried instead avoiding it by making the entire TITLE sequence it's own music but exclude the last screen with 'background.titlescreen_5', but nope, that doesn't quite work really, especially considering I forgot it gets silenced by TITLE_INITIAL. Then, I tried assigning the same song for every screen individually except the last one, but that idea is also busted, because song between titlescreens resets each time. In the end I just decided to add a second initial titlescreen and change the animation and music to TITLE_INITIAL_1.
𒈟
User avatar
Holger
Site Admin
Posts: 4178
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Music doesn't start up on title screen with very specific setup

Post by Holger »

I am quite sure that these problems are all caused by the same issue that should be fixed with the above commit now, so no dirty workarounds should be needed anymore.
Post Reply