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

Show splash screen earlier and reintroduce intro music #6412

Open
wants to merge 34 commits into
base: master
Choose a base branch
from

Conversation

bunnybot
Copy link

@bunnybot bunnybot commented Mar 14, 2024

tothxaMirrored from Codeberg
Created on Thu Mar 14 15:41:15 CET 2024 by Tóth András (tothxa)


Type of change
New feature / Refactoring

Issue(s) closed

New behavior

  • Cleaned up intro music related code
  • Cleaned up splash screen handling in MainMenu
  • Always play the menu music in the main menu
  • Added a new hourglass mouse cursor that is used for the splash screen and the game loadin screen. Also use the system "wait" cursor before our own can be used, and have a shorter time without mouse cursor in soft-cursor mode.
  • Don't switch music for the game/map loading screens (it doesn't take that long ;)
  • Added more (verbose) logging points for the start-up (for timing info)
  • Added a rect() method for class Image and converted found applicable places

Possible regressions
Start up, music switching, mouse cursor changes

Additional context
This is the alternative PR promised in #6409 / https://codeberg.org/wl/widelands/issues/4759#issuecomment-1660296

I'd turn all log_info() calls to verb_log_info() at least for the start-up, but maybe that'd be better in a separate PR (also implementing multiple choices instead of just verbose or not).

@bunnybot bunnybot added this to the v1.3 milestone Mar 14, 2024
@bunnybot bunnybot self-assigned this Mar 14, 2024
@bunnybot
Copy link
Author

Assigned to tothxa

@bunnybot bunnybot added enhancement New feature or request cleanup & refactoring Improving our code quality sounds & music Sound effects, music tracks, sound handler labels Mar 14, 2024
@bunnybot
Copy link
Author

frankystoneMirrored from Codeberg
On Thu Mar 14 17:36:24 CET 2024, frankystone wrote:


When using a theme add-on this loads the default splash screen image and not the one of the add-on. In result the default splash is shown and close after that the splash from the add-on is shown and then the main menu.

Is there a way to slow down the startup for testing purposes? Some when i noticed that filling the image cache slows down the startup, e.g. with minimalistic theme a black screen is shown for a short time (~1 sec.) before the splash screen of the addon is shown.

@bunnybot
Copy link
Author

NordfrieseMirrored from Codeberg
On Thu Mar 14 17:47:41 CET 2024, Benedikt Straub (Nordfriese) wrote:


[173/524] Building CXX object src/CMakeFiles/widelands_ball_of_mud.dir/wlapplication.cc.o
FAILED: src/CMakeFiles/widelands_ball_of_mud.dir/wlapplication.cc.o 
/home/benedikt/wl/g/src/wlapplication.cc:1015:24: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
 1015 |         assert(ev.type = SDL_WINDOWEVENT);

@bunnybot
Copy link
Author

NordfrieseMirrored from Codeberg
On Thu Mar 14 17:55:20 CET 2024, Benedikt Straub (Nordfriese) wrote:


After fixing the =/== typo it compiled, but I am still not really happy with this change. In my opinion the intro music doesn't really fit to the gameplay and is better suited to the first startup.

Big +1 for the other cleanup and refactoring changes though :)

@bunnybot
Copy link
Author

tothxaMirrored from Codeberg
On Thu Mar 14 19:52:17 CET 2024, Tóth András (tothxa) wrote:


When using a theme add-on this loads the default splash screen image and not the one of the add-on. In result the default splash is shown and close after that the splash from the add-on is shown and then the main menu.

Oops, I was a bit confused about that. I'm afraid that's very hard to solve, as I don't think we could get this picture from the configured add-on theme early enough.

Is there a way to slow down the startup for testing purposes?

You can add SDL_Delay(<in_millisec>) where you would like to have some...


<@>Nordfriese Thanks, fixed. Why didn't the workflow checks got this?

@bunnybot
Copy link
Author

tothxaMirrored from Codeberg
On Thu Mar 14 22:28:01 CET 2024, Tóth András (tothxa) wrote:


<@>frankystone The last commit should fix the custom splash.jpg problem for most normal use cases, except for the first time it is run. (on first install it should work fine, because in that case there should be no addons) For consecutive runs it should work as long as the user doesn't tamper with the config file and the addons directory.

I can imagine another failure case: if the theme is changed but the game crashes without saving the config.

So this is a simple, mostly cleanish pseudo-solution for 99% of the cases. I hope that suffices...

@bunnybot
Copy link
Author

frankystoneMirrored from Codeberg
On Sat Mar 16 10:29:55 CET 2024, frankystone wrote:


