Godot version:
3.0.6 stable
OS/device including version:
android
Issue description:
https://godotengine.org/qa/31465/splash-screen-doesnt-show-up-most-of-the-time
Bugsquad edit: Copied from above link:
I'm developing an Android game using Godot 3.0.6 stable and for some reason the splash screen behaves differently everytime I run the game in my phone. Most of the time it doesn't appear, I get a black screen (rather than the image I selected) for about 3 seconds. Sometimes my splash image does appear but only after 2 seconds (more or less) of showing a black screen (and it shows up only for a fraction of a second which makes it useless).
I've tried other games from Play Store and the splash screen loads almost instantly. Is there any way to speed up the splash screen? I've already tried:
None of these seemed to work.
Steps to reproduce:
Minimal reproduction project:
I have the same issue but no clue to fix it...
I'm having the same issue on v3.1.1 stable. The boot splash image that I selected does not show on Android, but works fine on the editor.
I'm also having this issue on v3.1.1 stable. I managed to get it to show up briefly by resizing the splash image to be a power of two (2048x1024 for me) which isn't ideal, but it still only shows up for a fraction of a second before the game starts, with most of the loading time just showing a black background.
I am also having this issue in v3.1.2 stable. So far I can find no way to get the splash screen or custom colour to show up on android devices. Does anyone have any idea what could be causing this?
Still present in 3.2-beta6.
i have the same problem on 3.2.1 stable :S
Same for me on 3.2.1 stable.
I noticed though that the splash screen works perfectly while the phone is plugged in the PC.
As soon as I unplug it and run the game again, the splash screen doesn't show up anymore.
Any updates on this matter?
ROOOOOAAARRRRR !!! :-)
This is just in case Godot needs a wake-up call for a critical issue for any game maker who respects herself on an issue opened 2 years ago with no assignee, no milestone, and with a proven track record of being forgotten.
Jesus, Godot can't even show its splash screen reliably...
Under circumstances to be determined, the boot splash screen is consistently not showing on startup for mobile devices on both Android ans iOS. which is unacceptable. I am providing a minimal project which reproduces the problem reliably for those devices where this is true.
The project is a 2 node main scene where one load node is defined in terms of 32k pass statements keeping the parser/bytecode compiler busy for some time until it's done, then the second label node is shown which attests for the end of the startup sequence.
It's not a GLES2 vs GLES3 thing, because I have a project where the boot splash is showing consistently with GLES3 while not showing consistently with GLES2 on both Android and iOS, but the attached minimal project triggers the issue reliably on both GLES2/3 for relevant devices (presumably weaker ones).
Someone with a good understanding of the boot sequence shall have a look. An uneducated guess is that in case it's a multi-threading issue, the visual server doesn't have a chance to run while the parser is fully loaded. Which explains the sporadic behavior of the problem for some devices and not for others. Yet, I could be completely wrong.
Try this minimal reproduction project on a mobile device. Thanks.
Boot_Splash.zip
Okay, after some investigation I think I understand what's going on here. At least on Android, but I suspect iOS has a similar issue. I don't have a solution but hopefully the explanation will help fixing it appropriately.
Basically the main boot process is split in 2 steps, setup() and setup2().
Setup() does the command line parsing and initializes the video server/renderer (GLES2/3) then if all goes well, setup2() handles the boot logo image. It scales it depending on settings and calls the renderer which writes to the default system FBO (on the first frame ever). Then the rest of the initialization follows and the project is loaded/parsed/etc,
This logic is fine and works as intended. On Android, however, the experience is the following:
1) boot splash shows on the first run (cold start)
2) black screen on subsequent runs during boot (presumably due to caching)
The problem comes from the Android app styling. The two concepts: boot sequence & app theme interfere (or are not correlated, nor ordered) and the styling overwrites the boot splash because the background is defined as black. The AndroidManifest.xml
file says:
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
Which basically puts a layer of black background after all the nice work of Godot setting the boot splash. To validate this hypothesis, I've hacked this definition to:
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
and magically the boot splash started to appear every time (modulo status bar artefacts of course).
So this is where it all comes from on Android. That black theme overwrites the boot image. I've been reading this Android Splash Screen Guide but I am at loss on how to integrate that properly and whether it is the right thing to do.
I will be looking into the iOS side of things to check why we get the same black screen there.
Hope this helps.
CC @m4gr3d, see above comment.
any game maker who respects herself
Come on, how many female game makers are there, 5%? Did you have to use a feminine pronoun instead of the conventional English pronoun to virtue-signal? By the way, I am not saying this because simply its feminine. I have no problem with "Ladies and gentlemen".
Thank you.
What did you use to hack the definition android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"? I've tried apktool and android studio, still have no idea how to actually edit the code, I can see it, but can't change it.
@TomatoVerified You would need the godot source tree, modify the file godot/platform/android/java/app/AndroidManifest.xml
and recompile.
Ok, now my phone freezes and then the game begins and runs normally. The black screen no longer shows, but my custom bootsplash image doesn't show up either. Is there another way to fix this?
@TomatoVerified What's the splash screen format and dimensions? Some devices only accept power-of-two sizes for textures.
format: PNG
dimensions: 424x848 pixels
@TomatoVerified Try resizing the image to 512脳1024 and see if it works. Also, which Android device are you using?
Tried resizing, still not working. I am using Asus Zenfone Max Plus (M1) ZB570TL
@oeleo1 I have the same problem with my first Godot game (no splash screen shown, just a black screen) and I found your minimal reproduction project quite interesting.
Playing with it, I managed to workaround the issue just replacing the project's main scene with a simple boot scene with just this code:
func _ready():
get_tree().call_deferred("change_scene", "res://Main.tscn")
With this, the splash screen is shown for all the time needed to load and show the Main.tscn scene (and the starting boot scene is actually never shown)
Unluckily, applying this solution to my project, I still see the black screen for some seconds before the splash is shown, but I think that's because I also have some autoload singletons... (which I think I will remove from the autoload list and load them only when needed(
So, this is certainly not a solution but that's how we can sort of work around this issue
Indeed, the current state of affairs is that using boot splash on mobile is a no go. The right way to do it is to have a minimal load scene which shows whatever is desired and use background loading.
This issue should be addressed in Godot 3.2.4 by PR #41384.
Feel free to give it a try and provide feedback!
Fixed by #41385.
Most helpful comment
Okay, after some investigation I think I understand what's going on here. At least on Android, but I suspect iOS has a similar issue. I don't have a solution but hopefully the explanation will help fixing it appropriately.
Basically the main boot process is split in 2 steps, setup() and setup2().
Setup() does the command line parsing and initializes the video server/renderer (GLES2/3) then if all goes well, setup2() handles the boot logo image. It scales it depending on settings and calls the renderer which writes to the default system FBO (on the first frame ever). Then the rest of the initialization follows and the project is loaded/parsed/etc,
This logic is fine and works as intended. On Android, however, the experience is the following:
1) boot splash shows on the first run (cold start)
2) black screen on subsequent runs during boot (presumably due to caching)
The problem comes from the Android app styling. The two concepts: boot sequence & app theme interfere (or are not correlated, nor ordered) and the styling overwrites the boot splash because the background is defined as black. The
AndroidManifest.xml
file says:Which basically puts a layer of black background after all the nice work of Godot setting the boot splash. To validate this hypothesis, I've hacked this definition to:
and magically the boot splash started to appear every time (modulo status bar artefacts of course).
So this is where it all comes from on Android. That black theme overwrites the boot image. I've been reading this Android Splash Screen Guide but I am at loss on how to integrate that properly and whether it is the right thing to do.
I will be looking into the iOS side of things to check why we get the same black screen there.
Hope this helps.