Announcement

Collapse
No announcement yet.

Async Loading Screen

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [PLUGIN] Async Loading Screen

    About
    Are you looking for a loading system without Level Streaming? If yes, then you already found GOLD

    Normally, you have to use Level Streaming for loading screens due to User Widget is destroyed at level transition, and level loading runs on the main thread, it blocks any other game activities until it's completed. You will need to manually control which object is loaded/unloaded. You can't use different Game Mode, Player Controller for each level, and sometimes there's still occasional freezing.

    That said, you may need to change your game logic to fit with Level Streaming mechanic and it requires a lot of works to achieve a simple thing: Add a Loading Screen. To create a custom loading screen without Level Streaming, you have to do it in Unreal C++. However, this is a hard task for artists and designers, even for developers who are not familiar with the Slate framework and engine module code. Async Loading Screen plug-in comes to a savior.

    Async Loading Screen allows you to easily configure a Loading Screen System in the project settings, and automatically add a Loading Screen whenever you open a new level. Async Loading Screen also comes with pre-design UI layouts and default icons that make it easy to custom your loading screen in a few minutes (less than 5 minutes I swear).

    Trailer



    How it works

    Async Loading Screen uses MoviePlayer to play a movie at level transition, on a different thread than game thread. MoviePlayer is not only playing movie files but also can display a Slate widget on top of the movie. We use this widget for the loading screen.

    MoviePlayer is registered to PreLoadMap and PostLoadMapWithWorld delegates so it will be called and shut down automatically by the engine whenever you open a new level.

    Features
    • Easy to set up, easy to use
    • Customizable premake responsive layouts.
    • Customizable loading icons.
    • Supported animating images sequence.
    • Supported on all major platforms.
    • Easily play movies, audio files.
    • No need for coding.
    • No temporary maps, no level streaming.
    • Automatically handles all level transitions.
    • Integrates seamlessly with an existing project.
    • Free and Open Source (Hell Yeah!)
    Changelog

    Updated version 1.1 (14/09/2020):
    • Added Shuffle option in the movie setting.
    • Implemented set specific background/tip/movie for each level.
    • Added SetDisplayBackgroundManually, SetDisplayTipTextManually, SetDisplayMovieManually options.
    • Changed TipWidgetVerticalPadding to BorderVerticalOffset in Center Layout settings.
    • Changed WidgetHorizontalPadding to BorderHorizontalOffset in Sidebar Layout settings.
    • Add Async Loading Screen Function Library with 3 Blueprint functions:

    Architecture

    Async Loading Screen Settings:



    Async Loading Screen has four main components: Background, Loading Widget, Tip Widget, and Layout.

    • The background is a static image, you can add many images as you want, it will be displayed randomly. Leave it empty if you just want to show a movie instead of a static image.
    • The Tip Widget is just some useful texts that will be shown randomly for players to have something to look at while waiting for a new level loaded.
    • Loading Widget is the most important component of the plug-in, Loading Widget lets players know that the game is still running and not freezing. Loading Widget has two parts: Loading Icon and Loading Text. The Loading Text is just a text shown beside the Loading Icon, we mostly care about the Loading Icon. Async Loading Screen supports 3 types of Loading Icon: Throbber, Circular Throbber, and Image Sequence.

    Throbber loading icon examples:



    Circular Throbber loading icon examples:



    Image Sequence loading icon examples:




    Layout

    This is the way Async Loading Screen widgets are arranged on the screen. In version 1.0 Async Loading Screen supports 5 different Layouts: Classic, Center, Letterbox, Sidebar, and Dual Sidebar.

    Note: Background images are not included in the plugin

    Classic layout example:



    Center layout example:



    Letterbox layout example:



    Sidebar layout example:



    Dual Sidebar layout example:



    Tutorial
    Visit Tutorial section on Github to learn how to use Async Loading Screen.

    Showcases

    - Cursed Spire



    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    If you're using Async Loading Screen plugin in your game and would like to showcase here, shoot me an email to truongbui1689@gmail.com about your game's info, including screenshots(gif/png/jpeg/video) of your in-game loading screen.

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Marketplace: https://www.unrealengine.com/marketp...loading-screen
    Document and Tutorial: https://github.com/truong-bui/AsyncLoadingScreen
    Donate: Async Loading Screen plugin is free and opensource so if the plugin is useful for you or your team, you can buy me a coffee to support this project.

    Acknowledgment
    Async Loading Screen plug-in is inspired from Loading Screen plug-in by NickDarnell
    Last edited by Truong.Bui; 09-14-2020, 10:33 AM. Reason: Resized layout images

    #2
    Hi,

    This is a great plugin and worth a lot. That said I really admire you for making the decision to make it free for us. Thank you.

    And now to the code itself. I have been using Darnell's LoadingScreen for a long time, trying to modify it (kinda works), and I have one burning question that I couldn't figure out: how to manually stop the MoviePlayer (for instance I don't want to play the loading screen before loading the MainMenu level). What I have tried to do:
    • UGameplayStatics::GetCurrentLevelName(GetWorld())) == GetMainMenuLevelName.ToStrin() -> just compared the names
    • GetMoviePlayer()->StopMovie(); -> called when condition is met
    This didn't work very well, it sometimes didn't show up at all. But I guess it was my mistake.
    Anyway, the real pain comes when you set bWaitForManualStop = true. In this case, you must somehow stop the MoviePlayer (level loading is done, but spawning actors and setting their positions from a saved game is not yet done, so I want the LoadingScreen to be preset). In this scenario I have a function that is broadcasted:
    • FOnLoadingCompleted OnLoadingCompleted
    • OnLoadingCompleted calls GetMoviePlayer()->StopMovie();
    Yet the LoadingScreen doesn't disappear. I know this is a big step above the support of the plugin yet I would like to ask you if you know about any solution to solve this mystery To me it appears that the StopMovie() function doesn't work properly. I took a look into the code of the StopMovie, all steps to stop the Movie were met, yet nothing happened.
    My workaround is very primitive, I have created WBP that has only a black image and is displayed until OnLoadingCompleted is called, but you can imagine that the full loading screen logic would be much nicer.

    From this, I have a suggestion for two possible enhancements:
    • Add a new function (might be BlueprintCallable) that will force stop the LoadingScreen display
    • Add an ability to specify Levels (by FString name) that are not affected by the LoadingScreen (even tho it can be done easily in code by myself)
    Thanks for the great plugin once again!

    Dominik

    Comment


      #3
      it there a way to only load specific loading image?

      Comment


        #4
        Originally posted by SychoSevn View Post
        it there a way to only load specific loading image?
        Do you mean to set only a background UTexture2D and nothing else? I guess this will work quite fine. I think you can leave the Loading Widget and Tip Widget null if you need to. Try it out and let us know!

        Comment


          #5
          Originally posted by TheStoryTellers View Post
          Hi,

          This is a great plugin and worth a lot. That said I really admire you for making the decision to make it free for us. Thank you.

          And now to the code itself. I have been using Darnell's LoadingScreen for a long time, trying to modify it (kinda works), and I have one burning question that I couldn't figure out: how to manually stop the MoviePlayer (for instance I don't want to play the loading screen before loading the MainMenu level). What I have tried to do:
          • UGameplayStatics::GetCurrentLevelName(GetWorld())) == GetMainMenuLevelName.ToStrin() -> just compared the names
          • GetMoviePlayer()->StopMovie(); -> called when condition is met
          This didn't work very well, it sometimes didn't show up at all. But I guess it was my mistake.
          Anyway, the real pain comes when you set bWaitForManualStop = true. In this case, you must somehow stop the MoviePlayer (level loading is done, but spawning actors and setting their positions from a saved game is not yet done, so I want the LoadingScreen to be preset). In this scenario I have a function that is broadcasted:
          • FOnLoadingCompleted OnLoadingCompleted
          • OnLoadingCompleted calls GetMoviePlayer()->StopMovie();
          Yet the LoadingScreen doesn't disappear. I know this is a big step above the support of the plugin yet I would like to ask you if you know about any solution to solve this mystery To me it appears that the StopMovie() function doesn't work properly. I took a look into the code of the StopMovie, all steps to stop the Movie were met, yet nothing happened.
          My workaround is very primitive, I have created WBP that has only a black image and is displayed until OnLoadingCompleted is called, but you can imagine that the full loading screen logic would be much nicer.
          ....
          You're welcome TheStoryTellers,

          I was able to manually stop the Loading Screen in the plugin module code, but unable to execute that function in blueprint while Loading Screen was showing. I think if the Loading Screen is showing, then the game thread still blocks other game logics even all levels have been loaded. That's why you couldn't call StopMovie() in the game thread.

          You have to call StopMovie() in Slate's thread, which means you have to modify the plugin's source and implementing your own logic code.

          Comment


            #6
            Originally posted by TheStoryTellers View Post

            Do you mean to set only a background UTexture2D and nothing else? I guess this will work quite fine. I think you can leave the Loading Widget and Tip Widget null if you need to. Try it out and let us know!
            yeah, just leave it empty if you don't want any text.

            Comment


              #7
              For example i do an shooter with different maps and different gamemodes how i can call the right image and tip from the array ? Hope it is understandable

              Cheers

              Comment


                #8
                Originally posted by RatByteOfficial View Post
                For example i do an shooter with different maps and different gamemodes how i can call the right image and tip from the array ? Hope it is understandable

                Cheers
                Unfortunately, the plugin doesn't support show a specific tip/image each level, it can only show randomly tip/image in the array. You have to modify the source and implement your own logic.

                Comment


                  #9
                  Originally posted by Truong.Bui View Post

                  You're welcome TheStoryTellers,

                  I was able to manually stop the Loading Screen in the plugin module code, but unable to execute that function in blueprint while Loading Screen was showing. I think if the Loading Screen is showing, then the game thread still blocks other game logics even all levels have been loaded. That's why you couldn't call StopMovie() in the game thread.

                  You have to call StopMovie() in Slate's thread, which means you have to modify the plugin's source and implementing your own logic code.
                  Thanks for your response!
                  I haven't thought about calling the StopMovie from Slate thread! This is really a good idea, thanks again.

                  Comment


                    #10
                    Originally posted by Truong.Bui View Post

                    Unfortunately, the plugin doesn't support show a specific tip/image each level, it can only show randomly tip/image in the array. You have to modify the source and implement your own logic.
                    Can you get the UWorld from the Slate module? If so, the change might quite simple: instead of TArray of textures make it TMap where Key is FName of the level and value is the Texure. My guess

                    Comment


                      #11
                      Originally posted by TheStoryTellers View Post

                      Can you get the UWorld from the Slate module? If so, the change might quite simple: instead of TArray of textures make it TMap where Key is FName of the level and value is the Texure. My guess
                      Yes, you can access UWolrd via GWorld pointer (GetWolrd() didn't work, I tried). This will print log the current level name in a Slate context:
                      Code:
                      UE_LOG(LogTemp, Warning, TEXT("Current Level Name: %s"), *GWorld->GetName());
                      I may add this option to Background settings in the next version.
                      Last edited by Truong.Bui; 09-12-2020, 06:41 PM.

                      Comment


                        #12
                        Originally posted by Truong.Bui View Post

                        Yes, you can access UWolrd via GWorld pointer (GetWolrd() didn't work, I tried). This will print log the current level name in a Slate context:
                        Code:
                        UE_LOG(LogTemp, Warning, TEXT("Current Level Name: %s"), *GWorld->GetName());
                        I may add this option to Background settings in the next version.
                        This way you could easily add the support for exclude some levels

                        Comment


                          #13
                          Updated version 1.1 (14/09/2020):
                          • Added Shuffle option in movie setting.
                          • Implemented set specific background/tip/movie for each level.
                          • Added SetDisplayBackgroundManually, SetDisplayTipTextManually, SetDisplayMovieManually options.
                          • Changed TipWidgetVerticalPadding to BorderVerticalOffset in Center Layout settings.
                          • Changed WidgetHorizontalPadding to BorderHorizontalOffset in Sidebar Layout settings.
                          • Add Async Loading Screen Function Library with 3 Blueprint functions:
                          Visit Github Tutorial to learn how to use it.

                          Comment


                            #14
                            Originally posted by Truong.Bui View Post
                            Updated version 1.1 (14/09/2020):
                            • Added Shuffle option in movie setting.
                            • Implemented set specific background/tip/movie for each level.
                            • Added SetDisplayBackgroundManually, SetDisplayTipTextManually, SetDisplayMovieManually options.
                            • Changed TipWidgetVerticalPadding to BorderVerticalOffset in Center Layout settings.
                            • Changed WidgetHorizontalPadding to BorderHorizontalOffset in Sidebar Layout settings.
                            • Add Async Loading Screen Function Library with 3 Blueprint functions:
                            Visit Github Tutorial to learn how to use it.
                            You made my day . Thanks for this delicious update , this is what i was waiting for

                            Comment


                              #15
                              UE 4.23 and 4.24 are now supported

                              Originally posted by RatByteOfficial View Post

                              You made my day . Thanks for this delicious update , this is what i was waiting for
                              You're welcome

                              Comment

                              Working...
                              X