<@>frankystone The last commit should fix the custom splash.jpg problem for most normal use cases, except for the first time it is run. (on first install it should work fine, because in that case there should be no addons) For consecutive runs it should work as long as the user doesn't tamper with the config file and the addons directory.

I can imagine another failure case: if the theme is changed but the game crashes without saving the config.

So this is a simple, mostly cleanish pseudo-solution for 99% of the cases. I hope that suffices...

Yes, that's ok, imho.

@bunnybot
Copy link
Author

tothxaMirrored from Codeberg
On Tue May 21 15:07:46 CEST 2024, Tóth András (tothxa) wrote:


On Mon May 20 22:59:48 CEST 2024, hessenfarmer wrote:

  1. between the first splashscreen and the fding out there is a very short flickering. which does not look good.

Hmm, that's strange. The same function is used to draw the image in both places, and nothing is supposed to draw anything in between. (and it works nicely for me) What kind of flickering is it? Does the window black out, or does its size also change, or is it something else?

So this would be my solution:

  1. initialize sound before graphics by playing the intro before showing the splash (i.e. moving lines 480 to 487 before line 412)

Done, kind of. Though you say you tried this and it works, I'm still more comfortable with initialising the sound after SDL_Init(), as it also uses SDL.

  1. after all loadings are finished keep displaying the splash until at most until the intro music is finished but display the following string "Loading finished - click for main menu"

Will do. Though I didn't really like this the last time I tried it, because the intro music is too long.

  1. switch to menu on click with the current blending

I don't like this suggestion. A click means the user is impatient, we should end the splash as fast as we can.

  1. after intro is finished belnd very short to menu.

I think this one should keep the nice slow fade-out.

@bunnybot bunnybot added the ci:success CI checks succeeded label May 21, 2024
@bunnybot
Copy link
Author

hessenfarmerMirrored from Codeberg
On Tue May 21 21:49:40 CEST 2024, Stephan Lutz (hessenfarmer) wrote:


On Mon May 20 22:59:48 CEST 2024, hessenfarmer wrote:

  1. between the first splashscreen and the fding out there is a very short flickering. which does not look good.

Hmm, that's strange. The same function is used to draw the image in both places, and nothing is supposed to draw anything in between. (and it works nicely for me) What kind of flickering is it? Does the window black out, or does its size also change, or is it something else?

tested it a bit more and it works nicely in windowed mode but gets a short flickering (like 1 frame) in fullscreen mode. It feels like the fading image needs to adopt to the fullscreen.

So this would be my solution:

  1. initialize sound before graphics by playing the intro before showing the splash (i.e. moving lines 480 to 487 before line 412)

Done, kind of. Though you say you tried this and it works, I'm still more comfortable with initialising the sound after SDL_Init(), as it also uses SDL.

works, but only if you recopy the intro.ogg from master. seems the default volume of this file has been changed to zero in your repo.

  1. after all loadings are finished keep displaying the splash until at most until the intro music is finished but display the following string "Loading finished - click for main menu"

Will do. Though I didn't really like this the last time I tried it, because the intro music is too long.

therefore everyone has the possibility to end this with a click.

  1. switch to menu on click with the current blending

I don't like this suggestion. A click means the user is impatient, we should end the splash as fast as we can.

well the fade is 2 seconds which seems to be short in any case however I am ok wizh a hard switch on click.

  1. after intro is finished belnd very short to menu.

I think this one should keep the nice slow fade-out.

ok

some more observations:
a) the cursor is shown before the fading display is shown (i.e. the "Loading.." text is gone), this might suggest the user could have some interaction which is not possible yet. This lasts for approx 2 to 4 sec and might confuse the users.
b) unrelated to this PR: the startup time until the initial splash is blended out is longer then the second start of the program. so there might be room for improvement for the first start as it seems something gets persisted after game closure but oes not survive a reboot.
c) this is a big improvement compared with the 20 seconds black screen of v1.2 at first start (see b)). On my i7 with 16GB Ram machine even the second start lasts approx 10 secs so I thuis might be a candidate for the minor 1.2 service release.

wait for intro music to finish before ending splash screen
hide mouse cursor until splash can be clicked away
@bunnybot bunnybot removed the ci:success CI checks succeeded label May 21, 2024
@bunnybot
Copy link
Author

tothxaMirrored from Codeberg
On Wed May 22 01:11:36 CEST 2024, Tóth András (tothxa) wrote:


The last commit may fix the flickering, hopefully. It also hides the mouse cursor for as long as easily possible — on my system it re-apperas shortly before the footer text changes, as in noticeably, but clearly with less than a second difference.

