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

Splash Image on Android not showing #62863

Closed
ondesic opened this issue Jul 9, 2022 · 15 comments · Fixed by #92965
Closed

Splash Image on Android not showing #62863

ondesic opened this issue Jul 9, 2022 · 15 comments · Fixed by #92965

Comments

@ondesic
Copy link

ondesic commented Jul 9, 2022

Godot version

3.5 rc6

System information

Windows 11

Issue description

For some reason the splash image has stopped showing on android. I have included a simple project that should show the Godot Icon at start. It will on windows and will not on Android.
BTW, The "just show a background color" does work.

I don't know how far back this problem started but it was broken back in 3.4.4 official as well. Hopefully there is an easy fix.

Steps to reproduce

Run the included project. No splash screen image on Android.

Minimal reproduction project

SpashAndroid.zip

@dpensky
Copy link

dpensky commented Mar 28, 2023

This could have something to do with your screen resolution or Android version.
I have 2 smartphones and one of them works and the other doesn't.
Works on Moto G6, with android 9.
Does not work on Samsung A02S, with android 12.
It still happens to this day.

@the-loan-wolf
Copy link

i am on android 13 and splash screen don't show up

@tung-nt-niteco
Copy link

tung-nt-niteco commented Aug 3, 2023

I also have this problem with Godot 4.1, it is just a black screen, what is the solution? :)

@the-loan-wolf
Copy link

Don't use splash screen from project setting, make your splash screen as a new scene and load it as a main scene, attach a script to your splash screen scene and also add timer() node, put as much second as you want to show your splash screen on timer properties and use timer node timeout() signal in the splash screen scene script to change the scene to game menu, get_tree().change_scene_to_file("res://scenes/main.tscn")

@ondesic
Copy link
Author

ondesic commented Aug 3, 2023

Even though I have a custom splash, the problem is that the built in project settings splash will appear faster than a custom one. In the end this just needs to be fixed. I need an instant picture to display at startup, then, the animated splash begins right after.
This works perfect on the desktop and used to work perfect on android until recent changes. Am looking forward to a fix.

@tung-nt-niteco
Copy link

Don't use splash screen from project setting, make your splash screen as a new scene and load it as a main scene, attach a script to your splash screen scene and also add timer() node, put as much second as you want to show your splash screen on timer properties and use timer node timeout() signal in the splash screen scene script to change the scene to game menu, get_tree().change_scene_to_file("res://scenes/main.tscn")

No, the problem is that, the black screen appears for let's say 5 second even before any scene is loaded. I had a Start.tscn instead of Main.tscn, and I did get_tree().change_scene_to_file("res://scenes/main.tscn"), for your information.
I would expect a simple splash screen, i.e. with a tiny logo image, instead of a black screen. Google rejected my app submission due to the black screen, so ... disappointed :(

@ygingras
Copy link

ygingras commented Aug 4, 2023

My game shows a screen with the launch icon for about 3s then briefly flashes a completely black screen for about 0.5s before showing my first scene. I'm not sure which of my project settings gave me this behavior, but it's good enough for Google to approve the app.

@tung-nt-niteco
Copy link

tung-nt-niteco commented Aug 4, 2023

My game shows a screen with the launch icon for about 3s then briefly flashes a completely black screen for about 0.5s before showing my first scene. I'm not sure which of my project settings gave me this behavior, but it's good enough for Google to approve the app.

What Godot version are you using, buddy? Is that Godot 4.x that requires Vulkan support? Just wondering.

And did you simply export AAB file from Godot, or you had any additional steps like this for example: https://github.com/MiqueiasDevGames/Godot-SplashScreen-Android-12#splash-screen-godot-android-solution (the sample Godot code in for Godot3.x so I am lazy to try) or https://github.com/MiqueiasDevGames/export-godot-to-android-without-gradle-32bits-and-64bits?

@ygingras
Copy link

ygingras commented Aug 4, 2023

Godot 4.0.3 with the mobile renderer. I didn't do anything after adding the build templates for Android besides setting my singing key, min_sdk=29, and the main launcher icon (no adaptive). I export to aab using the Godot export menu, upload that Google Play and they usually approve new builds within 3 hours. My very first build took about 2 days to be approved. I only build for "arm64-v8a". I don't know if that makes a difference.

@tung-nt-niteco
Copy link

Godot 4.0.3 with the mobile renderer. I didn't do anything after adding the build templates for Android besides setting my singing key, min_sdk=29, and the main launcher icon (no adaptive). I export to aab using the Godot export menu, upload that Google Play and they usually approve new builds within 3 hours. My very first build took about 2 days to be approved. I only build for "arm64-v8a". I don't know if that makes a difference.

Oh ok, thanks for your info, that is what I did but I got the black screen for 5s, so :( Luck was with you lol.

@ygingras
Copy link

ygingras commented Aug 4, 2023

It might be that my first scene is really simple, no shaders or particles or anything. It's just a screen with a background and a few buttons. The game really starts when tapping on the "Start" button and there is a bit of a pause there on mobile (it's really fast on desktop), probably as shaders get compiled and stuff. I want to play with async preloads to see if I can reduce that pause.

@Calinou
Copy link
Member

Calinou commented Aug 4, 2023

I want to play with async preloads to see if I can reduce that pause.

Godot 4.x doesn't support asynchronous shader compilation yet, so you have to show elements that cause shader compilation for 1 frame before gameplay occurs. (This can be done behind a solid ColorRect.)

@tung-nt-niteco
Copy link

tung-nt-niteco commented Aug 5, 2023

Google has now approved my app. I resubmitted it and it seems like a different person reviewed it this time, and they were able to wait for 5 seconds :)

I also tried creating a simple 3D game in Godot to test it, and saw that it loaded much faster (the black screen only appeared for 1 or 2 seconds, instead of 5 seconds). So, it looks like Godot had to load something in my ‘true’ game, which I haven’t figured out yet, even though my Start.tscn is empty as it will load Login.tscn or Main.tscn later.

I hope Godot can solve this problem to make it simpler for everyone.

UPDATED (2023-Aug-12): I have now noticed that right after I downloaded and installed my game from Google Play and ran it for the first time, the black screen was there for 5 seconds before the UI started to show. However, if I killed the game (app) and ran it again, it only took 2 seconds to start seeing UI screens. I have no clue what happened. :)

@tung-nt-niteco
Copy link

tung-nt-niteco commented Jan 26, 2024

UPDATED (2024-Jan-01): I found the right code to solve this problem: The Start.tscn with only one TextureRect (to display a splash image) is used as the first scene instead of Main.tscn, then this start scene will load Main.tscn with the following code:

func _ready():

#Stop a very short time to trigger UI changes
await get_tree().create_timer(0.2).timeout #<-- the magic is here
get_tree().change_scene_to_file("res://src/Main.tscn")

Start.tscn is loaded very quickly, and regardless of how resource-intensive Main.tscn is, the first scene (Start.tscn) will remain until Main.tscn is fully loaded and switched to.

I used this technique for some of my Godot games, like this: A 2D game
This is particularly useful in 3D games, where the Main.tscn scenes are quite heavy and take time to load, especially on older devices with low specifications.

The same technique is applied when there is a Login scene. While the Main.tscn is loading, the Login scene remains visible with a "Loading game…" message, like this: A 3D game

@Zireael07
Copy link
Contributor

AFAICT this issue report refers to the built-in splash image functionality. Your suggestion is a workaround but does not affect the actual problem.

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

Successfully merging a pull request may close this issue.

9 participants