works, but only if you recopy the intro.ogg from master. seems the default volume of this file has been changed to zero in your repo.

IIRC I only used oggsplt to cut most of the silence at the beginning an the end, which is supposed to only work on the compressed chunks losslessly, without re-encoding. Though it may still create headers that are interpreted differently on different systems?

Also IIRC, and AFAICT we don't have a lossless version of the intro music.

  1. after all loadings are finished keep displaying the splash until at most until the intro music is finished but display the following string "Loading finished - click for main menu"

Will do. Though I didn't really like this the last time I tried it, because the intro music is too long.

therefore everyone has the possibility to end this with a click.

It's not very nice to our users (and ourselves, as far as I'm concerned) to force them to either click away, or sit through a one minute splash screen. And the intro is not only long, but also starts too slowly, so it doesn't work well when clicked away.

b) unrelated to this PR: the startup time until the initial splash is blended out is longer then the second start of the program. so there might be room for improvement for the first start as it seems something gets persisted after game closure but oes not survive a reboot.

Isn't that just the OS caching?

thuis might be a candidate for the minor 1.2 service release.

I think this is not only a new feature, but also much more involved than what we want in a stable hotfix. And IIRC v1.1 (and maybe v1.0) already had a long delay before the splash image appeared.

@bunnybot bunnybot added the ci:fail CI checks failed label May 21, 2024
@bunnybot
Copy link
Author

hessenfarmerMirrored from Codeberg
On Wed May 22 07:54:05 CEST 2024, Stephan Lutz (hessenfarmer) wrote:


The last commit may fix the flickering, hopefully. It also hides the mouse cursor for as long as easily possible — on my system it re-apperas shortly before the footer text changes, as in noticeably, but clearly with less than a second difference.

ok for the mouse, unfortunately not for the dlick in the fullscreen mode.

works, but only if you recopy the intro.ogg from master. seems the default volume of this file has been changed to zero in your repo.

IIRC I only used oggsplt to cut most of the silence at the beginning an the end, which is supposed to only work on the compressed chunks losslessly, without re-encoding. Though it may still create headers that are interpreted differently on different systems?

Also IIRC, and AFAICT we don't have a lossless version of the intro music.

well your version plays in VLC but not in the game. As it has (like the original) a very high bitrate, I just reencoded it to 160 kB as most of our other music files are encoded with that using vlc and this version was working in game as well. I attached it in previous version of this comment but codeberg deleted all this text and just uploaded the file (see previous comment)

  1. after all loadings are finished keep displaying the splash until at most until the intro music is finished but display the following string "Loading finished - click for main menu"

Will do. Though I didn't really like this the last time I tried it, because the intro music is too long.

therefore everyone has the possibility to end this with a click.

It's not very nice to our users (and ourselves, as far as I'm concerned) to force them to either click away, or sit through a one minute splash screen. And the intro is not only long, but also starts too slowly, so it doesn't work well when clicked away.

Starting sequence is what I most like with this file and the silence has been cut by you, however I agree that 50 secs might be too long. What would you say about showing the splash and playing the intro for another 5 or 10 seconds after all the loading has done and then start the fadeout.

thuis might be a candidate for the minor 1.2 service release.

I think this is not only a new feature, but also much more involved than what we want in a stable hotfix. And IIRC v1.1 (and maybe v1.0) already had a long delay before the splash image appeared.

Ok I understand if you feel not comfortable with this, it is just that I find the 20 sec balck screen very annoying and whonder why nobody complained about it yet.

@bunnybot
Copy link
Author

hessenfarmerMirrored from Codeberg
On Wed May 22 07:44:41 CEST 2024, Stephan Lutz (hessenfarmer) wrote:


The last commit may fix the flickering, hopefully. It also hides the mouse cursor for as long as easily possible — on my system it re-apperas shortly before the footer text changes, as in noticeably, but clearly with less than a second difference.

ok for the mouse, unfortunately still a flick in fullscreen mode

works, but only if you recopy the intro.ogg from master. seems the default volume of this file has been changed to zero in your repo.

IIRC I only used oggsplt to cut most of the silence at the beginning an the end, which is supposed to only work on the compressed chunks losslessly, without re-encoding. Though it may still create headers that are interpreted differently on different systems?

Also IIRC, and AFAICT we don't have a lossless version of the intro music.

well, the file in your repo does play with vlc but not in the game on my machine. I notoced that it has a very high bitrate in the original anyway (499kB while most of our other music has only 160 kB) so I tried reencoding your version with vlc to 160 kB, and this works in game with the silence cut as well. I attach it here to let you decide whether you might like it.

  1. after all loadings are finished keep displaying the splash until at most until the intro music is finished but display the following string "Loading finished - click for main menu"

Will do. Though I didn't really like this the last time I tried it, because the intro music is too long.

therefore everyone has the possibility to end this with a click.

It's not very nice to our users (and ourselves, as far as I'm concerned) to force them to either click away, or sit through a one minute splash screen. And the intro is not only long, but also starts too slowly, so it doesn't work well when clicked away.

the slow start has been fixed by your cutting imho, but I agree that the full 50 secs wait is probably too long. So what about showing it another 10 or 5 seconds after all the loading has finished and then fade out. (still abortable by a click for the very impatient of course)

thuis might be a candidate for the minor 1.2 service release.

I think this is not only a new feature, but also much more involved than what we want in a stable hotfix. And IIRC v1.1 (and maybe v1.0) already had a long delay before the splash image appeared.

ok this was just a suggestion, although I really whonder why nobody has complained about that yet. But I undrstand if you don't feel comfortable with this.

@bunnybot bunnybot added ci:fail CI checks failed and removed ci:fail CI checks failed labels May 22, 2024
@bunnybot
Copy link
Author

tothxaMirrored from Codeberg
On Wed May 22 15:39:55 CEST 2024, Tóth András (tothxa) wrote:


The last commit contains another tweak that may help with the flicker... could you please test it?

well your version plays in VLC but not in the game. As it has (like the original) a very high bitrate, I just reencoded it to 160 kB as most of our other music files are encoded with that using vlc and this version was working in game as well.

Wow, that's almost as good as lossless then. Thank you! I re-edited from the original, filtering out the very low frequency (<4Hz) wave it had and with nicer deletions at the start and end, then normalised it to give the volume a little boost, because I like to set the background music lower than other sounds, so the intro plays with too low volume for me... Could you please test whether this works for you: intro_filter_norm.ogg

Starting sequence is what I most like with this file and the silence has been cut by you, however I agree that 50 secs might be too long. What would you say about showing the splash and playing the intro for another 5 or 10 seconds after all the loading has done and then start the fadeout.

I may try that next. At least it has the advantage that it adapts to the actual startup time.

it is just that I find the 20 sec balck screen very annoying and whonder why nobody complained about it yet.

Well, I've only found it mildly annoying, because it's only a few seconds for me with release builds. But I don't have many add-ons enabled.

@bunnybot bunnybot added ci:success CI checks succeeded and removed ci:fail CI checks failed labels May 22, 2024
@bunnybot
Copy link
Author

hessenfarmerMirrored from Codeberg
On Wed May 22 20:37:57 CEST 2024, Stephan Lutz (hessenfarmer) wrote:


your new soundfile works pretty well.
However no change for the flicker.
+1 for the new click behaviour.

I have attached a small video made wih my mobile to show the flickering in full screen mode. (don't bother about no sound is playing - I had my earphones plugged in.

tothxa and others added 3 commits May 22, 2024 23:36
 - high-pass filter >4Hz
 - cut silence at start and end
 - normalise to max without clipping
 - re-encode at ~160k

Co-authored-by: hessenfarmer <[email protected]>
fix swapping main menu background too soon after end of splash
@bunnybot bunnybot added ci:success CI checks succeeded and removed ci:success CI checks succeeded labels May 24, 2024
@bunnybot bunnybot changed the title Show and end splash screen earlier Show splash screen earlier and reintroduce intro music May 25, 2024
@bunnybot
Copy link
Author

tothxaMirrored from Codeberg
On Sat May 25 03:17:02 CEST 2024, Tóth András (tothxa) wrote:


I have attached a small video made wih my mobile to show the flickering in full screen mode.

I have no more ideas how to try to fix it easily. :( I tried stepping through the startup sequence in gdb to find suspects, but without success. Based on your video, it happens a little after the mouse cursor is re-enabled, so it's definitely something in Panel::do_run() or Panel::do_redraw_now() itself. Could it be something in app.handle_input() or handle_notes()? (is the main menu modal?)

fix hourglass cursor use in the progress window
@bunnybot bunnybot added ci:success CI checks succeeded and removed ci:success CI checks succeeded labels May 25, 2024
@@ -178,6 +178,7 @@ function developers() return {
"Florian Angermeier (fraang)",
"DragonAtma",
"Benedikt Straub (Nordfriese)",
"Tóth András",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please read the first line of this file ;-) and do not change this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:success CI checks succeeded cleanup & refactoring Improving our code quality enhancement New feature or request sounds & music Sound effects, music tracks, sound handler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reinstate the Intro Music
3 participants